07-28-2020 04:57 PM
Hi there!
I'm pretty new to Labview and I am trying to see if I can use it to interact with one of my instruments in my lab.
I have this device with a serial port that - in theory - can be used to control it remotely (give commands and read data). The instruction manual shows the example of using Hyperterminal to perform the remote operations, but nothing more. I attached an extract from it with the protocol info, to help whomever is reading this.
I read online that you can use a USB - Serial adapter with Labview, together with the VISA drivers, to perform the same tasks. I tried to put together a VI (which I attached to this post) but as I "write" something, I don't see anything coming out in the "read".
What am I doing wrong? I'd like to learn more about this!
Thanks a bunch!
Paolo
07-29-2020 06:25 AM - edited 07-29-2020 06:26 AM
I cleaned up your VI to fix a few things. First of all, DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis) By default, VISA uses a termination character to stop the VISA Read. So you just have to tell it to read more bytes than you ever expect in a line. The other thing I did was concatenate a Carriage Return to the write buffer so the instrument knows the command is complete.
And finally, a shameless plug for a presentation you really should go watch right now: VIWeek 2020/Proper way to communicate over serial
07-29-2020 08:22 AM
Hey!
Thanks a lot for the help 🙂 I'll try the Vi straight away! I'll also look at the presentation, I need to learn!
I'll keep you posted!
Paolo