NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Test stand string array call in message with dynamic upper bound help

Solved!
Go to solution

Hello,

 

So I have a python scrip that returns a tuple list that changes from time to time. Sometimes there is nothing in it sometimes there is up to 5 strings inside. I got container set up correct in teststand I see it populated with my strings.

 

Now in python I can do MyTupleList[0:] to get the full list, however when I try to do similar in teststand I get errors.

 

What I am trying to do is have a message popup with text: "The list contains: " + Locas.MyTupleList[0:]

 

It should then give user the message as The list contains: dog, cat  and so on

 

I am clearly missing some sort of correct syntax to do MyTupleList[0 to end], is anyone familiar with this?

0 Kudos
Message 1 of 5
(151 Views)

I am not really familiar with Python, though:

 

do I understand correctly, that you het the correct Tupel / List / whatever in a TestStand data object? 

So the question comes down to: how can I display all array elements (number of elements dynamic) in a string / message box?

0 Kudos
Message 2 of 5
(95 Views)

That is correct. I can list elements of this list by writing in message expression field: "The list contains: " + Locas.MyTupleList[0] + Locas.MyTupleList[1] +  Locas.MyTupleList[2] + Locas.MyTupleList[3] + and so on"

 

What I am trying to do is just write the message so it would dynamically adjust the upper limit  like Locas.MyTupleList[0 to end].

0 Kudos
Message 3 of 5
(85 Views)
Solution
Accepted by topic author ldznis

Don't think, this is possible using an expression in TestStand, since there are no loops available (to my knowledge)

 

I recommend (though it seems awkward to a programmer) to assemble the message string using some steps (for loop / for each loop for example) and some statement steps.

Or have your Python module returning the appropriate string.

 

After all, TestStand is a TestManagement software, not exactly a programming environment

 

Message 4 of 5
(82 Views)

Understood, thanks for the help

0 Kudos
Message 5 of 5
(77 Views)