Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Get ivi instrument handle from NISE Session

In TestStand I begin my sequence with an niSE Open Session.vi and I then pass this NISE session reference around to other VI which use the niSE Connect and Disconnect VI's to connect/disconnect routes specified in MAX.  This works perfectly for me.  How do I convert this NISE session reference into an instrument handle for specific IVI devices in this NISE Session?  I want to be able to use the "ni Switch Get Relay Position.vi".  I tried using the "ni Get IVI device session.vi" but i get an error that says VI was stopped at IUseDCO.  What does this mean?  Is it possible to do what I'm asking?

 

Thanks

 

I'm using TestStand 3.5 and Labview 8.2

 

 

0 Kudos
Message 1 of 4
(6,875 Views)

Hi Jason,

 

"niSE Get IVI Device Session.vi" provides you with an IVI Switch session handle.  Using this handle as an input to the NI-Switch "Get Relay Position.vi" causes the IUseDCO error.

 

You can obtain the IVI Switch session handle using "Get IVI device session.vi", but it is not possible to call "Get Relay Position.vi" with this handle.  You could call into the IVI Switch class driver API (i.e. "IviSwtch Initialize.vi", "IviSwtch Connect Channels.vi", etc.), but I believe this invalidates your NI Switch Executive session, so I do not recommend it. 

 

Have you tried using "niSE Find Route.vi" to provide you with switch state (relay position) information?

 

Best regards,

 

Chad Erickson

Switch Product Support Engineer

NI - USA

0 Kudos
Message 2 of 4
(6,847 Views)

Hi Chad,

The problem with the find route.vi is it just tells me if the path is available or not.  It doesn’t tell me what state the relay is in.  When using SPDT relays this is a problem.

I’m using a 2570 card set for SPDT operation.  So if I do a find route after a reset on “Com->NO” and “Com->NC” both return path available.  I understand this because I have not made a connection call to either one.  If I make a call to connect “Com->NC” the relay changes states.   The connection then returns a path exists.  My problem comes when it comes time to disconnect.  Since it is a SPDT I have to first disconnect “Com->NC” then make a call to connect “Com->NO” (which is very annoying).  If someone just calls disconnect and I try to read the path availability both return path available again and the relay has changed state.  How do I know for sure which pole the common is connected to?

If I open Switch Soft Front Panel it shows exactly what position the relay is in.  How do I get this info to labview?  This is why I was trying to get the instrument handle to the underlying IVI session so that I can look at individual relays instead of paths between endpoints.

I hope this makes sense.  I know I can’t be the first one to have this problem, so if anyone has another solution I would appreciate any help.

Thanks    

0 Kudos
Message 3 of 4
(6,838 Views)

Hi Jason,


Thank you for the detailed explanation.  I think that I now understand what you are trying to do.

 

To obtain the relay state information, you require functionality above and beyond what's available with the underlying IVI session.  The Switch Soft Front Panel leverages the NI-DAQmx driver, and we can too.  "DAQmx Switch Get Relay Position (Single).vi" returns the current position of a single relay, and doesn't open a session to the instrument, so it can be used between Switch Executive calls.

 

The following is where the VI is stored on my machine:

C:\Program Files\National Instruments\LabVIEW 8.6\vi.lib\DAQmx\configure\hardwareSpecific\Switch.llb

 

Hope this helps!

 

Chad Erickson

Switch Product Support Engineer

NI - USA

0 Kudos
Message 4 of 4
(6,833 Views)