Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to use a Serial - USB adapter to interact with instrument

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

Download All
0 Kudos
Message 1 of 3
(1,184 Views)

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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
0 Kudos
Message 2 of 3
(1,145 Views)

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

0 Kudos
Message 3 of 3
(1,138 Views)