LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two separate loops to run simultaneously

Dear Friends ,

I haven solved a my problem .

The problem is i have two loops #

1. To run the motor front and back in sequence structure.

2. To measure the motor revolution continously in while loop.

 

I couldn merge it together to get a continously monitoring of the motor measurements.

At once only one loop runs ...

 

I have saved separately & run it same time it works fine.

Can someone suggest or solve the problem?

Boldness has genius, power and magic in it!'
Download All
0 Kudos
Message 1 of 12
(4,338 Views)

Can you share the code with both loops in it?

 

My guess is that you created a data dependency between the loops with a wire.  This would make it so one loop must complete before the other can run.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(4,317 Views)

Thanks for the reply dude i couldn attach the VI .

dono wats wrong

Boldness has genius, power and magic in it!'
0 Kudos
Message 3 of 12
(4,310 Views)

 

 

You cannot pass data between parallel loops with a wire, you can use for example local variables to pass data within a single VI

 

 

0 Kudos
Message 4 of 12
(4,260 Views)

You are likely restricting dataflow by wiring the two structures together in an attempt to pass data, or are somehow misusing the sequence structure to restrict parallelism.

 

Could you post your attempt at putting them both in a single VI?  That way we can more easily identify your issue.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 5 of 12
(4,238 Views)

@MaveenD wrote:

Thanks for the reply dude i couldn attach the VI .

dono wats wrong


Try zipping the VI and posting the zip.  If that doesn't work, change the file extension to txt and post that with the note to change the extension back.  There still seems to be a bug for some people not being able to attach certain types of files.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 12
(4,229 Views)

Thanks Dude but i couldn try it .

I dono wat d heck happen?

I couldn attach the VI .

Here is VI

Boldness has genius, power and magic in it!'
0 Kudos
Message 7 of 12
(4,215 Views)
You only have 1 loop. The sequence structure only executes once of course. If you want it to loop, then use a loop. Get rid of the sequence.
0 Kudos
Message 8 of 12
(4,203 Views)

You shouldn't have the huge loop with everything inside of it.  What is happening is that the large loop can't iterate until everything inside is complete.  Your smaller while loop is running intil you press the stop button, which stops the large loop.  You should move your smaller while loop outside of the large loop.  I would recommend having all of your DAQ in a loop and all of your serial communication in another loop.  There's also no need to reinitialize and close your serial port.  Open it once before your loop and close it once after the loop.  You can then write and read it as much as you want inside of the loop.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(4,196 Views)

thanks cross

Boldness has genius, power and magic in it!'
0 Kudos
Message 10 of 12
(4,182 Views)