Jump to content

Need help with a vi


Philley

Recommended Posts

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:

post-2800-1128965205.jpg?width=400

Also note I have shown you an alternate way to the one you used to get the NAN value.

Link to comment
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.

post-2800-1128968883.jpg?width=400

Link to comment
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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.