I am fairly new to LabVIEW and am working on a project where I need to continually read data from a serial port and process the data in nearly real time. I have researched the producer consumer architecture, however I am not sure if it is feasible for what I am attempting to do. The data collected from the serial port is in a 1D string array where I will search the string for the first occurrence of the packet type byte. The packet type byte will be 0x00, 0x01, or 0x02, and after i find this byte i must check the following byte which contains the packet length to ensure that I am at the beginning of the message. If this starting point is invalid, i must pass this index to another state where I begin searching for the packet type byte beginning at the new index. After the valid starting point has been found i must parse the data and look at the next byte to continue parsing until I can no longer parse the message. Whatever data is left at the end of the message that can not be parsed into a complete packet must then be concatenated to the beginning of the new data that will be read from the serial port.
Does anyone have any suggestions at the approach i should take and is the producer/consumer architecture the right choice? I read about the queued state machine architecture, however some of it seems like it is unnecessary for this application.
Should i be using a state machine since the data can be parsed into 3 different types of packets?
Thanks
Gary Still