Showing results for 
Search instead for 
Did you mean: 

State machine and parallel read

I'm working on project with data acquisition. I have used standard state machine and now I want to add while loop with read from USB/COM port. Where add it? Outside? then two while loops will work parallel or one inside another (in what sequence?)



0 Kudos
Message 1 of 3

It may depend on exactly what your program will be doing while reading, but in general this kind of situation is exactly what the Producer/Consumer Design Pattern is for. Newer versions of LabVIEW have a template set up to get you started.



0 Kudos
Message 2 of 3

Dear Lala,


Welcome to NI Forums! As the previous poster had said, There are a few questions you have to ask yourself to make the correct decision. How fast in my State Machine running? How often do I need serial communication? Is this port used by other applications? Am I interested in all data changes, or just the latest value?


If you can tell us more about the application, we may give you more specific advice.


Kind regards:



Andrew Valko
National Instruments Hungary
0 Kudos
Message 3 of 3