LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent Help! How can i execute in the same block diagram two separate labview codes each one with diferent execution timings?

Solved!
Go to solution

 

Dear All.

 

I have 2 application progrlams in the same block diagram. the intention is to use  the 2 programs at different excuting time for different application, and each have stop and start button ofcourse i will have master stop. But when i run the program, it only works one program at time , that is the 1st block which i make it active only , when i tried to make active the second block it will not work, only works when i stoped the1st one. So, this it to request ur hlep how can i solve my problem. here i have attached some of  my program.

 

 

Regards!

0 Kudos
Message 1 of 9
(3,005 Views)

Dear All ,

 

From my program what i need is to run both blocks at the same time or for different time durations and i can make ON/Off one of them any time i need to. operate.

 

Thanks 

0 Kudos
Message 2 of 9
(2,999 Views)

Just glancing at the block diagram, it appears the way this will work is once one of the inner two loops stops it can't be started again until the other loop stops.

 

It would require another iteration of your main outer loop and that can't happen until both inner loops stop. If loops are running inside of loops that prevents the outer loops from continuing to run if the inner loops are running.

 

What is it you are trying to do? There is probably a better way to implement this if you can describe what it is your'e trying to do.

 

Eric

0 Kudos
Message 3 of 9
(2,994 Views)
Solution
Accepted by topic author 6826PN

By the way, if you want two loops to run at the same time, just do this.

 

two loops.png

0 Kudos
Message 4 of 9
(2,991 Views)

Actually, you need a Not to reset your stop switch....

 

 

not.png

0 Kudos
Message 5 of 9
(2,988 Views)

Thank you veery much Egraham. I tired it like this and it is ok!

But i have one more Question. I have cDAQ with three Input modules , can i use those three modules in different three loops.

 

Thx.

0 Kudos
Message 6 of 9
(2,986 Views)

Usually you set up a task that has all the channels from all the modules configured. When a loop starts it reserves that task and the cDAQ can't be used by other loops unless you start and stop tasks.

 

You can have one loop acquire all the data and if you want certain channels to go to other loops you can use the producer/consumer design pattern. If you wanted a third loop you would add another queue and the third loop would dequeue that data. See attached.

 

Eric

0 Kudos
Message 7 of 9
(2,982 Views)

Hi,

 

What is the stop (looks like a house symbol) on the second loop?  I have never seen this and I can't find it anywhere.

 

Thanks

0 Kudos
Message 8 of 9
(2,964 Views)

Marty,

 

It's a local variable in Labview 2010.

 

Paul

0 Kudos
Message 9 of 9
(2,954 Views)