06-30-2011 11:26 AM
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
Solved! Go to Solution.
06-30-2011 11:29 AM
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.
06-30-2011 11:40 AM
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?
06-30-2011 12:24 PM
06-30-2011 12:28 PM
@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
06-30-2011 12:38 PM
@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.
07-20-2011 06:00 PM
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?
07-20-2011 06:13 PM
You are allowed to put case structures inside the timeout case. 😄
07-21-2011 01:54 PM
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