07-27-2015 05:48 AM
Hi Folks.
I am reading information for a device which sends out its info on startup to the serial port. The VI attached reads it and takes the relevant information from it. The only problem is that it is quiet slow. It takes a few seconds for the data to show up, approx 5 seconds. It should be almost instantaneous as I have seen using hyperterminal. Any idea why this may be?
Thanks,
Mark.
Solved! Go to Solution.
07-27-2015 06:20 AM
Hi Mark,
Your timeout is set to 10 seconds, is it possible, that not all 150 bytes are available immediately? Other than that, you should add a stop event case. If you don't have that, you have to click stop and then read to stop the VI.
07-27-2015 06:44 AM
Does the instrument use a termination character? If so, use it. It will make your life A LOT easier. Most instruments use a Carriage Return to terminate a message. If you have that enabled, then the VISA Read would stop when that termination character is found.
If, however, your instrument does not use a termination character, then you need to know EXACTLY how many characters are send out of instrument for the message. If you guess too few bytes, then you will not get all of the data. If you guess too many bytes, then you will have to wait for the timeout to happen.
So if the message is not 150 bytes, you will be sitting there waiting for 10 seconds. If the instrument had the termination character, just enable the use of it on the VISA Configure Serial Port and your issue would go away.
07-27-2015 09:31 AM
I changed the byte count to 130 which is the actual length and now works instantanously. There is no termination character from the device but it is of a fixed length.
Thanks for your help.