LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use the Same Chart Display for Data coming from Different Event Structure Cases

Solved!
Go to solution

Hi,

 

I'd like to use a single chart to display data that is input and modified by one of two different event structure cases.  So, if Event Case 1 is selected by the user, the data would be input by the code contained in Case 1 and then fed into a waveform chart for display.  If Event Case 2 is selected, similar data would be input into Case 2 but then displayed by the same waveform chart as in Case 1.  I don't know if there is a way to do this...it looks like each event case would need its own waveform chart, but this quickly becomes unwieldy in terms of the GUI for multiple event cases.

 

Any tips would be greatly appreciated!

 

Thanks,

Mike

0 Kudos
Message 1 of 9
(3,137 Views)

Place the chart after the event case?

 

If there are other event cases, place the chart in a case structure after the event and either feed it a true (event 1 and 2) or false (all other events), depending on if you want to update the chart or not.

Message 2 of 9
(3,132 Views)

Thanks for the reply!

 

Those would work, except that I'd like the chart to update while the event case is running (each would contain an indefinite while loop), rather than only after completion of the event case.  Thoughts?

0 Kudos
Message 3 of 9
(3,128 Views)
Indefinite while loops don't belong inside event structures
Message 4 of 9
(3,120 Views)

@altenbach wrote:

Place the chart after the event case?

 

If there are other event cases, place the chart in a case structure after the event and either feed it a true (event 1 and 2) or false (all other events), depending on if you want to update the chart or not.


 

THAT is the exact method described in the LV Advanced course material re: XControls.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 9
(3,115 Views)

@altenbach wrote:
Indefinite while loops don't belong inside event structures

 

Use the single outer loop to spin all code, e.g. as described here or here.

0 Kudos
Message 6 of 9
(3,107 Views)

This seems to accomplish letting one event case run indefinitely after a single event fires, whereas any other event cases would only be performed once per event.  What if I need there to be two different event cases which can run indefinitely?  For example, a "background" case that continuously sends a data point to a graph (as can be done using your timeout trick), and a "record" case which does the same thing but also moves each subsequent data point into an array?

0 Kudos
Message 7 of 9
(3,068 Views)
Solution
Accepted by topic author inanimatecarbonrod

You are allowed to put case structures inside the timeout case. 😄

Message 8 of 9
(3,066 Views)

Hi inanimatecarbonrod,

 

To have something run "in the background" from your event structure or add to a graph from two different places, I would recommend a Producer/Consumer architecture.  File > New > From Template > Design Patterns.

 

Have a great day,

 

Chris V

Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(3,052 Views)