LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Created a waveform, but I don't know how to repeat the waveform.

As my VI, I wanna creat a specific waveform for testing. But when the first loop ran out, the looping is stop.

 

How can I make it continuously operate? It is urgent, Thanks for your help!

 

and one more question is how can I combine this signal VI to my main VI ?

 

the signal output connect to the Select Signal 3. But seems it can not communicate between two while loop for passing the data.

Download All
0 Kudos
Message 1 of 4
(4,054 Views)

Hi rednight,

 

the MainVI stops when you press the Stop2 button. Don't press that button to make it iterate more often…

 

Your subVI is very convoluted and will get a honorable mention in the RubeGoldberg thread. Maybe even in the "Why locals are bad" thread too…

 

- Don't abuse local variables: use wires instead! Please clean up your "signal" VI in that fashion.

- Afterwards rethink your logic. Why do you do the same operation 9 times in your VI? Why not use a loop instead?

- To integrate that VI as subVI in your MainVI you should remove it's while loop - or atleast make it run just once per call. Having a separate stop button in a subVI is (most-often) a NO-GO!

 

Btw. are you in the same team as Adithya working on a very related topic?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(4,026 Views)

Hi GerdW,

 

Thanks for your reply.....

 

-As I am newbi in Labview, would you tell me why local variable is bad? ( But I will modify it )

-Cause I design a signal which is for the 3Phase PWM inverter testing and is combined by 9 different frequencies sinewave.

 So you recommend me use loop to instead my convoluted logic?

- If I would like to use my main VI to select the sub VI to run continuously until I press stop button is it work?

 

-No SIr, It is my individual work

 

Have a nice friday.

 

Jason Li

0 Kudos
Message 3 of 4
(3,998 Views)

Hi Jason,

 

when you're a newbie (which isn't bad at all) you should go through all those free online courses offered by NI on their website.

 

- When you want to know why locals are considered "bad" you should read the thread I linked to.

- I recommend to use loops instead of working with each array element on it's own and I even more recommend to to the math directly on that array instead of splitting it into elements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(3,993 Views)