LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB or GPIB LabVIEW Interface

I have a question about making an interface from a computer to some instrument using LabVIEW with a USB or GPIB connection. Before I run the program, I must select the instrument from the resource name control. I run the program a couple of times and if I'm going to select the instrument again, the instrument appears to repeats itself and it shows up an strange icon. Can anyone explain to me why does this happens? Thank you.
0 Kudos
Message 1 of 6
(3,256 Views)
That happens if you repeatedly call VISA Open without a VISA Close and if the duplicate session input of VISA Open set to True. the little icon is just showing you that there is an open session to the instrument. I'm not sure why you would need to set the duplicate sessions to true.
Message 2 of 6
(3,246 Views)
Hello Dennis, I hope you are doing well. I understood what you said about having an existing session opened with the instrument. The problem is that in my program, I need to have a while loop to measure multiple readings and average them inside the program. If I leave the initialize and close VI of the the meter inside of the while loop, the instrument with reset itself each time the while loops finishes its run. For that reason, I need to leave the initialize and close VI outside of the while loop. Because of this (I think) is that when I stop the program the session between the instrument and the LabVIEW is not closed and when I run it again it opens a new session. Is there a way to fix this? I included an example of my program in this message. If you are missing the functions of the instrument and you want to see them, it's an Agilent 34405A Digital Multimeter. Thank you.
0 Kudos
Message 3 of 6
(3,228 Views)
You're using the IVI driver I see. So, you select the resource name, run the VI, stop it normally, and then simply run it again? And after running it a few times, you see the multiple sessions? Your program looks fine and I can't explain why you would have all of those sessions created. You don't have an error indicator wired up. Add one and see if there might not be an error generated. If there's an error, it might the reason that the close is not working. Have you tried using the LabVIEW driver instead of the IVI one? Unless you want to use the class driver, I'm not convinced there is ever a good reason to use an instrument specific IVI driver instead of the native LabVIEW one.
0 Kudos
Message 4 of 6
(3,213 Views)
I found the problem with that program. If I stop the program pressing the abort execution button, the close function is not utilized and the session is left open. However, if I stop the program with the stop button of the while loop, then the close function is utilized and the session is not longer open. Maybe I'll just have to make sure that the user stops the program the correct way. Thanks again.
0 Kudos
Message 5 of 6
(3,207 Views)
The user should never have access to the abort button. You hide it by going to VI Properties>Window Appearance>Customize.
Message 6 of 6
(3,199 Views)