01-01-2020 05:02 AM
hello everyone and happy new year.
I have a LabView program that can control the movement of a stage. Adding on this, i have another program to control the rotational step of a quarter wave plate. They both comunicate with a spectrometer, but separately. Mi goal is to create a connection between the two LabView codes, but i don't know how i can do (i have never did a program in LV). Let's say S the spectrometer, Q the LabView program to control the QWP and M the ones that controls the stage's movement, my actual situation is : M does a step -> sends a trigger to S -> S does a measure -> sends a trigger to M -> M does a step; and, SEPARATELY (is another LV code and program): Q does a rotation-> Q sends a trigger to S -> S does a measure -> S sends a trigger to Q -> Q does a rotation. My goal will be
M does a step -> sends a trigger to Q -> Q does a rotation -> Q sends a trigger to S -> S does a measure -> S sends a trigger to Q -> Q does a rotation -> Q sends a trigger to S -> S does a measure -> S sends a trigger to Q (x 181 times)-> ....-> S sends the last trigger to Q -> Q stops mapping and returns to the starting position -> Q sends a trigger to M -> M does a step -> and everything will be repeated.
How can i do? Just changing the BNC connection or i have to change the code? If this is true, how can i do?
Thank you very much for the answer
Solved! Go to Solution.
01-01-2020 06:04 PM
Hi Masterly,
You didn't attach either of your VIs, so it's a little more difficult to give good tips.
That being said, what you're describing is essentially programmed using a pair of nested For loops - probably you'll need your code from Q to be inside the inner loop, and the stepping part of M to be in the outer loop (before or after the inner loop, depending on your initial condition. I'd guess before would work best...).
You won't need M to trigger S, if you're actually only measuring after rotations.
Instead, just ensure that M completes the step before you start Q0 in the inner For loop. A blocking move is what you need here (i.e. a VI that moves the stage, but doesn't finish the VI until the stage has finished moving). You might need the "trigger" or pulse from M to determine when this is true if you can't get a blocking move (because then you can have a VI that checks for the pulse and doesn't return until it finishes).
For more detailed/direct help, please attempt what I've described then attach your new (semi-combined) VI and we can go forward from there.
If you have questions, you can of course ask those first! 🙂