LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Serial Control

Solved!
Go to solution

I am attempting to communicate with a Neslab Chiller. The instrument takes hexadecimal commands. In NI VISA Interactive Control I am able to communicate and get the correct responses back from the instrument. Unfortunately, when I attempt to communicate in labview using VISA read and write I keep getting a VISA read error (a timeout error) and the instrument cannot be controlled. I know there is some weird catch with having to different programs calling the same instrument, so I make sure every time to just labview open and not NI VISA Interactive Control. I also am very careful to match the baudrate, parity, last bit, and end mode for the read and write commands. I have attached images of the NI VISA Interactive Control Settings that were successful as well as my thus far unsuccessful labview vi. Please help me! Thank you in advance!

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

I am attempting to communicate with a Neslab Chiller. The instrument takes hexadecimal commands. In NI VISA Interactive Control I am able to communicate and get the correct responses back from the instrument. Unfortunately, when I attempt to communicate in labview using VISA read and write I keep getting a VISA read error (a timeout error) and the instrument cannot be controlled. I know there is some weird catch with having to different programs calling the same instrument, so I make sure every time to just labview open and not NI VISA Interactive Control. I also am very careful to match the baudrate, parity, last bit, and end mode for the read and write commands. I have attached images of the NI VISA Interactive Control Settings that were successful as well as my thus far unsuccessful labview vi. Please help me! Thank you in advance!

0 Kudos
Message 2 of 21
(3,862 Views)

The backslashes seem to be wrong.... depending on the setup, this could lead to escaping.

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

Double Post

 

EDIT: Moderator took care of this

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

What do you mean by escaping?

0 Kudos
Message 5 of 21
(3,842 Views)

Also, I read here http://digital.ni.com/public.nsf/allkb/19B075803E013125862575CF006B37F8

that this is the proper format for a hexadecimal command in VISA

ex. \CA\00\01\F0\02\00\FA\12

0 Kudos
Message 6 of 21
(3,831 Views)

I created a link with that word. If you want to know what that is, follow the link.

 

If no escaping takes place, the number of bytes (and used symbols) is not correct due to the backslashes. Please remove them and retry if it works.

 

EDIT: Ah, i see where you got that from. Remark that it clearly states "Earlier version of VISA" and additionally each backslash is followed by a small x (indicating \x as "the following two characters represent a single hexadecimal value of a single byte"). You do not have that small x's in there and i doubt that current VISA uses this terminology.

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

In your "Interactive control", I see you have the setting for send End termination on writes.  That is probably either a carriage return or line feed.

 

In your VI, you don't send any termination character.  Actually, you explicitly set ASRL End Out to None.

 

So your device is waiting for a termination character in the command you are sending it, and it never comes., so it never responds.  Thus your VISA Read is waiting on a response that is never sent from the device.

0 Kudos
Message 8 of 21
(3,828 Views)

If Ravens remark does not provide the solution, you have to modify the code additionally. Currently (with the backslashes), you are sending out a total of 26 bytes. But i think you want to send only 8 bytes.

The reason for this discrepancy is that you are defining a string with 26 characters instead of a hexadecimal number displayed as a hexadecimal string. Never checked if VISA Write makes an automated check if the string is build as hexadecimal string....

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

I went back to Visa Interactive to check the settings and have attached them here. When I change the end mode for writes to "none" then the termination character option is no longer an option. I attached the Visa communication from interactive if that helps.

 

When I match exactly these settings in labview vi I still get the following error on my read...

-1073807339 error

Also, when I use the light bulb to track progress it always say "OK" on Visa write.

Download All
0 Kudos
Message 10 of 21
(3,788 Views)