LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I prevent duplicate instrument handles from occurring?

How do I prevent this from happening?

 

T_Black_0-1700612585785.png

 

 

I am using a Pickering chassis and a few Chroma DC electronic loads that are contained in different chassis. The Chromas are on a GPIB bus and the Pickering chassis uses PXI. At the start of my test program, I initialize all of the equipment, which leads to some duplicate sessions, even when I first start Labview. 

 

This only seems to happen with the Chromas. I'm not sure if it is because they are using different standards, or if it has to do with the VIs that the company provided, which might not be checking for duplicate sessions when the instrument is first initialized. 

 

I've searched the forums and have learned about opening, closing, and duplicate sessions, but I'm not sure how I would go about checking for duplicates with Chroma's initilaize.vi.

 

Can someone point me in the right direction?

0 Kudos
Message 1 of 5
(611 Views)

How do I prevent this from happening?

 

GPIB Session.png

 

I am using a Pickering chassis and a few Chroma DC electronic loads that are contained in different chassis. The Chromas are on a GPIB bus and the Pickering chassis uses PXI. At the start of my test program, I initialize all of the equipment, which leads to some duplicate sessions, even when I first start Labview. 

 

This only seems to happen with the Chromas. I'm not sure if it is because they are using different standards, or if it has to do with the VIs that the company provided, which might not be checking for duplicate sessions when the instrument is first initialized. 

 

I've searched the forums and have learned about opening, closing, and duplicate sessions, but I'm not sure how I would go about checking for duplicates with Chroma's initilaize.vi.

 

Can someone point me in the right direction?

0 Kudos
Message 2 of 5
(651 Views)

You have to close the session explicitly once you're done with the work and reuse existing handle and don't create a new handle everytime.

 

This is like leaving the door open when you enter the room, you must close it as well at the end.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 3 of 5
(610 Views)

@santo_13 wrote:

This is like leaving the door open when you enter the room, you must close it as well at the end.


I would equate it more like logging into your bank account on a public computer and then just walking away.  I'll let your imagination go from there.

 

Yes, you need to make sure the references are closed.  Another issue I have ran into is losing the reference for various reasons.  The one that bit me the hardest was a zero iteration FOR loop (use Shift Registers for references to avoid this issue).  The other common way I've seen references lost is with tunnels set to "Use Default If Unwired" on a Case Structure or Event Structure and then a case is left unwired.  Only use that setting in extremely rare cases.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(563 Views)

For anyone that comes across this in the future, I did a little more searching on this and found a different post below that describes the same problem.

 

https://forums.ni.com/t5/Digital-Multimeters-DMMs-and/What-is-the-proper-way-to-close-all-open-sessi...

 

The Chromas seem to work differently than my other devices in that every time I use them it seems to create a new IVI session. I fixed the issue by wiring the IVI Delete Session to the instrument VIs so that it closes every time.

0 Kudos
Message 5 of 5
(546 Views)