I'm having trouble communicating with the serial port. I'm trying to talk to flow control valves that send out their current flow rate every 0.5 seconds. I'm communicating with 6 of them using a USB -> serial port converter.
I have a routine that mostly sort of works as expected. When I test it, I can request the valves reply with their configuration and they do. I can then read the buffer at the port and get the data I need.
However, when I put this into practice, about 5% of the time I get an error (usually -1703807339 Timeout expired before operation complete). Once any valve has an error, it generally stays in error mode until I re-start the program.
I have tried a routine that closes the serial port, then uses "VISA configure serial port" to reset the connection... this is sometimes successful, but not always.
The upshot is that the program works for a couple of hours, but eventually isn't getting data from the valves.
I'd greatly appreciate any suggestions. I've attached the main routine and the two subroutines that actually talk to the valves.
cheers,
mike