LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I plot data from multiple asynchronous loops on one chart

I have an application that is aquiring data via I2C from two separate I2C busses.
Each I2C process is connected to its own isolated I2C bus and runs in its own parallel loop on the block diagram asynchronously.
I have a separate parallel chart loop to handle the incoming data.
 
My question is "how do I overlay the data from these two separate loops onto the chart as it comes in".
As stated, the plots are asynchronous so there will be times when one channel is active and the other is not so the inactive channel data will have to be coerced to the last data that was posted.
 
I have implemented a queue of type 2-D array and update only the appropriate element?(channel)  within each I2C loop and try to force the other element (channel) to null.
This is not working so well and rather than waste alot of time I am posing the question to those who may have done this before.
 
Thanx in advance!
0 Kudos
Message 1 of 2
(3,022 Views)
This sounds like a good use for a functional global, otherwise known as an Action Engine. A search for either term should yield a lot of helpful results on this message board. Functional Globals are subVIs that store data in them in uninitialized shift registers. The Functional Global then has various operations that it alone can perform on that data. Usually these operations include Get and Set operations, but it can be more complicated, including things such as Get Average for a data set.

The idea here would be to store the array of values that get posted to the graph from the asynchronous sources inside the Functional Global. The Functional Global then has an operation to update a particular channel's data and to output the entire data set for display.

I'll attach an example saved in LV8.0. The example I have has three cases (operations) for the Functional Global. An Initialize case to set the array size for the proper number of channels, a Insert Value case to update one channel without affecting the others, and a Get Values case to output the data.
Jarrod S.
National Instruments
0 Kudos
Message 2 of 2
(3,010 Views)