Program Examples:Create Motion:Velocity Mode

From SoftMC-Wiki
Jump to: navigation, search
Language: English  • 中文(简体)‎

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

program

	attach a4
	attach a5

	call EC_SET_MOTION_OPMODE(a4, VELOCITYMODE)
	call EC_SET_MOTION_OPMODE(a5, VELOCITYMODE)

	a4.en=1
	a5.en=1
	
	sleep 1000
	
	while 1

		JOG a4 50 starttype=immediate
		JOG a5 -50 starttype=immediate
		
		sleep 3000

		JOG a4 -50 starttype=immediate
		JOG a5 50 starttype=immediate
		
		sleep 3000
		
	end while

	detach a4
	detach a5
	
end program


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


See Also