08-21-2025 11:06 AM
I'm calling TestStand 2014 sequences from Python using TestStand.Engine NewExecution() and WaitForEndEx(-1). This is working well until I try to interface with the CAN hardware. When the CAN initialization sequence is called from Python it runs a LabView CAN VI that performs the hardware initialization. Subsequently, when Python calls the enable CAN receiver sequence from Python it gives an error "Error -1074384740 occurred at XNET Start.vi:1790006 ... Solution: Defer clear (session close) until you are done using it".
From my research it appears that the XNET CAN session is automatically being closed after the VI is done executing. Interestingly, if I call the CAN initialization sequence from TestStand, then run the Python code which enables the CAN hardware and reads received frames it works as expected.
Is there any way to keep the XNET session open between sequence calls from Python?
Solved! Go to Solution.
08-26-2025 02:47 PM
The solution is to keep the sequence file loaded by doing the following two steps:
Assuming the sequence is called multiple times, the sequence object should not be immediately released on the first call but can be immediately released on the subsequent calls since NI keeps a load reference count.