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

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "The following example demonstrates how to issue a TORQUE command to two axes in Torque Mode, using a TORQUE Command.<br/> Please notice the invocation of t...")
 
Line 50: Line 50:
 
* [[MC-Basic:TORQUE|TORQUE Command]]
 
* [[MC-Basic:TORQUE|TORQUE 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:Velocity Mode|Velocity Mode - motion example]]

Revision as of 15:27, 6 November 2014

The following example demonstrates how to issue a TORQUE command to two axes in Torque Mode, using a TORQUE Command.
Please notice the invocation of the subroutine EC_SET_MOTION_OPMODE that sets the axis and the drive to 'Torque 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, TORQUEMODE)
	call EC_SET_MOTION_OPMODE(a5, TORQUEMODE)

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

		TORQUE a3 40 starttype=immediate abs = 1
		TORQUE a5 -40 starttype=immediate abs = 1
		
		sleep 3000

		TORQUE a3 0 starttype=immediate abs = 1
		TORQUE a5 0 starttype=immediate abs = 1
		
		sleep 3000
		
	end while

	detach a3
	detach a5
	
end program


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


See Also