Hi all,
I am using LabVIEW python node(by importing pywinusb) to send command and receive response from multiple DUTs. Each DUT is attached to a HID device for communication. So to be precise, python node sends commands to and receives responses from the HID device. Each HID device has individual port and the HID devices will always be there. Only the DUT will be removed upon each successful test.
Since there are many commands to be sent to the device, i am constructing my code in a state machine. In my code, i try to open python session once and close it only when user stop the test software. The test will be conducted on DUT1 follow by DUT2 to DUTn and loop back to DUT1. However, i found two issues. Issue 1 is sometimes the LabVIEW will return an error as below.

Second issue is, when the DUT finish testing all DUTs and loop back to DUT1, it will gives rubbish response even when there is no DUT available.
This two issues will never happened when i open and close python session at each step. Due to confidential reason i cannot upload the code but i have upload a similar code on what i am actually doing.
Anyone could advise on this?
Best regards,
Crystal