01-24-2022 01:36 AM
Hello
within teststand (2020) I am calling a python function. This function is running without a problem when calling several times directly from the python IDE. Now when I call the same function in a teststand sequence within a for loop, it works but on for the first loop. The second and following loops are failing with the error message:
<class 'IndexError'>
list index out of range
When I unload all modules after the first loop then all other loops are working without any problem. What could be the reason for it and/or is there a better solution?
Thanks in advance
Solved! Go to Solution.
01-24-2022 11:06 PM
Norick17,
I am unable to reproduce the issue. Please provide the sample files for which issue exists.
-Shashidhar
01-25-2022 02:47 AM
let me ask differently:
When you instantiate a python class you get an object reference inside the "Variables View". In my case I use a reference in the local variables:
When you click on the scissor you can release the object again. Is there a way to programmatically release the object reference with Teststand??
01-25-2022 03:01 AM
Using TestStand expressions (like in Statement step), update the object reference so that it does not hold any data. You can do it with an expression like:
Locals.SPI_Interface = Nothing
Executing that expression is equivalent of clicking the scissor icon next to the variable.
-Shashidhar