01-08-2016 12:53 PM
Hi,
When I initially start the VI, the time elapsed boolean turns ON then OFF. This is because of the One Shot Falling.
Essentially, what I want to achieve is: If input goes from true to false, wait a second and turn ON the Time has Elapsed boolean, then reset it to false.
01-08-2016 04:24 PM
Dear Team,
This VI makes no sense to me, and it doesn't get any better when I execute it -- the indicators turn True immediately, no matter whether Input is True or False when this VI runs.
I think there are a couple of things about these functions that you don't understand. It certainly is not in a position to detect falling (or rising) edges, as there are no loops ...
Bob Schor
01-11-2016 11:11 AM - edited 01-11-2016 11:12 AM
TeamHalli,
From what I can see, your VI will run ONCE and detect ONE change from TRUE to FALSE on your Input Boolean. The One Shot Falling With Input VI will detect this change and send a TRUE constant to the Elapsed Time Express VI. This then starts a timer.
2 things to note:
1. Time between 0 and 1 seconds, the Time has Elapsed Boolean will read TRUE because the Time has Elapsed property (in the Elapsed Time VI) will read FALSE until the time is greater than the Start Time plus Time Target (1 second in this case). Because you have a NOT node between this property and the Time has Elapsed boolean, this sets this boolean to TRUE.
2. Time greater than 1 second, the Time has Elapsed Boolean will read FALSE because the Time has Elapsed property (in the Elapsed Time VI) will read TRUE once the time is greater than the Start Time plus the Time Target (again, 1 second).
To programmatically change this boolean value, I suggest using a sequence structure where your Time has Elapsed boolean is. I would make sure that this structure includes time delays according to what you want. At the end of this sequence structure, you can programmatically reset the value of the Time has Elapsed boolean by using a local variable to change it to FALSE again.
If this does not help, perhaps I do not fully understand the use of this code. Could we get some more background information? Is this only supposed to execute once? Is this run in a while loop?
Cheers,
Eric H.
Applications Engineer
National Instruments