11-19-2023 07:07 PM
with a waveform chart,
when i use a blank array constant to clear the history data property node, i dont get the first point, only the last 3
it isnt present in the history either
I made a second chart fed from the same source and didnt clear its history and it works fine (4 data points)
any ideas, clarification, or suggestions would be appreciated
thank you
Solved! Go to Solution.
11-20-2023 01:12 AM - edited 11-20-2023 01:15 AM
Hi cwhw,
@cwhw112 wrote:
any ideas, clarification, or suggestions would be appreciated
Race conditions!
See this:
There was no execution order aka "THINK DATAFLOW!" in your VI…
11-20-2023 01:23 AM - edited 11-20-2023 06:54 AM
Specifically, your FOR loop and the history clearing run in parallel, so by the time it clears, one point might have already been written, then wiped. Similarly, inside the loop you read the history in parallel to writing to the chart history. You cannot predict what happens first, but the outcome critically depends on order.
Execution order is most easily enforced via dataflow. try the following (and if you configure the Vi to clear indicators when called, the "history data 3" indicator won't show stale data from previous runs until the history is written.)