NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

passing Sequence input parameter as array

I have defined a parameter for a subsequence, as an array of containers(Number & boolean).parameter definition2.png

 

When I call this subsequence in Main sequence, in the parameter table I do not see the options to enter value for the elements.

Sequence parameter input.png

 

There is only a field to enter the expression. I was expecting to enter values like this:value entry.png

 

Is it possible?

Arun
0 Kudos
Message 1 of 8
(7,208 Views)

No it is not.  But you can go give your input on this idea:

http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/Allow-Sequence-Adapter-to-expand-containers-in-th...

 

I WANT THIS!!!!!!!!

 

As a workaround we create the container as a local in the caller sequence and put the values in there.  The other option is to set parts of the container in a pre-expression if you are using other variables as the sub parts.

 

Cheers,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 8
(7,190 Views)

Sad to see that it still remains as an Idea..

Arun
0 Kudos
Message 3 of 8
(7,181 Views)

@~jiggawax~ wrote:

 

As a workaround we create the container as a local in the caller sequence and put the values in there.  The other option is to set parts of the container in a pre-expression if you are using other variables as the sub parts.

 


I created some containers as Locals in main sequence and was trying to specify these containers as elements for the array.

Local.PNG

 

But it does not accept array of containers. 

Parameter.PNG

 

I had created a custom data type for the Array element type and the locals also are of this same data type. 

Then why does it show data type mismatch?

Arun
0 Kudos
Message 4 of 8
(7,173 Views)

My statement was a more general statement regarding the situation with Clusters being able to be expandable in the parameter list.  You still need a Locals.Array which would be an array of your clusters.

 

Sorry for the confusion.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 8
(7,170 Views)

Please clarify one more thing:

 

In the variables pane, can I create the array locals with elements as Local.Cluster(which is another variable)? I tried this, but could not find a way to do this.

 

Otherwise , later if there is a modification in the cluster data, I will have to go to each array element and update.

Arun
0 Kudos
Message 6 of 8
(7,162 Views)

All elements in an array are the same.  Changing one will change the others.  It is the value that differes.

 

However, what you should be doing is using a defined datatype.

 

To create a data type open the type pallette (View>>Types).  Here is a document on type management: http://www.ni.com/white-paper/7060/en/

 

Generally I define the types in the sequence file within which I'm working unless the type will have a more global role.  So in the View Types For: pane you can scroll down to the Sequence Files section and select your sequence file. Then in the Custom Data Types section of the Types pane you can insert a container with two elements.

 

To create an instance of the data type go back to your sequence file and in the sequence you want in either Locals, Parameters Or FileGlobals you can now create an array of this type.  Right click in Locals and choose Insert Local>>Array Of>>Type>>Your New Type Should Be Listed.

 

Now whenever you want to insert a new field into the data type just go to the type pallette and update it.  All open instances will update with the correct fields.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 8
(7,144 Views)

Thanks for the helpful reply.

 

However, it was by using the Custom data type, I tried before. What I actually need is a better way to update the changes in the value.

I made a custom data type(cluster/container with 2 elements), and I created 3 locals of this custom data type(becuae there are going to be three different values).

Now I want to create an array(local) with elements as these locals. For example, I have to create an array of 10 elements, in which first five elements will be Local1, next three elements will be Local2 and remaining two elements will be Local3. 

In this way, all the elements in the array will be of same data type, but the values will be different.

 

Later, If there is a change in the value of Local1, all I would have to do is to update Local 1, so that the value of first five elements in the array would also be updated, instead of having to go to each element and updating its value.

 

Is it really possible?

Arun
0 Kudos
Message 8 of 8
(7,127 Views)