03-05-2013 04:42 PM
I have a thermometer that connects to computer using RS232 protocol. I tried the simplest Read and Write vi to get data from the device. But it returns something in a form of ASCII symbols, which are not displayed correctly. I have some protocol from the manufacturer with commands, but cannot figure out how to form a command to get temperature data. Could someone suggest anything about my issue?
ps
Below I attached that protocol
03-05-2013 05:08 PM
@alex_mikh wrote:
I have a thermometer that connects to computer using RS232 protocol. I tried the simplest Read and Write vi to get data from the device. But it returns something in a form of ASCII symbols, which are not displayed correctly. I have some protocol from the manufacturer with commands, but cannot figure out how to form a command to get temperature data. Could someone suggest anything about my issue?
ps
Below I attached that protocol
Probably your serial port isn't set up correctly. Can you communicate with the instrument through hyperterminal?
03-05-2013 05:15 PM
hello,billko!
I didn't try. My knowledge about LabView are weak. Could you describe how to communicate with serial device by hyperterminal?
regards, Alex
03-05-2013 05:46 PM
No, the format is not straight ASCII. You will need to convert the returned string to bytes with the String to Byte Array function. Each byte will need to be interpreted according to the document. Some bytes will need to be combined and then typecast. For example, the time interval is returned as two bytes with the first byte representing minutes and the second byte is seconds. Some of the other data is more complex.
03-05-2013 05:52 PM
@alex_mikh wrote:
hello,@billko
I didn't try. My knowledge about LabView are weak. Could you describe how to communicate with serial device by hyperterminal?
regards, Alex
Hyperterminal is a standalone serial communications application. If you can communicate with your instrument through Hyperterminal, the chances of communicating with your instrument in LabVIEW go way up...
03-05-2013 06:31 PM
i was able to check my serial connections with some vi (found it somewhere here). So, the device definitely can send some information (see below), but I have no idea how to understand the answer. Maybe I should use particular command to get temperature data to thermometer? I have protocol that came with it (attached below), but can figure out which command to use.
03-05-2013 07:43 PM
03-05-2013 07:50 PM
Nice idea!
Don't know exactly how to capture ASCII / HEX commands which the device's own software used to communicate with it though( will try. Thanks!!
03-06-2013 01:14 PM
I tried to use portmon as was recommended and captured some data. But they are again in some weird form: it is neither HEX code nor numerical symbols. I'm confused(
03-06-2013 04:11 PM
The log shows that the instrument periodically sending some data though the number of bytes is not consistent. You see it will the lines that say "READ VCP0" which I think is virtual com port 0. Some are 22 bytes long and some are shorter. My recollection of portmon was that you could see the entire message. Perhaps when saving to the log file is different. The vendor's program does not appear to write anything. Just checks to see if any data in the buffer.