LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with VISA Read

Solved!
Go to solution

Hello, I am very new to LabVIEW and not really used to working with electronics so please bear with me. 

 

I found this VI online and am using it to verify whether I have successful connection with a temperature chamber (TestEquity Model 115A if that helps). I connected my PC with the temperature chamber through ethernet and I believe they are communicating by TCP/IP. I have successfully used PuTTY to send a simple command (*IDN?) and received the appropriate response. However, both using NI-VISA Visa Interactive Control and the posted VI yielded either one of 2 errors. 

 

The following error appears when I only have the return carriage control character:

 

Error -1073807298 occurred at VISA Read in visa.vi

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.

 

The following error is the other one that appears when I only have the newline control character:

 

Error -1073807298 occurred at VISA Read in visa.vi

VISA:  (Hex 0xBFFF003E) Could not perform operation because of I/O error. 

 

When I put neither \n nor \r I receive either of the above errors; sometimes it is the timeout and sometimes it is the I/O error. 

 

I am not sure why the script isn't running; I am expecting the front panel to show the result of *IDN? properly just as on PuTTY. 

 

I have tried changing the byte count in the VI Read to higher values such as 1000, turning off wifi to ensure that VISA is using the Ethernet path, and not sure what else to try.

 

Anything that might help at all would be greatly appreciated!

 

0 Kudos
Message 1 of 22
(6,356 Views)

The timeout error occurs even if you get data, if the number of bytes read is less than the number of bytes specified. Drop an indicator on the "return count" pin of the "VISA Read" vi, to see how much data you're actually getting. If it's what you expect, you can simply clear the timeout error.

0 Kudos
Message 2 of 22
(6,331 Views)

Hello,

 

I updated the VI file and added a "Number Indicator".

I ran the file and the bytes read read "0" on the front panel. Does this reveal anything in terms of why this error is occuring?

 

Thanks, Justin

0 Kudos
Message 3 of 22
(6,320 Views)

Can you select all code, do Edit > Create VI Snippet from Selection, and upload the PNG here? Your code is newer than my version of LV (2013).

 

Usually a return value of 0 means the port is configured incorrectly (more likely), or the instrument is not returning any data (less likely). Have you done a scope capture on the instrument's TX pin to see the serial waveform?

0 Kudos
Message 4 of 22
(6,311 Views)

Hello, I have attached snippet.

 

No I have not done what you suggested, and no idea where to begin with that. What do you mean by configure incorrectly? The manual that came with the test chamber said that Ethernet communication can only be done through port "5025" so I specified that in the PuTTY application for example and it worked, just not in the NI-VISA Interactive Program nor LV. Are there any simpler diagnostics I can run to further narrow down the problem?

 

 

0 Kudos
Message 5 of 22
(6,305 Views)

Is the IDN string constant in '\ code' mode? Right click it, and see if 'Normal Display' is checked, or '\ codes Display' is checked? If not, you need to put it in \ codes, and retype the \r to get the desired effect. Is this the command you sent successfully before?

0 Kudos
Message 6 of 22
(6,296 Views)

Yes the string constant is in '\ code' mode. I tried different combinations of \n and \r in that mode but still am getting errors. 

 

The command I sent successfully was indeed *IDN? but with no \n or \r as it was done in PuTTY.

0 Kudos
Message 7 of 22
(6,287 Views)

Can you show me the exact PuTTY settings you used successfully?

0 Kudos
Message 8 of 22
(6,280 Views)

Yes, I have attached both the settings and terminal screen.

Download All
0 Kudos
Message 9 of 22
(6,277 Views)

Have you tried with no termination character, eg just "*IDN?" Also, have you tried "\r\n"?

0 Kudos
Message 10 of 22
(6,263 Views)