03-24-2021 02:32 AM - edited 03-24-2021 02:42 AM
Hi,
There are three parallel while loops in my project: #1 "Main" #2 reading instrument #3 playing soundfile,
From main i can start or stop #2 and #3 with variable.
In #2 while loop there is a delay of 1ms. I use #2 loop to read instrument via serial port. In some case this loop reacts as if there were no visa read implemented.
Should re initialization of serial communication be the solution?
Kind regards,
Balázs
03-24-2021 04:01 AM
I suspect your design could be improved with a change to your subVI communication strategy, but that aside...
the problem that you're describing is likely some combination of the code in "SUB = ILT1700 Read.vi" and perhaps the instrument/driver behaviour.
I imagine (without seeing the VI in question) that you're using Bytes at Port and returning the full string that is there, and that you're getting no response in some cases because you didn't wait 'long enough'.
Ideally you should use a 'termination character', but this depends on the message structure of the device/driver. If it doesn't have a termination character (and you can't set one) then you need to be more careful.
For better advice, please share the subVI, and information about the device's communication protocol.