10-05-2005 05:08 PM
10-07-2005 10:18 AM
The "elegant" LabVIEW solution is a state machine reading each byte in succession and parsing as required.
Depending on your hardware (you didn't say whether it is GPIB or serial, but I'm guessing serial) you might be able to configure it to detect an "end of message" character or condition. This is easily done with GPIB, not always possible with serial devices. If the hardware can be configured to terminate the read when the string is complete then finding the ETX is simple.
For some instruments a character count value is provided in the control bytes or at the beginning of the data frame which simplifies the parsing. Otherwise each character must be tested as they occur.
Rich
10-11-2005 03:07 AM
10-11-2005 08:04 AM
Thank you both RLD and LuL.
Serial port: YES, HW handshake: NO
But RLD has a point:
"For some instruments a character count value is provided in the control bytes or at the beginning of the data frame which simplifies the parsing. Otherwise each character must be tested as they occur"
By determined reading the manual I found that my "datastring" actually consist of 3 control bytes (no \10's) and a DATA FRAME LENGTH byte. But the lenght dont include the \10's. So my problem stil persist but in a different form:
Now I only have to find the count value, count all bytes except the \10's, the double tens count as one. And put valid databytes in a string or queue.
What will the elegant LV way look like ?
Thanks
RunnerBoy