LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

newbe help with understanding order of execution and timing

Highlighted

natas,

 

here's my pseudocode. It's not perfect. parallelism makes this harder I guess.

 

 

loop{

 

turn green LED ON

turn red LED OFF

ledBool= !ledBool

 

if (ledCount  == 1){

    turn yellowLED  ON

    delay 5 seconds

    turn yellowLED OFF

    flash orange LED 10 times (eat up 5 more seconds)

    turn greenLED OFF

    turn redLED ON

    flash ornageLED 4 more times

 

else

    delay 10 seconds

}

 

set greenLED OFF

set redLED  ON

delay 10 seconds

 

 

}

 

 

 

 

 

 

 

0 Kudos
Message 11 of 19
(705 Views)
Highlighted

Sorry for sounding so daft, but I can do this with only one loop? I'm seriously running out if ideas guys. 

0 Kudos
Message 12 of 19
(699 Views)
Highlighted

Wow breakthrough, I think I might have it. Don't give me an answer yet, please. haha

0 Kudos
Message 13 of 19
(690 Views)
Highlighted

Finally! This seems to work pretty well. I couldn't do it with just one loop, but close. Any advice on how to make this more efficient would greatly appreciated.

 

 

Thanks guys!

 

 

test2.png

Message 14 of 19
(681 Views)
Highlighted

Now go back and look at the spoiler in my last post.

 

NOTE: there is a missing wire!  left for the student to debug

"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 19
(672 Views)
Highlighted

Thanks Jeff I didn't even see that there. Not sure what the arrows pointing backwards do. Looks kind of like an op-amp in a feedback loop. I'm going to try out your circuit   program (haha) and see how it differs. Is there a reason why yours is better than the one I made?

0 Kudos
Message 16 of 19
(649 Views)
Highlighted

@analogPumpkin wrote:

Thanks Jeff I didn't even see that there. Not sure what the arrows pointing backwards do. Looks kind of like an op-amp in a feedback loop. I'm going to try out your circuit   program (haha) and see how it differs. Is there a reason why yours is better than the one I made?


Those backward arrows are "Feedback Nodes."  They are found on the Structures pallete. They operate simillar to Shift Registers (The differences are moot for this use case.)  In fact, you could right-click them and select "Replace with Shift Register" and have equivalent code in this case.

 

@as to "Better" there is one HUGE difference.  Your vi must complete the for loop meaning, it could take up to 40Seconds afer the "Stop" button is pressed before the vi actually stops.  Most users are going to pound their mice agressively when that happens.  My vi will exit within 1/2 second (Honestly, this is STILL too long! ideally we should use @ a 200mSec wait and adjust the Q&R divisors accordingly)

 

Getting familliar with all of the functions on the pallates takes time and practice.  Nice work.  Read the help in the floating window (Hit Ctrl+H to bring up the help window) and don't be afraid to keep posting.

"Should be" isn't "Is" -Jay
Message 17 of 19
(642 Views)
Highlighted

@analogPumpkin wrote:

Finally! This seems to work pretty well. I couldn't do it with just one loop, but close. Any advice on how to make this more efficient would greatly appreciated.

 


You can remove the inner For loop and use a Quotient and Remainder of the remaining While loops "i" to get your "loop# 1 to 40".

That way you'll also get a Stop response time of <1sec.

Good job.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 19
(619 Views)
Highlighted

A funny thing happened on the way to school:

 

Although the OP learned a lot and made great efforts!  I did not read and understand the specifications in the first post.  Hence the proposed solution in message 10 ABSOLUTELY missed.

 

This is my fault for not following a clear spec!  Post 10 is hereby revolked of its solution and an alternate snip is below

Capture.PNG

"Should be" isn't "Is" -Jay
0 Kudos
Message 19 of 19
(597 Views)