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...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
{{Languages|Program_Examples:Create_Motion:Velocity_Mode}}
 
The following example demonstrates how to jog an axis in Velocity Mode, using a [[MC-Basic:JOG|JOG Command]].<br/>
 
The following example demonstrates how to jog an axis in Velocity Mode, using a [[MC-Basic:JOG|JOG Command]].<br/>
 
Please notice the invocation of the subroutine [[EtherCAT:EC_SET_MOTION_OPMODE|EC_SET_MOTION_OPMODE]] that sets the axis and the drive to
 
Please notice the invocation of the subroutine [[EtherCAT:EC_SET_MOTION_OPMODE|EC_SET_MOTION_OPMODE]] that sets the axis and the drive to
Line 50: Line 51:
 
* [[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]]

Latest revision as of 05:48, 17 July 2017

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