03-19-2018 09:25 AM - edited 03-19-2018 09:27 AM
I would like to ask what is the best approach to make a reliable serial driver for such device where the manufacturer made a questionable communication protocol. At least I do not see termination character mentioned in the manual, so I cannot follow the usual "request/reply-VISA Write/Read with term character" method. It also makes me worried when I see such lines in a manual as this: "If RS-232 communications does not seem to be functioning, cycle the main power to reset." 😄
I attach the manual (RS232 protocol from page 20.). If someone could give some guides, or a link where such approach was followed in similar case? I guess the key here is to "VISA write/read" not too frequent, and check whether enough data bytes arrived back as response, and whether the data makes sense. If not, dump data and retry...
Thanks for any advice!
Solved! Go to Solution.
03-19-2018 10:07 AM - edited 03-19-2018 10:08 AM
You've got it. Just try to read the expected number of response bytes with a reasonable timeout (probably not more than a second), and once you receive the bytes make sure the value they contain is reasonable, that's about the best you can do. Don't send commands any more frequently than the three commands per second specified in the documentation. If any additional bytes are received beyond what you're expecting it can get you out of sync with the transmitter, so to be safe you may want to flush the receive buffer before sending each command.
03-19-2018 10:13 AM
Hi Blokk,
I guess the key here is to "VISA write/read" not too frequent, and check whether enough data bytes arrived back as response, and whether the data makes sense. If not, dump data and retry...
Yes, that's what I would do…
- Send command byte, read one or two byte response.
- Send command byte with one or two bytes parameter content.
- As it's pure polling you need to handle that request-response-game anyway…
such device where the manufacturer made a questionable communication protocol.
I'm more worried about devices using °F for temperature unit… 😄
02-23-2020 04:14 PM
Hi Blokk! Sorry to necro post but I came across this question looking for the exact same information using the same equipment (Thermocube 200). I'm still struggling with this thing's dodgy communication scheme, just wondering if you ever got it to work
Thanks
02-23-2020 10:29 PM
Hello!
This is what I have found (attached zip). As i can recall, it was functional, but I left that lab quite some time ago.
If you get problems, I can contact my ex-colleagues and ask them if they still use this very lib for their ThermoCube.
Good luck!
regards,
02-24-2020 08:11 AM
Thank you so much for sharing this! And so quickly too! It looks quite similar to what I tried so maybe I have a hardware problem. I'll give it a shot tonight and see if I can get some traction
09-28-2022 08:50 AM
Hi,
Any chance you could share these vi's in a format that my LV 2015 can open?
Thanks,
Ben.
09-28-2022 08:55 AM
Hey there, Ben. Attached is my final API, saved for LV 2015. Good luck!
09-28-2022 09:35 PM
No termination character is covered in this video:
VIWeek 2020/Proper way to communicate over serial
09-29-2022 03:07 AM
Thanks so much!