LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication protocol

i must decide with the constructor of my custom card the communication
protocol via serial interface.
anyone can help me with example of message based protocol?

thanks

david
0 Kudos
Message 1 of 3
(3,190 Views)
My collegue, an electronics developer, developed some communication-protocols for device-PC serial communication. Mostly the devices computing capabilities are the limiting factor (processor-speed and memory is low) so it is wise to do the optimisation on that platform.
If you have a low-end application that is non-critical you could device a simple protocol.
Try to look at the web (it was advised to you before) to get inspired by the many, many developers that went the same way.
You will typically find these kind of protocols in the command-set description of small serial measurement/control devices.
Sorry but, I cannot give you my protocols for free since a lot of development-time was involved.
Anyhow, good luck
0 Kudos
Message 2 of 3
(3,190 Views)
Just my 2c worth -- you need to make sure that you can easily convert the incoming characters to message and determine if messages are valid before processing -- usually by using distinguishing start and end of message characters (such as ASCII STX and ETX) and by including a message length byte and some simple checksum (such as an XOR of the characters in the message). Also for shorter messages I would give a higher weight to ease of parsing, while for longer messages reducing the size of the message might be more important (for example a message which returns
"A=3,B=50,C=300" where A,B,or C is in the range 0-999 I would just as soon see "A=003,B=050,C=300" so I can get the values from the message by position rather than parsing the string for tokens. however
if the message returns 2000 values its might be better to leave off the leading 0's and parse the message.) Also, depending on what the device does their is sometimes a message to switch between polling for status vs asynchronous sending of messages from the device. I am not sure if this is the kind of info you are looking for or not? I have also included an attachment for the protocol to a cm11a X10 controller (not because I think it is a template to follow, but just because I needed to use it recently and had it laying around -- it may be harder to understand than its worth????)
0 Kudos
Message 3 of 3
(3,190 Views)