LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a SubVI with while loop from another VI

I don't have LV8.6 installed, so I could not look at the code.  Is there a stop button for the sub-vi? 😮

 

And it (the sub-vi) is called from within a sub-vi?  😮 

 

Can you describe the behavior you were trying to code?  Without seeing the sub-vi (and main-vi), it sounds like you are trying to control the sub-vi from the main vi, and that the main vi runs until you quit the application.  As I explained earlier, you may want to consider an Event Structure to call (start), control and stop the sub-vi.  The events affecting the sub-vi can be communicated to it using queues, notifiers, ActionEngines, references... 

 

Did you want it (sub-vi) to be the active screen and the operator interface until you click stop.  It is a novice (beginner) way of programming and does not allow suitable application control from the main vi while the sub-vi is running.  Thus, not a proper to write code.

 

(all this to say that again I agree with Dennis)

 

R

0 Kudos
Message 11 of 18
(2,146 Views)

i wanted to simplify my problem but i might simplified it too much ,

i solved the problem thanks to GOD , and simply by implementing a parallel loops in the same VI , this was a project that calculates the Speed of a car after acquiring the signal from the Speedometer sensor.

i wanted to make a loop that handles the timing measurements , like total testing time , drive time and stop time 

using the producer/consumer i made it 

 

Thanks alot to Dennis and Ray

 Regards..

Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
0 Kudos
Message 12 of 18
(2,117 Views)

hi,

 

Mr. Mohammed Ashraf  i need your help.... i'm doing a project which is similar to ur project.... while doing normal program i was completed my project..... but suddenly my head told me to create very module to be in subvi... so i my program into three module Subvi (Learning the signal and saving in file, Comparing with the real time signal with save data, report generation) but now i was struck in the first module Subvi itself....

 

Pls can u help me to finish this....

 

 

 

Regards,
N. Srinivasan
0 Kudos
Message 13 of 18
(2,034 Views)

hi,

 

    Here i attached my module Main program vi with subvi....  In the main program vi u have to the numeric value in which the for loop wil run... then u have to the signal from the enum controller with corresponds to the signal your are selected the output show in the Main program vi... pls help me....  I'm waiting for your reply...

 

note:  i have attached just the example(method) of my project...

 

Regards,
N. Srinivasan
Download All
0 Kudos
Message 14 of 18
(2,032 Views)
srinivasan insisted on continuing this duplicate post here...
Message Edited by GerdW on 10-16-2009 09:40 AM
Best regards,
GerdW


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

Smiley Happyi got the answer... here i attached my file.... i use Control refnum.. in the main_prg.vi and subvi. 🙂

 

 

because i want to learn more in labview ... i was post my question in 2 threads.. im sorry for that... after two days i was completed my first module... thank you u guide and then if i have further i'l contact u later...

 Smiley Happy

Regards,
N. Srinivasan
Download All
0 Kudos
Message 16 of 18
(1,993 Views)

Hi srinivasan,

 

"i was post my question in 2 threads.. im sorry for that... "

No need to post your solution again in two threads - I already made a crosspost link to your other thread!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 18
(1,990 Views)

To Mr. Ashraf

 

Trying Using parallel while loops in flat sequences in the same VI. placing the main VI in one window and the Sub Vi in the other. U need not complicate things by messing with while loop in a SUb VI controllable from the main VI. Its good that uve already solved the problem.

 

Have a good time.

Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
0 Kudos
Message 18 of 18
(1,967 Views)