NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

switch executive

Highlighted

Hi

 

I am using switch executive from with in Teststand to connect matrix & relay routes , for one test I need to control a relay of same switch virtual device from labview. I cannot open another session as already in use by switch executive in teststand. Whether there is any option available to achieve this?

 

thanks VKP

0 Kudos
Message 1 of 6
(2,097 Views)

None that I know of...

 

But to me it makes sense, the session is not allowed to be accessed from different locations

 

To me, requiring an action like this is an error in test setup / methodology

Programming languages don't create bad code, programmers create bad code....
0 Kudos
Message 2 of 6
(2,065 Views)

i haven tried it but i would like to think that you could get the switch executive session reference from teststand and then pass the Testand "context" to labview and get the reference to control a switch for sure.

 

 

 

CLAD, CTD
0 Kudos
Message 3 of 6
(2,033 Views)

Hi VKP-

 

NI Switch Executive (NISE) supports using two sessions to the same virtual device in a single Windows process (i.e. use the built-in TestStand Switching Step Properties and also using the LabVIEW Runtime Engine Adapter to execute a code module that calls the NISE API).

 

NISE does not support using two sessions to the same virtual switch device in two or more WIndows processes (i.e. using the built-in TestStand Switching Step Properties and also using the LabVIEW Development System Adapter to execute a code module that calls the NISE API).

 

If you attempt to use two sessions to the same virtual switch device in two or more Windows processes, the following behavior is expected:

 

  • NISE sessions in each process are independent of each other.
  • The first opened NISE session will function fine until you open the second NISE session. The second opened NISE session will reset the underlying switch session used by the first NISE session.
    • Although the first NISE session is valid, the underlying switch session may not be valid.
    • Operations using the first NISE session will error with invalid session error when using NI switches.
    • When using third party devices, the underlying switch session is reset and may be invalid or may work inconsistently depending on driver implementation.

A few options to workaround the above-mentioned behavior:

 

  1. Use TestStand expessions within your LabVIEW code module to force access to the physical device to occur only from the TestStand process: 
      1. Using the Sequence Context parameter within the code module, create a property object such as a string property.
      2. Call EvaluateEx on the property object with one or more of the following expressions:
        1. SwitchConnect
        2. SwitchConnectDisconnect
        3. SwitchDisconnect
        4. SwitchDisconnectAll
        5. SwitchFindRoute
  2. Release the reference to the virtual device in the process that first opened the NISE session before using it in the other process
    1. In the TestStand process, you can close the virtual device session created for a virtual device named “SwitchExecutiveExample“ using the following expression in each execution that uses the virtual device:

      RunState.Execution.AsPropertyObject.SetValInterface(“TSIviStepTypes_AnchorName_For_SwitchExecutiveExample”,0,Nothing)

       

      In the code module, use the NISE API in the code module language to close the virtual device session.

  3. Configure your station to execute LabVIEW code modules using the LabVIEW Runtime Engine Adapter

 

-Jeff

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

Hi VKP-

 

Another note that I forgot to mention, depending on the version/bitness of TestStand and NI Switch Executive you are using, this may be important: http://zone.ni.com/reference/en-XX/help/370052P-01/tsfundamentals/infotopics/64nise/

 

-Jeff

0 Kudos
Message 5 of 6
(2,023 Views)

Thanks Jeff

 

Can you please write example sequence for below steps. Do you have an idea whether "Switch connect channels" vi can also be used ? 

 

  1. Use TestStand expessions within your LabVIEW code module to force access to the physical device to occur only from the TestStand process: 
      1. Using the Sequence Context parameter within the code module, create a property object such as a string property.
      2. Call EvaluateEx on the property object with one or more of the following expressions:
        1. SwitchConnect
        2. SwitchConnectDisconnect
        3. SwitchDisconnect
        4. SwitchDisconnectAll
        5. SwitchFindRoute

VKP

0 Kudos
Message 6 of 6
(1,849 Views)