LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure inside timed loop

Hi guys!

 

Thank you for reading my post!

 

I'm having trouble.  It seems like a simple thing, really, but I've been working on it for several hours here, and getting no closer to a solution (that I know of...).

 

All I want to do is have a button to select whether or not a sine wave is input to the controller.  That's it.  Simple, right?

 

My issue might be that I'm using a case structure inside a timed loop.  I tried this after seeing this solution:https://decibel.ni.com/content/docs/DOC-29597, but it hasn't worked for me.

 

I don't know, but it could be the timings of the loop clocks and loop period.  I've tinkered with many different settings, but to no avail.

 

It just doesn't seem like the boolean Sine Wave Input toggle switch is getting read.  That's why I'm asking about loop timing conditions.

 

I also tried this with a toggle switch and a select statement.  I got the same result - toggling the switch just has no effect.

 

I've attached my code if some kind soul might be nice enough to take a quick look.  I'm sure there's something really easy that I'm not seeing.

 

I'm new to LabVIEW, so please bear with me as I work through some lack of knowledge issues.

 

Thank you for looking!

 

Nathan

 

PS  I'm running on a cRIO (CRIO?) 9024 controller with a 9114 8 Slot FPGA.

0 Kudos
Message 1 of 5
(2,800 Views)

Data Flow!

 

The boolean that stops that timed loop is coming in from outside.  So that loop will run exactly once if that boolean value is true, or run forever if that boolean value is false.  System stop is not read again until everything in the outer loop completes and iterates again.

 

Why do you even have that inner most timed loop?

0 Kudos
Message 2 of 5
(2,785 Views)

Thank you so much!  That surely makes a lot of sense.

 

I tried it without a loop first using a select statement.  Did not work. I also tried a case structure with no loop.  Did not work.  I also tried a while loop around the switch and case structure.  Did not work.

 

I thought my problem was that the switch was not being read fast enough.  That's why I put it inot an inner loop, thinking, "Ok, if the switch is read at the same speed as everything else in my timed loop, and it's not executing, perhaps it's not being read fast enough."  So I put it in an inner loop...

 

So how would I just implement a simple switch?  All I really want to do is just turn the sine wave on and off.  Maybe this switch isn't the way to go about it?

 

Thank you!

 

Nathan

0 Kudos
Message 3 of 5
(2,762 Views)

http://www.ni.com/white-paper/4087/en/#toc4


Learning LabVIEW since January 2013
0 Kudos
Message 4 of 5
(2,752 Views)

Coooool....  You guys are so awesome 🙂

 

Thanks a lot -

Nathan

0 Kudos
Message 5 of 5
(2,743 Views)