Difference between revisions of "Program Examples:Create Motion:Position Mode"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "The following example demonstrates how to move an axis in Position Mode, using a MOVE Command.<br/> Please notice the invocation of the subroutine [[EtherCAT...")
 
Line 21: Line 21:
 
while 1
 
while 1
 
 
move a3 25 vcruise=100 starttype=immediate abs = 1
+
MOVE a3 25 vcruise=100 starttype=immediate abs = 1
move a5 -25 vcruise=100 starttype=immediate abs = 1
+
MOVE a5 -25 vcruise=100 starttype=immediate abs = 1
  
 
while a3.IsMoving <> 0
 
while a3.IsMoving <> 0
Line 32: Line 32:
 
end while
 
end while
  
move a3 0 vcruise=100 starttype=immediate abs = 1
+
MOVE a3 0 vcruise=100 starttype=immediate abs = 1
move a5 0 vcruise=100 starttype=immediate abs = 1
+
MOVE a5 0 vcruise=100 starttype=immediate abs = 1
 
 
 
while a3.IsMoving <> 0
 
while a3.IsMoving <> 0
Line 53: Line 53:
  
  
The example corresponds to commit SHA-1: 0013794b23d0976ecda4ac880eac706c4d3e34bb in GIT.
+
The example corresponds to commit SHA-1: ba574128b365aebcd34f706e4c3a2c90762f7636 in GIT.
  
  

Revision as of 08:54, 6 November 2014

The following example demonstrates how to move an axis in Position Mode, using a MOVE Command.
Please notice the invocation of the subroutine EC_SET_MOTION_OPMODE that sets the axis and the drive to 'Position Mode'.
Refer to Axis Setup Procedure for an explanation and an example of how to set up an axis.

program

	attach a3
	attach a5

	call EC_SET_MOTION_OPMODE(a3, POSITIONMODE)
	call EC_SET_MOTION_OPMODE(a5, POSITIONMODE)

	a3.en=1
	a5.en=1
	
	sleep 1000
	
	while 1
	
		MOVE a3 25 vcruise=100 starttype=immediate abs = 1
		MOVE a5 -25 vcruise=100 starttype=immediate abs = 1

		while a3.IsMoving <> 0
			sleep 1000
		end while

		while a5.IsMoving <> 0
			sleep 1000
		end while

		MOVE a3 0 vcruise=100 starttype=immediate abs = 1
		MOVE a5 0 vcruise=100 starttype=immediate abs = 1
		
		while a3.IsMoving <> 0
			sleep 1000
		end while

		while a5.IsMoving <> 0
			sleep 1000
		end while
		
	end while

	detach a3
	detach a5
	
end program


The example corresponds to commit SHA-1: ba574128b365aebcd34f706e4c3a2c90762f7636 in GIT.


See Also