06-08-2006 10:41 AM
06-08-2006 11:18 AM - edited 06-08-2006 11:18 AM
Put your VISA Read inside a for loop and specify 1 byte to read. Wire the output of VISA Bytes at Serial Port to the count terminal of the for loop.
Message Edited by Dennis Knutson on 06-08-2006 10:18 AM
06-08-2006 11:37 AM
06-08-2006 11:54 AM
06-08-2006 12:01 PM
06-12-2006 03:33 AM
or enable and use the '>' (x3E) as the termination character
06-12-2006 03:36 AM
06-12-2006 11:24 AM - edited 06-12-2006 11:24 AM
So it seems as if ">" is the character that signals the termination of a command. Use this as your termination character, and initialize the serial port that way. See picture of how to do this (">" is ASCII 62 in decimal). When reading, the ">" character will signal the termination and the reading will stop. Other characters afterwards will remain in the buffer until the next read.
You should fix your code to prevent infinite loops in case the termination character is not received. What happens if the character is never sent due to some glitch in the sending system, or if some glitch causes a different character to be received instead of ">", or if the comm link breaks before ">" is received? Your program will get stuck. You need to fix this by putting a timeout or something that will abort or end the code in case something goes wrong.
Message Edited by tbob on 06-12-2006 10:25 AM
06-12-2006 01:10 PM
Thanks pti-bob! 🙂
I could not have said it better myself. Glad to see you back & contributing. Does this mean that the health has improved?
JLV
06-12-2006 01:16 PM