scott.eichhornetrema.com Posted July 27, 2010 Posted July 27, 2010 I am writing a custom servo algorithm for a lathe cutting tool and need to read the position of another motor (a spindle) for use in my feedback calculations. What is the best way to access the spindle position data within the usrcode.c function I'm writing? Thanks, Scott
curtwilson Posted July 28, 2010 Posted July 28, 2010 You have several methods, which fall into the categories of "absolute" and "relative" specification of the motor. If you want "absolute" specification of the motor (say, Motor 7 regardless of which motor is executing the algorithm), the best way is probably just to access it the same way as you would in the script language, e.g.: Motor[7].ActPos If you want "relative" specification of the motor (say, the next higher numbered motor than the one executing the algorithm), you can use either something like: Mptr[1].ActPos or Mptr2 = Mptr + 1; Mptr2->ActPos... Curt
Recommended Posts