From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
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?)

Regards

 

0 Kudos
Message 1 of 3
(1,989 Views)

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.

 

Lynn

0 Kudos
Message 2 of 3
(1,977 Views)

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
(1,896 Views)