View previous topic :: View next topic |
Author |
Message |
aaronik19
Joined: 25 Apr 2011 Posts: 297
|
rs485 phrase |
Posted: Fri Dec 30, 2011 12:20 pm |
|
|
Hi All,
I came across this code:
Code: | char RS485getc() {
rs485_get_message(msg, TRUE);
return msg[2];
}
|
What does this means:
Thanks for your help. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1941 Location: Norman, OK
|
|
Posted: Fri Dec 30, 2011 12:26 pm |
|
|
The function is defined to return a char, so the return statement is returning
the character stored in the array location msg[2]. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
aaronik19
Joined: 25 Apr 2011 Posts: 297
|
|
Posted: Fri Dec 30, 2011 12:43 pm |
|
|
thanks for the reply. In RS485, If I want to send the following statement like c=23 (similar to RS232), how I can achieve it with RS485?
if I am using rs485.c driver, do I need to include #int RDA or it is being take care in the rs485.c driver? lots of thanks to all |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9268 Location: Greensville,Ontario
|
|
Posted: Fri Dec 30, 2011 1:58 pm |
|
|
You have to understand that RS-485 and RS-232 are just variations of serial communications . The main difference is RS-232 is normally 'peer to peer', ie: 2 devices, usually full duplex, each can talk while the other listens.
RS-485 is usually a 'networked' system, half duplex. there's a 'master'(talker) and several 'slaves'(listeners). Control for whose in charge is done by the 'enable' control pins of the transceiver chip ( MAX488 or eq.)
HOW you send data is up to you....typical setup is same as 'RS232' being 8 bits,1 stop bit,no parity, baudrate of 9600 but there are no rules except being compatible with the hardware in the systems. |
|
|
|