05-07-2019 07:54 AM
Hi Community,
I'm using a cDAQ to monitor three sensors(0-10v). The VI has been made to detect when the voltage goes beyond a predefined threshold. Once the voltage exceeds the maximum threshold the case structure flips and stores the Waveform Chart for each sensors.
The problem is the voltage can go up and down after the first fault has been detected and this will mean the case structures will keep on flipping to TRUE and FALSE which results in a loss in waveform chart data.
I need some guidance on how to capture the waveform chart on the first and only time the voltage exceeds the maximum threshold.
Thanks in advance
Solved! Go to Solution.
05-07-2019 08:13 AM
I don't have LV18 installed so I can't open your VI and check the non-visible cases, but it sounds like what you need is a latching boolean? By this, I mean not the mechanical action, but rather a trigger connected to a shift register or feedback node via an Or comparison, so that once true, it remains true even if the trigger becomes false.
This shows two possible implementations.
05-07-2019 08:15 AM - edited 05-07-2019 08:16 AM
Store the boolean value in a shift register. Initialize it with a false and wire it through the false case structure. In the true case structure, feed a true out to the shift register. The wire will be false until it turns true, then it will remain true.
Any even simpler implementation is to just OR the shift register with the result of the comparison.
05-07-2019 04:10 PM - edited 05-07-2019 04:30 PM
To keep a boolean TRUE after the first TRUE encounter, I typically use something as follows. (but with a little more code to allow resetting it, of course ;)):
Now, lets clear up some glaring race conditions and inefficient coding practices:
(You did not include the subVIs, so I cannot comment more but I suspect there are more problems. ;))
Here's an example of my point #2: