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

Serial device that echoes + multiples lines of output

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



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

Serial device that echoes + multiples lines of output
PostPosted: Fri Aug 16, 2013 5:03 am     Reply with quote

#define Serial RS232
Whats the best way to communicate with a device that echoes everything to the serial port and returns output in multiple lines?

Basically i send commands to the device and device responds in multiple lines.
I have to parse it and take appropriate actions.

ps the device can still transfer important info even if not commanded.
temtronic



Joined: 01 Jul 2010
Posts: 9208
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Aug 16, 2013 5:17 am     Reply with quote

Best is to modify the Serial receive Interrupt example that CCS supplies called 'ex_sisr.c' in the examples folder.It allows the PIC to receive data without 'polling' or waiting for xxx characters to come in.
You'll also need a 'parsing' function.There are several 'threads' about that here.Just search for 'GPS' or similar codewords.How you parse is up to you, as only you know what data is relevent.

hth
jay
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