LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a User Interface which Processes a Continous Stream of Data

Solved!
Go to solution

Hi all,

 

The program: I am trying to create a program which takes in a continuous stream of data from an external source. The user can interact with the front panel to do various things such a plotting the data, starting a calibration process, stopping a calibration process, etc.

 

I have attached a VI which a very simplified example of what I am trying to do.

In this VI, loop 3 is taking that live stream of data and processing it into various doubles, strings, etc. and passes that data via a queue to loop 2. Loop 2 is what does all the logic and display for the program (In actual application, I would have many sub-VI's inside here to do this). Loop 1 is what handles the user inputs. So far, the solution I have been able to come up with is using local variables to take the user input from loop 1 and select the appropriate process in loop 2. This is functional and would work but I am wondering if there is something better.

 

The problem: How can I do this without using local variables?

  • I have considered using an event driven state machine but to my understanding, the issue with that is once a process has started, you cannot do anything until the case returns to the "wait for event" case.
  • I could combine loop 2 and 3, get rid of the data1 queue entirely and then use queues to pass the enum state/cases from loop 1. However, the issue with this is that combining loop2/3 would be too much processing for a single loop and would slow the whole program down.

Thanks,

mkhan

0 Kudos
Message 1 of 3
(709 Views)
Solution
Accepted by topic author mkhan_1

Change the data content you use for the queue to loop 2 to be a cluster with a command (ENUM or String) and a variant for the data type. When you dequeue a message check the command type first and use that to select the case you will execute. any given case/command will know the data format for the specific command and can call variant to data with the appropriate typedef for the data. This way both loop 1 and loop 3 can send messages to loop 2.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 3
(693 Views)

That is a great idea actually. I will try that.

Thank you!

0 Kudos
Message 3 of 3
(687 Views)