NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Is there a way to pass or access the FileGlobals of the main sequence from an ActiveX subsequence that runs in parallel?

I developed an elborate avionics Test Bench using the data types and FileGlobals to define all of my instruments and signals. The instruments have some minor changes between Test Bench's and the signals change between projects. The actual LabVIEW VI's were written so that they would be generic, in nature, and rely on spreadsheets to determine what inputs and expected outputs are to be tested and use the FileGlobals to determine how to process each signal from this extensive data structure. This methodology has worked well so far. Now I have the need to read some of the signals being output by the black box and compute a signal as input. The black box it very particular about the timing related to how fast this input changes in response to the outputs.

Anyway, I was able to develop another sub-sequence within the main sequence and have it run as a parallel process. The problem that I have is that this extensive FileGlobals data structure is shown in the sub-sequence, but all of the data is zero or blank. What I really need is the FileGlobal data in the sub-sequence to be equal to the FileGlobals data of the main sequence at the time the ActiveX sequence is started OR have some way to access the main sequence FileGlobals from the ActiveX sub-sequence. I was able to use the when doing a Action of "call method" and a moethod of "NewExecution" to start the sub-sequence. The problem is that the data passed was only the first element in the FilGlobals structure and not the entire FileGlobals.

I have TestStand version 1.0.3 . I know, the answer is usually to upgrade, but I have my own company and am sub-contracting at this company. It took me a month to convince this company that TestStand was the way to go rather than use the old LabVIEW Test Executive that they still have. The point is that it may be difficult to get them to get a later version and at this point I do not have time to wait for a upgrade. So I need to determine an easy way to impliment this with the existing version of TestStand.

Any pointers on how you might solve this problem would be appreciated. You can email me directly at .

Thank you for your help!
0 Kudos
Message 1 of 3

As you alluded, TestStand 2.0 has better solutions to this problem than TestStand 1.0.x. These include

1) Executing the subsequence on a different thread but under the same execution. The file globals are then common to the calling and called sequence. The improved Sequence Call step type gives you this option.

2) There is a new sequence file property that provides that "All Executions Share the Same File Globals".

The reason that the file globals are not shared between your 2 sequences is that they are each executed as separate executions. That is, they are each executed using the NewExecution method. With each new execution a run-time copy of the sequence is made, including the file globals.

I am assuming that you want to execute the subsequence asynchronously (i.e. in parallel) to the MainSequence and therefore must use the NewExecution method to do so. Since you must use TestStand 1.0.3 then the best option is to pass the file globals to the new execution as sequence parameters. It sounds like you tried this but had difficulties. The steps to do this are:

A) Create parameters in your called sequence that mirror the file globals that you want to pass from your MainSequence.
B) Create a new data type that is a container. The subproperties of this container must mirror the parameters in your called sequence. It is important that they are in the same order as the parameters.
C) Create an instance of this container data type as variable.
D) Pass this variable as the parameter of the NewExecution method.

I have attached an example of how to do this. I have 2 file globals that I want passed, Number and String. I have another file global that is an instance of the parameter container that I pass with the NewExecution method (could also have made as local variable). Any time I update the values of the container�s subproperty, the changes are available in the executing "subsequence". Therefore, I must update the value of these container subproperties every time I want to have access to new file global values. There is clearly some redundancy here in that my MainSequence must copy the Number and String values to the container subproperties. If fact, it may be better to simply delete the Number and String file globals and simply use the subproperties of the container directly.

You probably have to play around with the example to synchronize the change of the file globals with the message popups in the subsequence. In TS 2.0 I would have synchronized them with the new synchronization step types.
Message 2 of 3

A quick an easier solution would be to look at the fileglobals that both sequences need to use and place these in the StationGlobals. That way all sequences loaded will be able to use. You could create them dynamically and then destory them when when all sequences are completed or unloaded. All you need to worry about is synchronization.

An other example of passing parameters to an NewExecution can be found here

"Logging Data to a Database on a Seperate Thread".

Ray Farmer.
Ray Farmer
0 Kudos
Message 3 of 3