Philley Posted October 10, 2005 Report Share Posted October 10, 2005 I have this factorial vi all set up but now I need to add an LED that will blink for only 6 times when a decimal number is inputted. Any help will be greatly appreciated. Download File:post-3066-1128963057.vi Quote Link to comment
WMassey Posted October 10, 2005 Report Share Posted October 10, 2005 I have this factorial vi all set up but now I need to add an LED that will blink for only 6 times when a decimal number is inputted. Any help will be greatly appreciated. See if this will do what you are asking: Also note I have shown you an alternate way to the one you used to get the NAN value. Quote Link to comment
Philley Posted October 10, 2005 Author Report Share Posted October 10, 2005 I've been able to get that far but it keeps blinking. I need it to stop blinking at the 6th blink. Quote Link to comment
WMassey Posted October 10, 2005 Report Share Posted October 10, 2005 I've been able to get that far but it keeps blinking. I need it to stop blinking at the 6th blink. Then you are calling the FOR loop multiple times. You need to setup the rest of the VI so it will only execute the loop once, each time your value is entered. Is that the part you are having trouble with? You cannot use the "continuous run" button and expect the FOR loop to run only once.Do you want to detect when your "n" value changes (I assume that is what you mean when you say "decimal number" changes), do your calcs, flash your lights, and then go back to waiting for another change? Actually you can use the continuous run button, it's just not how many of us would do it. Put an event structure around everything on your block diagram. Setup the event to "Fire" when the value of N changes. Then try your continuous run button. Quote Link to comment
Philley Posted October 10, 2005 Author Report Share Posted October 10, 2005 Ok lets say that if I put 1.5 into the "n" field the case structure that I have in the vi will go to 4 there isn't a way that from within that case theres a LED that will blink 6 times and stop while running continously? Quote Link to comment
WMassey Posted October 10, 2005 Report Share Posted October 10, 2005 Ok lets say that if I put 1.5 into the "n" field the case structure that I have in the vi will go to 4 there isn't a way that from within that case theres a LED that will blink 6 times and stop while running continously? Each time the VI restarts (loops) it will see the "1.5" value sitting in the control, it will perform all its calcs and come up with the same answer as before and execute case #4 and give you the same error message. If that includes rerunning the FOR loop then it will rerun and blink the LED 6 times. When everything finishes it will all start over and do it all again. I edited the message above to show one way to do it while retaining the use of the continuous run button. Most of the people who have been using Labview for anytime would not use that button for anything other than quick & dirty testing however. We'd put it all into a WHILE loop . I'll throw something together to show you and attach it to this message in a moment. OK, try the attached revised VI. Don't use the continuous run button when running it. Download File:post-2800-1128970320.zip Quote Link to comment
Philley Posted October 10, 2005 Author Report Share Posted October 10, 2005 Thank you for the help I understand what my problem was. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.