05-13-2016 09:41 AM
Hello,
Here is modelisation of my real case.
Here are key points:
Actually this code doesn't work - wavechart isn't updated at all.
Also additional problem - stop button doesn't work.
Thanks in advance.
05-13-2016
09:50 AM
- last edited on
06-16-2025
06:48 PM
by
Content Cleaner
It is a BAD BAD BAD idea to have multiple event structures in the same loop. If any of those events are set to lock the front panel until the event completes, then I guarantee you are locking up your VI cold unless your user is able to execute a very precise series of events.
Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2015 Help
05-13-2016 09:57 AM - edited 05-13-2016 09:58 AM
Hi Pavel,
Actually this code doesn't work - wavechart isn't updated at all.
Yes.
Because you only update the chart in case of an event. And that event never fires…
Additionally: when you want to have things happen in parallel you need to program them in parallel structures!
Also additional problem - stop button doesn't work.
Yes.
Because the loop waits for an event, but there is none…
Your VI shows you don't understand to THINK DATAFLOW! (After all this time you are asking questions here you should have learned that!)
And as said before: don't use multiple event structures in one VI (or even one loop) for no good reason!
05-13-2016 10:10 AM
Ok, thanks for suggestions.
Here both event structures are removed.
How to modify this case in order it runs according with my scenario (actually X/Y/Z are updated at the same time).
Thanks.
P.S. Also chart isn't erased on start.
05-13-2016 10:16 AM
Well, your X Y and Z will never fire a value change event because they are indicators. (Unless you write new values to them using a Value (Signalling) property node, which I do not see in your code.
@Pavel_47 wrote:Ok, thanks for suggestions.
Here both event structures are removed.
How to modify this case in order it runs according with my scenario (actually X/Y/Z are updated at the same time).
What do you mean by this? What is your scenario?
Thanks.
P.S. Also chart isn't erased on start.
Write an empty array to the "History Data" property node of the chart. But your reinit to default should do it as well.
Why do you have that code in a while loop? The way you have it programmed, it will run twice (once and then when first call is true, the loop will iterate and run once more.) Just wire the error wires to the border of your main while loop and that will guarantee they all run before the main loop.
05-13-2016 10:29 AM
What do you mean by this? What is your scenario?
The variables X, Y, Z are updated consequently.
So once a new iteration starts, new poit on X axis appears.
Then on X update new point on X curve appears
Then on Y update new point on Y curve appears
Then on Z update new point on Z curve appears
Is such scenario realisable ?
Chart erase still doesn't work
05-13-2016 10:39 AM
With history data erase works.
05-13-2016 12:11 PM
@Pavel_47 wrote:What do you mean by this? What is your scenario?
The variables X, Y, Z are updated consequently.
So once a new iteration starts, new poit on X axis appears.
Then on X update new point on X curve appears
Then on Y update new point on Y curve appears
Then on Z update new point on Z curve appears
Is such scenario realizable ?
I think you'll need to use a waveform graph set up to take an array of waveforms. Each time you add a point to one waveform, you'll add it to the array for that waveform and Build all 3 together into an Array. But you'll have to use shift registers to maintain your own history of the points that occurred before.
Chart erase still doesn't work
You're right taht reinit to Default doesn't clear it. I must have remembered things incorrectly. Glad to hear the writing the empty array to History works for you.