LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA timeout error -1073807339 with Keithley 6221 and SR 860

Hey there! I am new to Labview and I am having trouble with a timeout error/error -1073807339. I’m trying to operate a Keithley 6221 ac/dc current source and an SR 860 lock-in amplifier (separately for now), and since there is no premade driver for the lock-in, I need to operate them through NI VISA. As of right now all I’m trying to do is make sure everything is communicating correctly between the instruments and the PC. They are connected via ethernet cables, and seem to be functioning correctly in NI MAX. I’ve made the following VI, which gives a timeout error if anything is written into the “write buffer.”

However, no error occurs when no value is given. I am not sure why this is, or how to make it work in both cases. Thanks in advance for your help!

Download All
0 Kudos
Message 1 of 11
(2,820 Views)

Two questions:

1.  Are you sending a termination character with the command you are writing?  Without a termination character, the device probably doesn't know you finished your message and isn't returning a response.

 

2.  Why do you have the number of bytes written wired to the number of bytes to read?  Do you expect the length of the message going out will exactly match the length of the response?  That is highly unlikely.  You should read back a number of bytes that is larger than the longest message you expect to receive, assuming your device sends responses with a termination character and you've configure your serial port to enable the termination character.  In your code, I can't tell if you have because you didn't use the Serial Configure subVI.

0 Kudos
Message 2 of 11
(2,796 Views)

I am not sending a termination character with the command STAT:QUE:NEXT?. I tried adding in the Serial Configure SubVI (wasn't sure if it should be on the right or the left of the VISA open subVI so tried both) and adding the termination <LR>. The command now reads

"STAT:QUE:NEXT? <LR>"

and the error message now occurs at the Serial Configure SubVI.  

As far as the number of bytes written wired to the number of bytes to read goes, I'm not sure if I understand what the purpose of each is. I changed the number of bytes to read to 100, which I assume will be larger than the number I need to read for now. Is this what you meant? Thanks for your help!

0 Kudos
Message 3 of 11
(2,776 Views)

You don't need the VISA Open.  The new error -1073807331 is an invalid value for a property node.  There is just enough shown on your screenshot that says it is argument 2 which is the baud rate setting you can see when looking into the serial Configure.  Since you don't have a baud rate set up, it uses the default value for that subVI which is 9600.  That is such a common baud rate, I'd be surprised if your  serial port couldn't accept it.  I think something else must be wrong with the installation of your serial port drivers.

 

What does "<LR>" mean at the end of the command?  That isn't a termination character, but a series of additional characters.  Where did <LR> come from?

0 Kudos
Message 4 of 11
(2,766 Views)

The <LR> should be <LF> sorry. It should be a valid termination for the Keithley 6221. And yes, my serial port should be able to accept that baud rate. For my own information, why should setting the baud rate matter for the ethernet connection? I may try redownloading at least NI Serial. 

0 Kudos
Message 5 of 11
(2,763 Views)

But you don't enter a literal "<LF>" into your string!

 

Change the display mode of the string to \code mode.  Then enter \n which is the \code for "new line" a.k.a line feed character.

 

As for the baud rate, you wouldn't use that at all for an Ethernet connection.  By adding a Serial configure subVI, I thought you were trying to use a serial port.  Since it is Ethernet, get rid of the Serial Configure and leave a regular VISA Open.

0 Kudos
Message 6 of 11
(2,760 Views)

I changed the display mode and the code is now "*IDN?\n" but I still have the timeout error. However, for the first time it is sending back some response. I've attached a picture of the response I got. I'm not sure why the return count would be 57, but its an improvement from 0. 

0 Kudos
Message 7 of 11
(2,757 Views)

You should show enlarge the string indicator so we can see the entire message.  Perhaps put it in \code mode so  we can see any of the non-printable characters.  The return count is 57 bytes because that is how many characters there are in the message.  Seeing the entire string will help figure out if that makes sense.

0 Kudos
Message 8 of 11
(2,744 Views)

image.png

0 Kudos
Message 9 of 11
(2,739 Views)

That looks good other than the timeout error.  I wonder if that port is not set up to use the linefeed character for the termination character.  I don't know if ethernet ports behave differently, but the vast majority of my experience is with serial ports.

0 Kudos
Message 10 of 11
(2,733 Views)