LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

nested for loop

Solved!
Go to solution

I have XY translation stage with two different controllers.

the execution timing of these two controllers are different.

I have attached block digram for understand. In highlight mode, code works fine ... but in execution mode, Y stage gets delayed a bit and moves along with X stage.

How can i ensure movement of stages one after another.

Thanks  

Download All
0 Kudos
Message 1 of 8
(3,051 Views)

Put the VIs for the two controllers in parallel loops if you want them to run independently. If you always want X to run after Y, move the X loop outside the Y loop but feed numeric 2 through the Y loop to create a data dependency.

 

Lynn

0 Kudos
Message 2 of 8
(3,038 Views)

it would be helpful to post your VI....also,

Example_VI_BD.png

0 Kudos
Message 3 of 8
(3,032 Views)

I want to Run XY stage in this fashion.

 

X X X X X X X X X Y X X X X X X X X X Y X X X X X X X X X Y X X X X X X X X X Y X X X X X X X X X

 

Physical move should finish before next move command.

 

0 Kudos
Message 4 of 8
(3,031 Views)

Thanks apok,

but my vi have subvi's and they send command to DLL. Thats why i posted a picture. 

0 Kudos
Message 5 of 8
(3,029 Views)
Solution
Accepted by rajxabc

A simple data dependency should create the pattern you want.

 

Lynn

 

YXXXXX.png

Message 6 of 8
(3,023 Views)

Thank you Lynn

0 Kudos
Message 7 of 8
(2,998 Views)

As a tip, you can add some code inside the X for loop to determine if X should increase or decrease.  The code posted here will have X move back to it's starting position each time Y is moved.  Depending on your system and overall scan time, this could add a lot of unecessary movement.

 

Essentially, once X reaches its max, you move y, then X could sweep from max to min (you can reverse the data arrays afterwards so your results are stored in a consistent manner).  This way, you cut the overall time for moving X in half.  Again, this may or may not be useful for your application.

 

 

Message 8 of 8
(2,979 Views)