LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing Visa errors

What is the best way to handle a VISA timeout error, LabVIEW 7.1?
I am controlling (GPIB) several devices, one of which is a Delta 9010 environmental chamber. I get error -1073807339, VISA:(Hex 0xBFF015) TImeout expired before operation completed. I have tried a VISA CLR and It goes away then comes back at the next VISA WRITE.
 
I am not very familiar with GPIB commands. The manual for this device has a list commands to control it, but I can not find commands that would clear or reset it???
 
Any help would be greatly appreciated!
 
Jim 
0 Kudos
Message 1 of 13
(4,625 Views)
You typically get a timeout error when you issue a query to an instrument  and the instrument has no data in it's buffer to read. Do you first get the error on a VISA Read. If you do, verify that the VISA Write you issue is exepected to return data. A command that will return data will often be terminated with a question mark. For example, if you want to set the temperature, you might do a TEMP:20.4 write command and to get the current temperature, you will write TEMP? and then do a read. If you have an electronic copy of the programming manual or a link to it, you could post that and also the code you've written to help to eliminate the error. You really need to prevent the error and not clear it.
Message 2 of 13
(4,606 Views)

Dennis,

I am trying to get more info from the manufaturer. I have a hard copy of the manual. It contains a list of commands the are relative to temperature control but nothing like a reset, clear, error or status query.

You mentioned preventing it rather than clearing it. How would you suggest I do it? I have attached a copy of the vi.

Thanks,

Jim

0 Kudos
Message 3 of 13
(4,599 Views)
You prevent it by making sure that the query you are sending is valid and you are reading it correctly. There's a lot of possibilites. What happens when you issue the "Status?" command in MAX? Do you get a response there or the same timeout? You've got a small delay in the first while loop before doing a read. You don't have that in the second loop and you might need it. You are doing a clear in the first loop and then going into the second loop. Maybe the chamber is not ready yet. Doing a Clear is usually not necessary anyway. You are requesting 5000 bytes back from the instrument. That seems like an awful lot but a VISA Read will terminate when either EOI is detected, the number of bytes are read, or the VISA timeout setting has been reached. If the instrument does not send EOI at the end of a data transfer, you'll get a timeout if you request 5000 bytes and a smaller number is available. If the chamber is sending 5000 bytes of data back, it make take longer than the default timeout value to prepare that much data and put it in the buffer. You can increase the timeout value with a VISA property node. A timeout error is usually preventable. You should also go into MAX (Measurement & Automation Explorer) and turn on NI-Spy while you run your program. Viewing the result could give an idea of what's going on.
Message 4 of 13
(4,597 Views)
Dennis,
My application takes 16 hours to go through one cycle, the temperature is change 10 times and then status is watched during the soak period.
This error is intermittent. I have been running it for a couple of months and I have run into this problem 3 times. In the past I have cycled the power and the problem goes away (for a while!).
I haven't cycled the power yet and have tried many different things (clr,close/open visa session, send IFC) to try to get through to it and nothing works. A VISA clr will remove the error then the next write generates a new one. I have spoke with NI tech support with no luck. DeltaDesign tells me the guy who designed the controller is long since retired and no one knows much!
Could asking for 5000 bytes form the previous read have caused the problem and now I just can't clear it? What should I ask for? If I use Spy to watch a successful read can I measure it some how or does it report the size?  
 
Jim
0 Kudos
Message 5 of 13
(4,585 Views)

More info:

The manufacturer asked if I was giving the command too fast? They had no idea what too fast was but remembered hearing that that was a common problem!

My application is not very fast so slowing down the communication would not bother me.

 

I wonder if a good tutorial or something is available on this. You mentioned avoiding the error rather than handling it, sounds like good advise.

 

Jim

 

0 Kudos
Message 6 of 13
(4,583 Views)
The information that the problem is intermittent is important. The first I would try is slowing down the loop that does the query like the manufacturer says. Also, when you do a VISA Read, the return count output will tell you exactly how many bytes were read. If you are actually reading the same number of bytes as you are requesting, then I'd be a little suspicious. If they are equal, then you might try bumping the expected bytes upward. If the instrument has an ERR? query, you might also try doing that. If for any reason, the instrument is generating an error, it might hang when it's error buffer is full.
Message 7 of 13
(4,579 Views)

I was able to get some relief by putting a 50 ms timer with each visa read or write and setting the read byte count to the proper size (5) for the status query. I am still having problems with some of the other devices! I got a Fatal Exception Buss Error from the pressure controller. I will contact the manufacturer and see if they can tell me why. 

I am using an Agilent GPIB card. Could any of these problem  have to do with the card? 

0 Kudos
Message 8 of 13
(4,559 Views)

Hello, this is a question for you...two years later.  I am having the same problem and am wondering if you found a solution that worked over the long run?  Did the errors come back ever (for the same reason)? 

Thanks

0 Kudos
Message 9 of 13
(4,255 Views)
Are you having a problem with the same chamber as mentioned in the original post? Or are you getting VISA errors with another instrument. If it's another instrument, could you provide the make and model, as well as the actual error codes you get?
0 Kudos
Message 10 of 13
(4,248 Views)