Pages: 1 2 [3]   Go Down
Author Topic: send command via rs232  (Read 4468 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I mistake my response.
I solder TX with RX that is the pinout of RS232 connector. This is my scheme:

DFROBOT  TX->  Arduino pin 7
DFROBOT  RX->  Arduino pin 8
DFROBOT  VCC ->  Arduino 5V
DFROBOT  GNG -> Arduino Gnd

solder in DFROBOT DB9 pinout TX and RX  (2 and 3)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear all:
I have changed to an Arduino Mega.
I have tried the loopback and is OK. The character that I send, I receive it.
I have changed my code. because Arduino Mega. This is my new code:

void setup() 
{
  Serial.begin(9600);
  Serial3.begin(9600); 
 }

void loop()                     
{
  if (Serial3.available()) {
      Serial.print((char)Serial3.read());
  }
  if (Serial.available()) {
      Serial3.println((char)Serial.read());
   
  }
}
I have connected my device Extron to DFROBOT RS232  through  to Serial3 of Arduino,
Then, I sent this command:   !   (admiration), and the device must respond the input selected.
But I have no response from the device.
When I send the command:  !,  I see that Rx of DFROBOT light, but doesn't light the TX light. I mean, I don't get response from the Extron device.
Can you help me please?
Many thanks
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26497
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the bit rate correct?
Is the character format (8,n,1) OK for the receiver?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Baud rate is 9600 for Arduino and Extron device.
Other parameters, Do I have to configure it writing code?
How can I do it?
 
Parameters for Extron device are:
Parity bit : none
Data bit: 8
Stop bit: 1
Handshake: none.
Thank you very much
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34572
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Parameters for Extron device are:...........
That is the same as the arduino so there is nothing extra to do.

Quote
When I send the command:  !,  I see that Rx of DFROBOT light, but doesn't light the TX light. I mean, I don't get response from the Extron device.
This would suggest you are not sending the correct command. Your code is wrong try this:-

Code:
void setup()
{
  Serial.begin(9600);
  Serial3.begin(9600);
 }

void loop()                     
{
  if (Serial3.available()) {
      Serial.write((char)Serial3.read());
  }
  if (Serial.available()) {
      Serial3.write((char)Serial.read());
   
  }
}
Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Extron device

Any datasheet ? I would like to see it. Maybe you need to read the datasheet of the so call "Extron device"

Ok... You want to send ---> !  Is it ASCII code ? or a binary code ?  If I have a device to received a data, I need to know :

Baud rate
8 bits
Parity or Not
Stop bits
Start bits

So your device is : 9600 baud - 8 bits - no parity - 1 stop bit  OK
Code sequence into the device ?   Answer in the datasheet <-- Maybe  ASCII into the device ?  Answer in the datasheet <-- Maybe

You see what I mean ....
« Last Edit: April 11, 2012, 06:13:02 pm by Techone » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you to all.
Here you can download the manual:
http://media.extron.com/download/files/userman/68-791-01_IN1508_UG_H.pdf
At the end of the manual are the codes to control it and some samples.

Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34572
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So the first thing I would do is to see if it is talking to you, the book says:-
Quote
When a power-up occurs, the switcher responds by sending the following message to the host:
Copyright 2005, Extron Electronics, IN1508, Version x.xx] Version x.xx is the firmware version number.
So write some code to see this message by transferring it from the software serial input to the hardware serial output and displaying it on your monitor.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much.
I have tried with the new code and When I connect Extron I don't get anything.
Must be a problem with the cable? Do you know the pinout?
I don't know how to solve this.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34572
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't know how to solve this.
You solve it by using the right tools. Use an oscilloscope to see that your device is sending data to you. You use it also to see that you have got the baud rate right and that the signal is the right way up. It should go to a logic one after it has finished sending stuff.
If all that checks out you look again at your software serial stuff and see it is recieving.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How I said in a above message, I connected the device right to a PC and hyperterminal and I get the the message from Extron device.
I have no an oscilloscope is to expensive for me. Is there any other to posibility to test it? or oscilloscope software?

Do you know other cheap serial devices to make trying with Arduino and serial?
Many thanks
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26497
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tell us what equipment you do have, and what equipment you know how to use.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: 1 2 [3]   Go Up
Jump to: