Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial, read until char == X

Hi,

I'm using the serial.vi to read from the serial port. I'd like to change my program so that I close the port once a particular character has been received, but I'm unsure how to do this. Please can anybody help?

More precisely, I'm sending out a hex string to a device, say 0C,01,02,03.... I then read in 0C,01,02p. 'p' means something has failed so I want to timeout on this character.

Thanks,

Martin
0 Kudos
Message 1 of 2
(2,748 Views)
If you set VISA Configure Serial Port to enable termination character and set the termination character to 70 (p in hex), the VISA read will stop as soon as the p is detected.

p.s. This question should have been posted to the serial forum. It has nothing to do with DAQ.
0 Kudos
Message 2 of 2
(2,746 Views)