Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa read error from Keithley 6221 using TCPIP

Hello all,

 

There is an error which bothers me for long. It will be very kind of you if anyone can advise about it.

 

I used Labview 2017 SP version.I tried to run a delta-pulse measurement using Keithley 6221 with Keithley 2182A through TCP/IP. I find very often errors are generated by the VISA_Read in the error query vi. Sometimes I get green Error 1073676293 (The specified termination character was read) and sometimes it shows red Error 85 (occurred at Scan From String (arg 1)). See picture error1.

 

To examine the effect of VISA_Read, I made a simple test program consisted of reset and read function. And I get another error -1073807339 (Timeout expired before operation completed). See picture error4.

 

I was very confused with the read vi. So I decide to use test panel of Ni_Max. I write the query command ?IDN?\n in the test panel. I find enabling "Suppress End on Read" option will cause read operation timeout error (see picture test3.1). This problem can be solved after I disable it or enable the "Termination character" with line feed \n (see picture test1.1).

 

I am not sure either if it is a problem of Keithley device or my code or the communication set-up. I have checked the device can receive the signal for DC mode which does not involve reading of buffer. The device cannot be detected automatically by Ni_Max so I added manually using TCPIP socket with 1394 port. The GPIB cable will block the RS232 port which is needed for 6221 to communicate with 2182A, so I did not use it.  

 

I spend many hours try to resolve it. It will be really helpful if someone can provide tips or hints to solve it.

 

Many thanks,

Thomas

 

 

 

 

 

0 Kudos
Message 1 of 2
(3,526 Views)

Hi Thomas,

 

I'm not quite sure I followed everything.  It seems like you're setup is connected fine, and you can generally communicate with the instruments.   Did you disable the termination character (\r or \n) in NI MAX and then get all the errors in Keithley Error VI or did it happen before?   

 

0) Make sure to re-enable the termination characters and close NI_MAX before running your VI.

 

1) Error2.png - Error 1073676293 is only a warning, and its safe to ignore.  This will always occur when using VISA + TCP/IP and reading strings with the termination character enabled.  The warning lets you know that the read was successful but perhaps there's still more data.

 

2)Error 85 is due to scan from string VI failing.  

 

85 Scan failed. The input string does not contain data in the expected format. The Scan From String function was unable to scan its input because the data was not in the expected format. Right-click the Scan From String function and select Edit Format String to configure the format string to match the input data. You also can receive this error if the Scan From File or Scan From String functions reach the end of the file. Refer to the KnowledgeBase at ni.com for more information about this use case.

 

I'd suggest that you enlarge the VISA read string to 2048 chars in the Keithley Error.VI, then look at what the string is before it goes into the Scan VI.  Its searching for a \r... when it doesn't find one I think that's the problem. (I think the string is likely blank due to timeout...but you should check what's read.) I'd write a bit of code to prevent the Scan From string from trying to operate on an empty string.  If that happens then just ignore the error and report that the VISA Read for SYST:ERR? failed.  Perhaps try to read the Keithley SYST:ERR again? 

 

I'd start with setting instrument to have a longer timeout, then just put the Keithley Error.VI in a while loop and read it every 2s for 100x.  Does it fail?  Why?  Now generate an error (try to set a parameter out of range) and see what changes.

 

Craig

0 Kudos
Message 2 of 2
(3,508 Views)