LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic Multitasking

I know this is pretty basic, but I just can't remember how.....

 

I have two programs, that need to run independently.  Program A does a bunch of serial I/O and displays status on its front panel.  It sends data via Global variables (I know...) to/from Program B.  Program B does a lot of manipulation of the data and sends it back to Program A, again with global variables.

 

When I start Program B, it calls Program A and both start and run fine as long as Program B stays on the main screen.  If program B calls a subvi, then Program A no longer response to controls on its front panel.  All of the indicators on Program A (data) are still fine.

 

What is it about basic program control that I have forgotten.

 

Muddled in Munich,

Steve

0 Kudos
Message 1 of 10
(3,730 Views)

Hi Steve,

 

What is it about basic program control that I have forgotten.

You forgot to attach your VIs A and B. Or atleast some exampe VIs to demonstrate the problem…

 

Program A no longer response to controls on its front panel

VI "A" no longer reads its control values?

Best regards,
GerdW


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

You are right.  I did not include them because they are massive.  And unexecutable without the I/O attached.  Is there some other way to illustrate?  Photo?  Movie?

 

Befuddled in Bavaria,

S

0 Kudos
Message 3 of 10
(3,723 Views)

Hi Steve,

 

I did not include them because they are massive.

Being "massive" usually is a bad sign when discussing execution problems.

 

What about some example VIs showing the same problem?

(Sometimes you will find the problem when you try to replicate it…)

 

Grüße nach München!

Best regards,
GerdW


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

The examples attached do exactly what my programs are doing.  Program B starts Program A.  When Program B calls a subvi, SubVI C.  Then my program, the discrete controls (custom) cannot be clicked.  In the example attached it all works fine.

 

Frustrated in Friesing

Download All
0 Kudos
Message 5 of 10
(3,699 Views)

It would have been easier if you named it so Program A called Program B which called subVI C.  Smiley Frustrated

 

You should off small waits in each of your loops.  I just heard my laptop fan go crazy because of all those CPU burning loops.

 

What you are forgetting is that the loop in program B can't go onto its next iteration until everything inside that loop is done executing.  Well the True case of the case structure is not done because the code inside of it is not done.  The code inside, SubVI C is not done because you have a loop inside of it that won't stop running until you hit the stop button in it.

 

Basic rules of DATAFLOW.

0 Kudos
Message 6 of 10
(3,691 Views)

Yes, I should have put the waits in there, but I was in a hurry.  

 

I think that I understand you last paragraph, but my issue is that the sample works and my programs do not.  And they have all of the waits in them.  I even put an indicator on the i (iterative no.) of the while loops and can see them all running.  But program A is still ignoring its controls.

 

Any other ideas?

0 Kudos
Message 7 of 10
(3,681 Views)

Do you have any event structures?  And do they have event cases with the flag set  to lock the front panel until the event completes?

 

What is different about your real program as compared to the sample program that the sample works but the real one doesn't?

0 Kudos
Message 8 of 10
(3,674 Views)

I found it.  My subvi's are modal, because I don't want the operator to skip screens.  The example that I sent you all of the samples were default.  I my programs when I was in a modal subvi, then it locked everything else up.  If I put the Program A as modal, it now locks up Program B so I cant even call the subvi.  At least I can see what is going on.  Going to go read the tutorials WINDOWS BEHAVIOR now.

 

Thanks,

S

0 Kudos
Message 9 of 10
(3,666 Views)

I'm glad you found it.

0 Kudos
Message 10 of 10
(3,664 Views)