From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

newbe help with understanding order of execution and timing

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
(1,128 Views)

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
(1,122 Views)

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

0 Kudos
Message 13 of 19
(1,113 Views)

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
(1,104 Views)

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
(1,095 Views)

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
(1,072 Views)

@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
(1,065 Views)

@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! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 19
(1,042 Views)

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
(1,020 Views)