06-01-2015 02:55 PM
I'm working with a VISA resource over USB that reads in the results of printf(%lu %hhu %d) from a microcontroller. As these results are numbers in ASCII, their length in bytes is unkown. The numbers *should* be no more than 3 digits, but I can't know that for sure. VISA Read won't let me leave the number of bytes unwired, so should I just attach a high constant to it? Or is there a better way?
Solved! Go to Solution.
06-01-2015 03:13 PM
1. Have the microcontroller send an End Of Line character (0xA on the ASCII table) at the end of the printf.
2. Enable the Termination Character of the VISA session and set it to be 0xA. You may have to do that through the VISA property node.
3. Tell the VISA Read to read more bytes than you would ever expect to get. The VISA Read will stop reading when it finds the termination character (the End Of Line).
06-01-2015 03:14 PM
06-01-2015 03:14 PM
Thanks guys! I've noted this as solved.