NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching Lifetime in TestStand

I have few questions about the "Connection Lifetime" selection via the Switching Properties of a given step.
 
Within a subsequence called Test 1,  I performed the following general test
 
Setup - Test1
Connected Output to the Scope using switch executive route and set the "Connection Lifetime" to "Sequence"
 
Main - Test 1
Performed the test and obtained the measurement
 
Cleanup - Test 1
NO Disconnect of the route added!  I assumed since I selected "Sequence" lifetime of the route connected in setup that it would be disconnected after this subsequence completed.
 
Unfortunately, my thinking was incorrect.   The switch route did NOT disconnect within the cleanup hence in additional sequences it caused the matrix to subsequently leave rows connected to columns causing hardware damage.
 
Should the "Sequence" lifetime be actually called "Sequence File" lifetime?
 
Paul Holzrichter
 
 
0 Kudos
Message 1 of 8
(3,864 Views)
Paul -
The sequence lifetime setting is for when the sequence completes and it is not associated with the file, the file does not have a lifetime feature.
 
I suspect that the disconnect command is being executed but the switch might not be completing the operation. Does the operation occur if you manually disconnect the route? Have you tried to see if using a step lifetime works? If the step lifetime does not work, you might want to try to connect a different route after a step with a step lifetime to see if the switch completes then completes the operation.
 
Also to help debug this, I would suggest launching NI-Spy from the National Intruments program group, select Spy>>Options and enable Switch Executive and IviSwitch on the View Selection tab, Select Spy>>Start Capture, and then perform your test of the switching operation by single stepping through the sequence and see if the disconnect is called when you exit the cleanup group by looking at the trace. I assume that you will remove any hardware that could be affected while you debug this.
 
Also, I am curious as to what version of TestStand and Switch Executive you are using, the switch driver name and version, and the hardware model that you are using.
Scott Richardson
0 Kudos
Message 2 of 8
(3,847 Views)
Scott
 
Thank you for the information.  Here is what I found:
 
Setting the connection lifetime of the route to "Manual" works as expected.  I had to add another step within the cleanup to manually disconnect the route, I suppose this is an acceptable workaround.
 
I took your advice using NI-SPY with the connection lifetime to "Sequence".  The initialization and connect work as expected.
 
Initialization: 42.  niSE_OpenSession ("264273_A400m_LVPS", NULL, 264273_A400m_LVPS)
Process ID: 0x000004E8         Thread ID: 0x00000F5C
Start Time: 10:04:10.667       Call Duration 00:00:01.000
Status: 0 (VI_SUCCESS)
43.  niSE_Connect (264273_A400m_LVPS, "Scope_Measure_+3_3V", -1, VI_TRUE)
Process ID: 0x000004E8         Thread ID: 0x00000C1C
Start Time: 10:04:11.667       Call Duration 00:00:00.016
Status: 0 (VI_SUCCESS)
When I finished Cleanup, there was not an associated Disconnect step in NI-SPY!!!!
 
TestStand 3.5 and Switch Executive 2.10.49161.
Switch instrument driver version 3.30.49153
The virtual device is a combination of a NI PXI-2593 & NI PXI-2586 & NI PXI-2532.
 
The above route is a connection through the NI PXI-2532 & NI PXI-2593.
 
Paul Holzrichter
 
0 Kudos
Message 3 of 8
(3,824 Views)

Paul -
I tried TS 3.5 and NISE 2.1 using the SwitchExecutiveExample vitual device and it worked fine on my end. For your test, if you leave NISpy open while the execution completes and you close the execution window, do you get a niSE_CloseSession message?  Also, can you run the attached sequence and show me your output, it also uses the SwitchExecutiveExample vitual device.

Scott Richardson
0 Kudos
Message 4 of 8
(3,816 Views)
I found some interesting issues.  I modified the file you sent me to include a property loader step.  The following output is CORRECT only if the Property Loader ( called Load Setup Data) step is skipped:
 
1.  niSE_OpenSession ("SwitchExecutiveExample", NULL, SwitchExecutiveExample)
Process ID: 0x000009D0         Thread ID: 0x0000071C
Start Time: 14:35:48.203       Call Duration 00:00:00.906
Status: 0 (VI_SUCCESS)

2.  niSE_Connect (SwitchExecutiveExample, "DIO_1ToUUT_IO_1", -1, VI_TRUE)
Process ID: 0x000009D0         Thread ID: 0x000007A8
Start Time: 14:35:49.140       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
3.  niSE_Disconnect (SwitchExecutiveExample, "DIO_1ToUUT_IO_1")
Process ID: 0x000009D0         Thread ID: 0x000007A8
Start Time: 14:35:49.187       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
 
4.  niSE_CloseSession (SwitchExecutiveExample)
Process ID: 0x000009D0         Thread ID: 0x00000C10
Start Time: 14:36:02.312       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

Now, having the property loader step RUNNING gives the following incorrect output.  Apparently now the switch is NOT being disconnected or properly closed.
 
1.  niSE_OpenSession ("SwitchExecutiveExample", NULL, SwitchExecutiveExample)
Process ID: 0x000009D0         Thread ID: 0x0000071C
Start Time: 14:39:32.968       Call Duration 00:00:00.235
Status: 0 (VI_SUCCESS)

2.  niSE_Connect (SwitchExecutiveExample, "DIO_1ToUUT_IO_1", -1, VI_TRUE)
Process ID: 0x000009D0         Thread ID: 0x000007A8
Start Time: 14:39:33.203       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
3 & 4 - Disconnect and CLOSE are missing???
Note: To run make sure the Parameters.TestConfigurationFilePath points to the attached 261674-1.INI file.
Download All
0 Kudos
Message 5 of 8
(3,805 Views)

Hi,

The ini file you have attached dont appear to match the properties being loaded in the sequence file?

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 8
(3,790 Views)
Yes, the parameter file was taken from another test program.   The sequence that Scott sent me works ok without the property loader step hence I simply found a simple INI file to use as a property loader example.  Not all the limits are needed for this "test" sequence.
 
The main purpose of the test program was to make the point that the switching does not properly disconnect with a property loader step in the same sequence.
 
Paul H
0 Kudos
Message 7 of 8
(3,782 Views)

Paul -
It appears that the Property Loader step is failing to release a reference on the Locals container. The reason that this causes the problem is that the sequence lifetime feature attaches a special reference property to the Locals container to implement the auto-disconnect. When the sequence completes executing, the engine releases its reference to Locals, and if it is the last reference, Locals is deleted, which includes the sequence lifetime reference property. When this reference property is deleted, TestStand disconnects the route. Since the Property Loader, or anything else, fails to release a reference on Locals, the disconnect never occurs. In addition, when you shutdown TestStand and the Object Leak feature under the Station Options is enabled, TestStand reports that a Locals container was not released.

The Property Loader step type has two modes that it supports:

  1. Place the step type in the sequence you are running and the step loads limits into the run-time copy of that sequence only.
  2. Place the step in any sequence and specify to load limits into other sequences. Each time you call the other sequence the limits that you loaded are used. This allows you to load limits once and call the sequence multiple times. 

Now, if you use this second mode and the sequence you are targeting is the sequence that contains the Property Loader step, the step must loads limits into the current run-time copy that is running AND into future calls into the sequence. The leak appears to occur when you do this, and this is what the sequence is doing that you gave me.

So the immediate workaround is to either load limits into the run-time sequence only, or load limits into other sequence, but move the Property Loader step outside of a sequence that you are loading limits to.

I will continue to find the leak and I am going to suggest a design change to not rely on Locals being released for the sequence lifetime.

Scott Richardson
Message 8 of 8
(3,758 Views)