Your problem lies in your loop:
See my previous explanation of the
serial communications under windows.
I also previously experienced issues with the serial communications functionality under windows with fast response times if there is not a lot of data transmitted. It's almost as if the buffer waits for a longer period before servicing it and giving it back to CVI. This can be overcome iusing direct SDK calls, but that's redesigning the wheel.
A simpler solution in your case would be to make your loop respond faster. I would bet that the delays occ
ur at the ComRd (port, msgStr, 5); function in your control loop. Decrease the wait time in your SetComTime (port, 1.0); to a smaller number like 0.1 see what happens.
You might get more that one response back at a time, but if you get a message every 8ms that should work. The way the serial routine works it might not get updated if it sits in a call waiting for the buffer to reach a count of 5 and especially in debug mode.
You might want to use a diffirent read method as well and read a terminated buffer instead bu using ComRdTerm (1, , , );
Let me know how you get on!
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd