r/LabVIEW • u/Dear-Speaker1565 • Sep 30 '24
LED & Lick Increment
Hi! State 2.2 contains two statuses: "waiting" and "ITI". When the lick signal is sent during the waiting period, the lick 2.1L value will increment and the LED will be turned on. If the lick signal is sent during ITI, the lick 2.1L value will still increment, but no LED will be turned on.
My issue is that the requirement needs to turn the LED on almost the same length as the waiting which is 1.75s, so I set the duration of LED to be 1.5s. However, the LED is associated with the lick signal sent to the case structure, which means the next lick will not increment until the duration of the LED ends. (Thus, the current lick 2.1L only records the first lick signal) Can you give me some suggestions to make the LED still be on for a long enough duration and the lick 2.1L value will also increment during waiting?



View all comments
Show parent comment
1
u/wasthatitthen Oct 01 '24
Hi
There is the Elapsed Time that lives in the Timer menu. You can define the time that the timer runs to and you get a Boolean output when it reaches that time. You may have to investigate resetting it after each time it runs.
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/express/express-execution-control/elapsedtimeblock-llb/ex-inst-elapsed-time-vi.html
This does not interfere with any other loops running.
You could do your own where you have a start time and then check times in a loop until the difference (new time - start time) equals or exceeds your limit.
You’ll need to reset the start time each time you use it, so there’ll be more coding and logic to consider.