LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One button with 3 or more cases

where should I connect the conditional terminal in the while loop?

0 Kudos
Message 11 of 19
(1,592 Views)

You'll need a STOP button that will stop the VI completely.

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 12 of 19
(1,587 Views)

I couldn't make the tunneling into a last value tunnel. Why is that?

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

I removed the quotient-remainder function because when we set the constant to 3 and the elements are incremented (so we have 1,2,3,4), the resulting remainder would be 1,2,0,1 - which only shows the sine and square waveforms.

 

So here's what I did. blockd.png

The only problem is the looping in which, after I click the boolean button 4 times, I would have to click it once more so that the loop would repeat again. This would be satisfactory if I run the VI continuously.

 

But anyway, thank you for the ideas. I wouldn't be able to generate this program without your guidance ^_^ although I know there are still some flaws.

0 Kudos
Message 14 of 19
(1,547 Views)

Hi geneclaude,

 


I removed the quotient-remainder function because when we set the constant to 3 and the elements are incremented (so we have 1,2,3,4), the resulting remainder would be 1,2,0,1 - which only shows the sine and square waveforms.


So why don't you set the quotient to 4 when you need the values 0,1,2,3 as remainder? Quite simple math…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 19
(1,535 Views)

the low down and dirty....ex. waveforms remainders: (sine#0,cosine#1,sawtooth#2,square wave#3), sorry about added cosine?  Smiley Surprised

 

* edited....

dirty.png

like gerd had said...."So why don't you set the quotient to 4 when you need the values 0,1,2,3 as remainder? Quite simple math…"   Smiley Wink

 

0 Kudos
Message 16 of 19
(1,533 Views)

@GerdW wrote:

Hi geneclaude,

 


I removed the quotient-remainder function because when we set the constant to 3 and the elements are incremented (so we have 1,2,3,4), the resulting remainder would be 1,2,0,1 - which only shows the sine and square waveforms.


So why don't you set the quotient to 4 when you need the values 0,1,2,3 as remainder? Quite simple math…

 


Or, as I originally suggested DO NOT use a constant.  Create a property node for the Waveforms control read Number of items.

 

Now when you add or remove items the modulo math doesn't breakSmiley Wink

Capture.PNG

 


"Should be" isn't "Is" -Jay
Message 17 of 19
(1,495 Views)

@JÞB wrote:

@GerdW wrote:

Hi geneclaude,

 


I removed the quotient-remainder function because when we set the constant to 3 and the elements are incremented (so we have 1,2,3,4), the resulting remainder would be 1,2,0,1 - which only shows the sine and square waveforms.


So why don't you set the quotient to 4 when you need the values 0,1,2,3 as remainder? Quite simple math…

 


Or, as I originally suggested DO NOT use a constant.  Create a property node for the Waveforms control read Number of items.

 

Now when you add or remove items the modulo math doesn't breakSmiley Wink

Capture.PNG

 


aaaaaaah, that is what you meant.....maintainable? or scalable? I get confused which term....   Smiley Tongue

Message 18 of 19
(1,491 Views)

  maintainable? or scalable? I get confused which term....

 

There is enough interaction between the two that deliniation is usually not necessary.  Maintainable code is scaleable and vice versa.

 

For instance:  If you stick that code in a proper design pattern (and what you have is close[ish) the code practically reads itself and changes are easy.

Tease VIA snip:  Vi attached

Capture.PNG


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