03-30-2014 01:23 PM
Hello! I'm trying to create a program that will turn off LEDs after a number of seconds, or when the program is ended. I found this program - http://forums.ni.com/t5/LabVIEW/how-to-automatically-turn-off-leds-after-1-minute-button-press/td-p/...
but can't seem to configure it with the DAQ Assistant I've been using. The program I've been working on is attached.
Any ideas or help would be much appreciated!
Ashleigh
03-30-2014 01:59 PM - edited 03-30-2014 02:17 PM
Sorry, I don't have DAQ, but you seem to have a few misconceptions.
Does the program currently work?
Some general points on programming stype:
03-30-2014 02:03 PM
Ashleigh,
It helps us to help you if you ask a specific question. I am guessing, from the way your program works, that you want to know how to set the Digital Output to the hardware LED to the off state when the program is stopped, right?
To do that you need to write a set of all False values to the Digital Output in the False case or after the while loop exits.
Since you are a beginner and are trying to learn, I will give you some hints but not do it for you.
1. If you need to write to Digital Output in both the True and False cases, consider the problems of duplicating code. Also, you will probably get an error if you try to set two DAQ Assitants to write to the same Digital Port. Hint: Only the data is different between the cases.
2. What is the purpose of the shift register? The same value is wired across the loop.
3. You could set the Lock Boolean Text by context-clicking on the indicator and checking the box in the Properties dialog. Or, if you prefer to use the property node as you have it in your VI, make a second property node and set that property one time before the loop starts. There is no need to write the same value to that property 10 times per second.
Lynn
03-30-2014 02:07 PM
altenbach,
The default property for a boolean LED (which does not have boolean text visible) is with Lock text in center unchecked. It is checked on booleans which have text showing when dropped.
Lynn
03-30-2014 02:14 PM - edited 03-30-2014 02:15 PM
johnsold wrote:The default property for a boolean LED (which does not have boolean text visible) is with Lock text in center unchecked. It is checked on booleans which have text showing when dropped.
Well yes, but once it is set, e.g. after running the VI once, it never needs to be changed again unless the VI is not saved. (I was talking about the program default, not the system default. Sorry for not being completely clear).
Here is a simple code skeleton that does exactly what's required (simulated).