LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with nested while loop

HI
 
I was trying to use nested while loop to generate different signals each of one cycles and then to display them according to the selection. I am attaching the vi for reference. But first signal displays one cycle output well, while  the second one repeates the cycle generation. All that I wanted was to get one cycle only as I was getting out of the first nested while loop. Can anyone help me in this regard?
 
Rahul
0 Kudos
Message 1 of 4
(2,895 Views)
Rahul,

Try using Index Array rather than Array Subset. Also the inner while loops are not really necessary as they each execute only once per iteration of the outer loop. I have attached a modified version of your VI.

Lynn
0 Kudos
Message 2 of 4
(2,888 Views)

Dear Lynn

Thanks for your reply. But that's not what I wanted. My program also can generate the half triangle, but problem is because of the while loop the generation continues and so the cycle moves with time. I wanted a constant single cycle which will not move with time. Just like the first full cycle. As you may notice even though the first full cycle is also inside the while loop, it is not moving with time. But the second oen does. I wanted to generate only one static cycle, not a moving one.

Please let me know about it

Rahul

0 Kudos
Message 3 of 4
(2,870 Views)

Rahul,

Your problem has nothing to do with nested while loops. In fact you can delete the two inner while loops without any change in functionality. You might also want to add a small wait statement inside the main loop.

If you don't want to have a continuous generation in the lower part, wire a TRUE to the "reset signal" input.

To select one of the two signals to display, use a case structure instead of all that merging, converting, and slicing. 🙂 (see image).

Message Edited by altenbach on 01-16-2006 01:22 PM

0 Kudos
Message 4 of 4
(2,848 Views)