ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout error in VISA read

I have been trying to communicate with my new Instec mk2000 temperature controller through a simple self wrote LABView program ( i am beginner) but getting Timeout error in VISA read. 

I tried communicating in MAX. Write and Query work fine. But read shows error ( but works fine when called after write or query)

Here are some screenshots

ThanksBlockBlockMAXMAXFrontFrontIO MAX.JPGTimeoutTimeoutserial MAX.JPGwrite and read.JPG 

0 Kudos
Message 1 of 5
(1,874 Views)

Hi kharkhua,

 


@kharkhua wrote:

I tried communicating in MAX. Write and Query work fine. But read shows error ( but works fine when called after write or query)


Do you know the meaing of those "\n" chars in MAX?

Do you know the difference between default display mode of a string control/constant and the "\-code"-display mode?

Do you know you can set the display mode indicator visible for a string control in its options?

 

Please make that display mode indicator visible. Switch to \-code display. Then write "*IDN?\n" into the string control. Then run the VI: most probably your device is expecting the LF char (aka NL aka newline aka "\n") as a TermChar and will only answer after receiving it…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,853 Views)

To elaborate a bit on GerdW's reply:

 

The \n in the VISA test panel represents a "newline" character.  The VISA panel shows control characters as "backslash codes".  It isn't helpful that the only way to know this is by someone telling you!

 

So when you send the *IDN?\n in the VISA test panel, it is actually sending the text *IDN? followed by a newline character.

 

So what does this mean for you?  In your code, you can either: use a text constant with its default settings and type in *IDN? followed by a newline character - the Enter key will do this for you - or you can set the constant's display mode to \ and type in the command exactly as it was displayed in the VISA test panel.

 

One very good habit to develop is, if you are displaying a constant, control, or indicator in a non-default way, make sure to make the display mode (for strings) or the radix (for numerics) so that people who look at the code - including yourself at a later date - know what they are looking at.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(1,824 Views)

Thanks gred for the response. 

 

I know what '\n' means but i am not familiar with the things that you have mentioned in second and third questions.

 

Anyways I did change somethings ( not sure if correct ) but the error persists.

display code.JPG

 

Thank you

0 Kudos
Message 4 of 5
(1,802 Views)

You need to set the Write string control to \display mode.  Then fix the string that you are sending.

0 Kudos
Message 5 of 5
(1,795 Views)