07-03-2018 12:41 PM
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!
Solved! Go to Solution.
07-03-2018 01:13 PM
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.
07-03-2018 01:45 PM
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
07-03-2018 02:06 PM
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?
07-03-2018 02:20 PM
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?
07-03-2018 02:25 PM
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?
07-03-2018 02:32 PM
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.
07-03-2018 02:39 PM
Can you show me the exact PuTTY settings you used successfully?
07-03-2018 02:45 PM
Yes, I have attached both the settings and terminal screen.
07-03-2018 02:51 PM
Have you tried with no termination character, eg just "*IDN?" Also, have you tried "\r\n"?