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

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "The following example demonstrates how to jog an axis in Velocity Mode, using a JOG Command.<br/> Please notice the invocation of the subroutine [[EtherCAT:EC...")
 
Line 50: Line 50:
 
* [[MC-Basic:JOG|JOG Command]]
 
* [[MC-Basic:JOG|JOG Command]]
 
* [[EtherCAT:EC_SET_MOTION_OPMODE|EC_SET_MOTION_OPMODE]]
 
* [[EtherCAT:EC_SET_MOTION_OPMODE|EC_SET_MOTION_OPMODE]]
 +
* [[Program Examples:Create Motion:Position Mode|Position Mode - motion example]]
 +
* [[Program Examples:Create Motion:Torque Mode|Torque Mode - motion example]]

Revision as of 15:27, 6 November 2014

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