09-15-2018 04:50 PM
I am attempting to set a numeric indicator and have the LED blink N number of times per minute. I am not sure exactly where to start. This is what I have so far.
Any help would be greatly appreciated..
09-15-2018 05:11 PM
Your code makes no sense. You take "Blinks per Minute" and divide by 60 which yields blinks per second, then compare that to the iteration count.
Blinks per second will be a constant value, whereas the iteration count will be a number that continuously increases (very rapidly).
Take a look at the functions on the timing palette.
09-15-2018 06:29 PM
Also make sure to see if you can figure out what would change if you would remove the "select" node. "o
(see also).
Your loop spins millions of times per second. Place a suitable wait to pace the loop timing.
09-16-2018 10:13 AM
Altenbach is referring to our old friend from C
X = Bool? TRUE:FALSE;
Unless my C is rusty.
09-17-2018 10:15 AM
Your question is kind of vague.
When you say you want to "blink an LED N times per minute", does that mean:
09-17-2018 11:07 AM
I apologize. I need the LED to blink at a variable rate per minute. My numeric control is what changes that rate of the blinking. As I increase the numeric control, the number of blinks per minute increase. I’m just not sure how exactly to control the rate of blinking through a numeric control.
09-17-2018 11:16 AM - edited 09-17-2018 11:21 AM
@chriscm3 wrote:
I apologize. I need the LED to blink at a variable rate per minute. My numeric control is what changes that rate of the blinking. As I increase the numeric control, the number of blinks per minute increase. I’m just not sure how exactly to control the rate of blinking through a numeric control.
Start with something like this:
Then change the control to a different type and maybe add some logic that allows you to make a selection based on blink rate not delay time.
09-17-2018 11:23 AM
Start with RTSLVUs code, but keep a fixed loop rate at a reasonable lower limit (e.g. 100ms). Then just measure elapsed time and "toggle boolean+reset timer" whenever a certain time is reached (based on the desired blink rate). The problem with the current code is that if the wait time gets long, the VI cannot be stopped because the stop button only gets polled very rarely.
What duty cycle do you want? "50% off/50% on" or something else?