03-28-2024 10:45 AM
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?
Solved! Go to Solution.
04-02-2024 12:31 AM
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?
04-02-2024 03:14 AM
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].
04-02-2024 03:22 AM
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
04-02-2024 03:35 AM
Understood, thanks for the help