NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass any number of parameter in a sequence call

Solved!
Go to solution

Hi,

 

 

I have a sequence that aims to do the same job for one or several same elements typed. eg:

 

______________

subsequenceA : 

 

foreach element in (all elements array)

 //do the job

endfor

______________

 

 

now in my caller I would like to call subsequenceA in several ways :

 

subsequenceA(firstElement)

subsequenceA(firstElement, secondElement)

subsequenceA(firstElement, secondElement, .... , lastElement)

 

Is it possible ?

 

Another question : is it possible to do a call of subsequence in a pre-expression ?

 

0 Kudos
Message 1 of 5
(4,097 Views)
Solution
Accepted by niva

No, calling subsequences can only be done using the SequenceCall step. At least, it is not easy doing it another way (as it requires quite some knowledge of the TS API).

 

Why don't you pass the array "as is".... (array parameter)?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(4,094 Views)

Because sometime I have to pass two strings and other time five strings to my subsequence.

 

Any idea ?

0 Kudos
Message 3 of 5
(4,089 Views)

Yes, build an array of strings and pass them as string-array. Maybe you want to add a numeric parameter "array size", but that is optional as the subsequence can easily get that information from the array itself.

 

Norbert

 

PS: Don't mark an answer as solution as long as you have questions left on that topic.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(4,079 Views)

Taking Norberts Idea forward you can create a container.

parameter_container having array of strings and no of characters filled.

 

In your calling sequence you send fill no of arrays required.Fill the no of strings also.

 

In your called sequence loop the array for no of strings.

 

Hope this helps.

 

0 Kudos
Message 5 of 5
(4,077 Views)