02-27-2017 08:31 AM
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!
Solved! Go to Solution.
02-27-2017 08:32 AM
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!
02-27-2017 08:41 AM
The backslashes seem to be wrong.... depending on the setup, this could lead to escaping.
02-27-2017 08:42 AM - edited 02-27-2017 08:42 AM
EDIT: Moderator took care of this
02-27-2017 08:43 AM
What do you mean by escaping?
02-27-2017 08:48 AM
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
02-27-2017 08:48 AM - edited 02-27-2017 08:50 AM
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.
02-27-2017 08:48 AM
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.
02-27-2017 09:01 AM
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....
02-27-2017 09:08 AM
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.