CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

rs485 phrase

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
aaronik19



Joined: 25 Apr 2011
Posts: 297

View user's profile Send private message

rs485 phrase
PostPosted: Fri Dec 30, 2011 12:20 pm     Reply with quote

Hi All,

I came across this code:

Code:
char RS485getc() {
   rs485_get_message(msg, TRUE);
   return msg[2];
}


What does this means:
Code:

   return msg[2];


Thanks for your help.
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Dec 30, 2011 12:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 30, 2011 12:43 pm     Reply with quote

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: 9164
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Dec 30, 2011 1:58 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group