LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call a sub vi with a while loop in it

hi..

i have a code vi in which, there are cuple of ring controls and indicators...
which are inter dependent based on selector values,and i used shift registers in while
loop to see if the index of the ring controls are changed....

now i woould like to this vi as a sub vi....where i am not able to get, control once the vi is called...if i replace a for loop instead
of while loop ,the program behaves randomly......

can anybody suggest me how do i call a sub vi aith a while loop in it.

rags
0 Kudos
Message 1 of 6
(2,527 Views)
Hello,


If your SubVI inputs are references then any modification of their value into the MainVI is reflected into your subVI.
From what you said about randomly behaviour it looks like you have an initialisation problem. Shift register must be initialised otherwise it behaves like a memmory.
If this eplenations aren't usefull attached a simplified example and we can modify it, and maybe could offer you more solutions.
0 Kudos
Message 2 of 6
(2,517 Views)
Hi!
Try this. if this will not work send me snapshot of your code, i will give you solution.

Jenilia D'souza
Canberra
Australia
Jenilia D'souza
0 Kudos
Message 3 of 6
(2,510 Views)
Hey,
Why dont you put a snap shot of your problem,that will give us a better idea of what is your problem.
cheers
vicky
0 Kudos
Message 4 of 6
(2,503 Views)
hi

i have attcahed the the zip .vi.

there are 2 ring controls....where in the values can be selected source res/source res2.

the other 2 ring controls are indicators c current/c range.
based on the selection there are 2 numeric indicators hidden and the
range limit are set to the numeric controls clamp hi and clamp lo and a stop button
to contol the loop.

since changes are based on the ring controls, i am using shift registers
to monitor the changes.

if i want make this parth.vi as a sub vi and call it....due to while loop
i am facinga problem...other than creating a global variable for
stop button...can you thnk of any avenues.

rags
0 Kudos
Message 5 of 6
(2,476 Views)
hi

i have attcahed the the zip .vi.

there are 2 ring controls....where in the values can be selected source res/source res2.

the other 2 ring controls are indicators c current/c range.
based on the selection there are 2 numeric indicators hidden and the
range limit are set to the numeric controls clamp hi and clamp lo and a stop button
to contol the loop.

since changes are based on the ring controls, i am using shift registers
to monitor the changes.

if i want make this parth.vi as a sub vi and call it....due to while loop
i am facinga problem...other than creating a global variable for
stop button...can you thnk of any avenues.

rags
0 Kudos
Message 6 of 6
(2,474 Views)