Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa error 1073807346

I?m new on LabView and create an application that uses a power meter, everything works fine during 127 tests but after this I get the following error message :
- Error ? 1073807346 Occurred at VISA Write in ?
- Error Query VI -> ???.

Posible reasons:
VISA: ( Hex 0xBFFF000E ) the given session object reference is invalid.
Why is that the system works fine during 127 iterations ?
Is there any buffer or something that maybe is getting overload ?
I hope somebody can help me.
0 Kudos
Message 1 of 20
(5,890 Views)
BCU:

The error means that somehow the session refnum is not open. This means 1 of 2 things:

1) Something closed the session without your knowledge. This is unlikely but not impossible if you don't know what each VI is doing. Perhaps you could watch the calls in NI Spy (if you are on Windows) to see when the session gets closed.
2) Are you opening and closing the session on each loop? If so, possibly there is an error when you try to re-open it on a given loop. If you want to avoid the extra open/close, LabVIEW can manage the session for you - just use the refnum and don't close it explicitly. LabVIEW will hold the session open and reuse it until you close LabVIEW. This is not the best programming technique but it may help to workaround your pr
oblem.

Hope this helps,
Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 2 of 20
(5,891 Views)
Thank you Dan,
Yes I'm opening and closing the session, I will try the solution that you mentioned, is it normal that when this error appears it's necessary to close and restart Labview ?
0 Kudos
Message 3 of 20
(5,890 Views)
"Is it normal ... to close and restart LabVIEW?" Well, the error isn't normal, and I really can't say I've seen it before. I know in earlier versions of NI-VISA (pre 2.5) and LabVIEW (pre 6.0) certain errors commonly required closing and restarting LabVIEW (like if you left the serial port open and forgot to close it). I don't know if you are using GPIB or Serial and what OS you are on, either. If it's Serial I would be more likely to blame the OS for acting unexpectedly weird.

Dan Mondrik
0 Kudos
Message 4 of 20
(5,890 Views)
I?ve doing some more test and I found out that if I stop the program before 127 tests and restart it ( without closing LabView ) my test counter keeps the information and I can run another 127 test without problem, I only need to stop it before 127 and then I can go indefinitely without problem.
I tried to implement the refnum procedure but I didn?t find out how to do it with VISA, the temporal solution that I?m implementing is with a counter on 125 test and then I?m using a dialog to inform that they need to click the run arrow and then use the stop function, I don?t like this at all, but I need to do some research to try to find out what is causing this problem, by the way I?m using GPIB and windows 98.
Do you know if there is some way
to stop and restart a program with labview ?


BCU
0 Kudos
Message 5 of 20
(5,890 Views)
Hello-

This is a very interesting issue. It would be very helpful to see an NI-Spy capture. A more meaningful file can be acquired by the "Spy>>Options...>>Log to File" option rather than the "File>>Save As..." method of storing the spy capture.

From first glance, it appears that the VISA open is placed inside of a loop structure. It's usually best to do only one VISA open and one VISA close for each resource during the life of the VI. Placing a VISA open in a loop causes different behaviour.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 6 of 20
(5,890 Views)
Hello,

The open VISA is not exactly in a loop, because it?s in a VI that opens twice on each test but when is open then the VISA session open only is called once and the loop is for the measure, because the meter is accessed X number of times but the VISA session is closed only after all the measures have been made I think this works as you mentioned, then is not really inside the loop, I couldn't send you the Spy capture file the system indicates an error, the file is about 1.2 Mb for one run, I only capture one because the systems run very slowly when the NI Spy is running then it will take a lot of time and a very large file to reach the 127 tests, I think the file is big because the meter it?s not the only instrument
that I?m accessing, I?m using a generator and a power supply during the same test.
Let me know if there is another way to send you the file.

BCU
0 Kudos
Message 7 of 20
(5,890 Views)
Hello-

That is a big capture size. Try putting it on ftp.ni.com/incoming.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 8 of 20
(5,890 Views)
Sorry,

I didn?t think about zip until I saw all the files at the ftp site, I?m sending you the zip file for the capture.

BCU
0 Kudos
Message 9 of 20
(5,890 Views)
Hello-

Try right-clicking on the VISA write VI and clicking "Do I/O Synchronously". A stopwatch on the VI should disappear.

It appears that the viEnableEvent function is called when it's unnecessary. This does cause a warning in NI-Spy and could eventually cause the given error.

Randy Solomonson
Applications Engineer
National Instruments
0 Kudos
Message 10 of 20
(5,890 Views)