Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Control does not stay in case structure while using motion VIs

Hi,
 
I have a motion control card PCI 7344 connected to my PC. I am able to control the motor at the required speed till the required position using an encoder. Now I have put my motion control VIs in a case structure in such a way that, if Case1 is selected then the motor should to position P at speed S, if case 2 is selected then the motor should move to position Q at speed S and if case3 is selected then the motor should to position R at speed S. I am selecting cases 1,2,3 etc. by scanning a set of numbers seperated by spaces which look like this,
 
------------
1 2 5 7 3
------------ 
 
This number scanning is done using a while loop. Now, when the first number is scanned in the above set of numbers. The number 1 is obtained and the control is switched to case1. But before the motor reaches position P, the control switches to case2 and before completing the execution, the program scans case5 and so on. That means that the control does not stay till the move in the case 1 is completed. I'm sure there must be a way to retain the control to a case and stop the next number to be scanned before the functions in the particular are completely executed. I thought of one method, i.e. by using the move complete VI provided in LabVIEW, but I could not implement it. Please help me out with this.
 
Regards,
Giridhar Rajan
Automation Engineer,
Cruiser Controls,
Mumbai, India
0 Kudos
Message 1 of 4
(3,334 Views)
You must use a Move Complete VI.  What problems are you having implementing one?  Are you running open or closed loop?
0 Kudos
Message 2 of 4
(3,329 Views)

Hi,

Our motion controllers allow you to preemptively start a move in the middle of a current move.  For example if you are moving from point A to B and based on some logic, you determine you need to immediately start moving to point C.  A preemptive move allows you to just load the new target position and call start.  You do NOT have to first stop the current move and then start the new move.

In your case, you want the first move to complete before the second move starts.  There are two ways to handle this.  First, wait for the move to complete via a Wait For Move Complete function/VI call, or use the Check For Move Complete function/VI in a loop.  Second, use Blend Start instead of the regular start.  A Blend Start (if blend factor is set to 0) waits for the first move to complete before the second move starts. 

Check out the help topics for Start Motion and Blend Motion to learn more.

Thanks,

Rodger S.

Message 3 of 4
(3,324 Views)

Hi RodJ,

Thanks for your suggestion. I'm sure it should work. I'll try it and contact you if I face any problems. Keep in touch.

Bye

Regards,

Giridhar Rajan

Automation Engineer

Cruiser Controls,

Mumbai, India

0 Kudos
Message 4 of 4
(3,315 Views)