02-02-2016 01:26 PM
I am trying to use a sub VI to distinguish between a passing and failing value. If it is a failing value it should wait 10 secinds and send an alarming signal back to the main VI, but the elapsed timer never counts up. Why isn't the counter counting up to 10 and passing changing "alarming" to true? What am I doing wrong? Is there a better way to do this?
02-02-2016 01:33 PM
Hi djnbae,
You have nothing running in a loop, so your code only executes once. You will need the loop if you want to see anything happening over multiple runs of the code, such as "counting".
02-02-2016 01:44 PM
How do I do that without holding up the execution of other items in the main VI?
02-02-2016 01:45 PM
I couldn't tell you without seeing your Main VI
02-02-2016 01:46 PM - edited 02-02-2016 01:52 PM
02-02-2016 01:53 PM
I have attached my main VI. I am hitting my head against a brick wall, so any suggestions would be greatly appreciated.
02-02-2016 02:04 PM
There are many potential race conditions in this code, I really advice to take some tutorials (courses) in LabVIEW. You should properly understand what data flow means, learn how to set up and use a state machine, timing using a state machine, Event driven programming (Event structure, User Events), Queues, type definitions, etc... After understanding the basics (lets say Core 1-2 course material), you could examine some basic design patterns (partly the Core 3 learning material).
02-02-2016 02:06 PM
Unfortunately that's a huge block diagram and it's going to be hard to give any suggestions that don't involved a lot of re-doing / starting over.
Perhaps you can store the time the alarm was triggered in a shift register. In your main VI you can see when the current time minus the alarm time is greater than 10 seconds, then reset the alarm time to -1 or something so you know to ignore it until another alarm is triggered.
02-02-2016 02:08 PM
Ouch! As I said, reduce the problem to a small example. We don't want to sort out that gigantic mess. (And don't maximise to the screen!)
02-05-2016 12:44 PM
You mention using a state machine instead of the sub VI I wrote, could you give me a simple example how to accomplish this?