LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing a protocol

Hi,

 

I am using a solar sensor which communicates by RS-485, and I am using a converter to RS-232 to connect it to my PC. The sensor has its own proctocol, I need some help or advice to start implementing the new protocol to communicate with it. The specifications are shown in the pdf.

 

If you can give me some example or something like that to start it d be great.

 

Thanks so much.

 

 

0 Kudos
Message 1 of 2
(1,973 Views)

Talking to serial is usually done using NI VISA from within LV. VISA (as serial) is a string based protocol, sending individual bytes.

So what you are talking about is the "protocol layer" sitting above VISA to create the data packages your PDF document is showing. So you have to assembly (write) or disassemble (read) the protocol packages in your software.

Essentially, you know the data bytes (command, N bytes) and have to prepend the ID/DTS and append the checksum (which you'd most probable have to compute for each package, right?).

Reading must either know the length of the message (N+3, is that constant?), wait some seconds and read what is in the buffer (danger: collecting multiple packages) or use a defined termination character you use to detect a "End Of Message".

Regarding to your selection (does the sensor accept any of those at all?) you have to disassemble the message into ID/DTS, message body and checksum. Make a little sanity check (is checksum correct for message body), then "interpret it".

 

Interpretation can be done using a statemachine.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 2
(1,963 Views)