Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

viRead vs. VISA Read

Solved!
Go to solution

Hello! So, I am writing a VI to read temperature from a pyrometer (Fluke E. Series) connected to my PC via an ethernet cable and the NI VISA software. When running the vi I receive the error code "-1073807339" during the read process. However, this timeout does not occur when using the VISA test panel, instead returning the correct reading. The difference can be seen using the IO trace application (see images attached) where the Test Panel calls the "viRead" command whereas my VI calls the "Visa Read" command resulting in a timeout error. How do I fix this error? Can I call viRead directly in my VI? Are there certain parameters or property nodes I can use to make it such that Visa Read does not timeout and actually receives the data from the pyrometer? Thanks!

0 Kudos
Message 1 of 7
(334 Views)

You did not attach any images.

0 Kudos
Message 2 of 7
(333 Views)

Ah, sorry. They should be attached on this reply if I did everything correctly.

0 Kudos
Message 3 of 7
(295 Views)

For many Ethernet devices, you need to make sure to enable the Send End Enable via a Property Node.  The VISA Test Panel will have this on by default.


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
0 Kudos
Message 4 of 7
(268 Views)

I enabled this property node, but I still receive the same error.

Download All
0 Kudos
Message 5 of 7
(258 Views)
Solution
Accepted by pds3

From the log it would appear that you are not sending "?T<CR><LF>" but literally "?T\r\n"!

Why you ask?

 

In some of the logs it shows that the VISA Write("?T\r") has a return value of 4 indicating that the write was for 4 bytes. Yet if \r was a properly escaped <carriage return> it would be only one byte and the whole string would be only 3 byte.

Same about another VISA Write("?T\r\n") that has a return value of 6 indicating that there were actually 6 bytes written instead of the 4 that would have been sent if the string was properly in \-escape mode.

 

Solution is trivial: Go to the string constant, right click on it and select '\'-Codes Display. Correct the string to only have one backslash each instead of the double backslashes you will see now. And to help yourself see right away if the string constant is actually in the right Display mode, right click it again and select  Visible Items->Display Style. This will enable a glyph on the left side of the string box that shows if the Display mode is in n - Normal, \ - Backslash, x - Hex, or p - Password mode.

Rolf Kalbermatter
My Blog
Message 6 of 7
(208 Views)

This fixed it. Thank you so much!

0 Kudos
Message 7 of 7
(181 Views)