I think it would be best to parse after. This way you don't have to worry about leaving bits in the buffer and flushing it out.
Another newbie question: Does an instrument driver need to be installed for a device to properly send a serial message? I have a couple pieces of equipment that don't have associated instrument drivers - is that a problem?
There are literally thousands of instrument drivers available (including the 34401 that comes with LabVIEW) and they all parse the return strings from a VISA Read in some form or another. How they parse is very dependent on the instrument. Attach a typical string returned.
Your code right now does not use an instrument driver so of course one is not required.
Thanks for the response. Conceptually, what I want to do is strip out the data from the serial message. The way a serial message packet is organized is that it has a start bit, 6 data bits, and a start bit. Would it be best to grab 8 message bits, strip off the first and last, and somehow recover bits 1-6 into an unsigned data packet?
Sorry - RS232 serial message packet is: 1 start bit; 7 data bits; 1 parity bit; and 2 stop bits. So I guess I read 11 bits, strip bits 1-6, and reassemble into data?
1) Typically, you always want to read out everything the buffer has to offer as opposed to asking for N bytes and hoping you get it.
2) Parsing out the data that you want from a data packet is very typical LabVIEW 101. Use one of the many String parsing functions. I almost always use Match Pattern but there are others.
I once worked with a data packet that was a few hundered bytes long - and this varied from message to message - and the "data" was only 2 bytes!
Thanks...the plot is thickening. I wasn't aware that companies would deviate from the RS232 protocol to allow unique formatting of their data - very eye-opening. I'm working on getting some datasheet stuff that explains the frame formatting for the products I'm using. I found the user guide for the Cooper Instruments & Systems Model BG100 force gauge. However, I can't find a datasheet or user manual for the Mastech M9803R multimeter (in-house or online). The BG100 will require a message be sent to it (\?) to release data onto the serial bus.
I wasn't aware that companies would deviate from the RS232 protocol to allow unique formatting of their data
RS232 "standard" does not define any character limit, length, order, etc. - you are free to send anything down the pipe you want. RS232 is an electrical standard for the interface.