NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to open close and pass instrument handles from labview in teststand parallel model?

Solved!
Go to solution

I have a number of test systems that use a parallel model with labview. We have a good number of instruments(PXI).

What is the prefered method for open,closing and passing instrument handles in teststand using labview? 

0 Kudos
Message 1 of 13
(5,644 Views)
Solution
Accepted by jchurlik4

Hi,

 

A few ways

 

1 Pass back the session handle as a U32, there are some TestStand VI's i the TestStand palette that you can use to do the conversation.

2 Pass back into a LabVIEWIOControl. TestStand handles these.

 

3 Do something fance such as using LVGOOP and leave the handle as an object property and leave it in memory. eg dont pass it back at all.

 

One thing you will have to watch out for  is multiple executions trying to talk to the same instrument, so you have to use some lock/unlock or synchronisation to avoid thi happening.

 

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 13
(5,642 Views)
is there somewhere method 3. is expailned better?
0 Kudos
Message 3 of 13
(5,641 Views)

Hi,

 

 

I will try to put something together over the weekend to explain this . It maybe just a document or it could be a simple example.

 

Regards

Ray Farmer

Regards
Ray Farmer
Message 4 of 13
(5,628 Views)

I'm always trying to find the best answer to this.

 

First, Why pass instrument handles at all? Why not Open, do operations, Close within each step? If the answer is speed then skip to the next question. But I have benchmarked VISA, for example, and there is no time penalty for doing this. On the other hand the PXI RF instruments and some Agilent PXI instruments I have used take 1 - 6 seconds per Open, ouch.

 

Isn't method three similar to the NI Session Manager? Is there any reason to not use Session Manager for this?

 

When you use methods 1 and 2, you want to open the handles in the Process model befor the parallel threads are created and then pass a copy down to each thread, right?

 

cc

 

 

Message 5 of 13
(5,624 Views)

Hi dowNow,

 

I had forgot about the SessionManager, so that's another way. Although, you dont have to return the instrument handle but you do need to keep the Session Manager handle back in TestStand to keep it in memory.

 

Maybe the action of method 3 is similar to Session Manager.

Using LVGOOP, when the object is first created you would perform the initialize and the object would store the instrument session handle. When the object is destoryed, the close would be performed. 

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 13
(5,610 Views)
SessionManager method is only good for IVI class instruments is that a true statement?
0 Kudos
Message 7 of 13
(5,598 Views)

Hi Ray,

 

Would you please give me a link to an explanation to LVGOOP ?

I have never heared about it before.

 

Thanks

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 8 of 13
(5,592 Views)

Hi,

 

No, Below is a bit from the Session Manager Help

 

Currently, Session Manager supports the following instrument session types:

  • IVI Sessions—Use an IVI session to obtain the C-based instance handle for an IVI logical or virtual instrument name. NI Session Manager does not support IVI-COM drivers at this time. When IVI-COM drivers are available, you can use an IVI session to obtain an ActiveX interface reference to an IVI-COM driver.
  • VXIplug&play Sessions—Use a VXIplug&play session to obtain a C-based instance handle for a VXIplug&play logical or virtual instrument name. Configure VXIplug&play names in the <VXIplug&play directory>\<Platform directory>\NISessionMgr.ini file.
  • VISA Sessions—Use a VISA instrument session to obtain a C-based viSession handle to a VISA resource or logical name. Configure VISA logical names in the <VXIplug&play directory>\<Platform directory>\NISessionMgr.ini file.
  • Custom Sessions—Use a custom session to create a data container object that shares ActiveX objects you create or other data between software components you write. Use the Attach and Get methods to attach data to and retrieve data from a session. A custom session does not initialize, close, or own an instrument handle. The data you share with a custom session does not have to be instrumentation related. You can create a custom session with any name you request.

 

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 9 of 13
(5,591 Views)

Juergen,

 

Sorry, I am getting my OOPs mixed up.

 

There's GOOP which is a toolkit by ENDEVO, try here for a trial download

http://www.flander.com/English/Endevo/Products/GoopDevSuite/tabid/8080/language/en-US/Default.aspx

 

and now LabVIEW comes with it's own OOP called LVOOP. do a search on the NI website for LVOOP

 

Hope this helps

 

Regards

Ray

Regards
Ray Farmer
Message 10 of 13
(5,587 Views)