Program Examples:Create Motion:Torque Mode

From SoftMC-Wiki
Revision as of 08:56, 6 November 2014 by Nigeller (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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