Rockwell Automation 2098-IPD-xxx Ultra5000 C Programming using the Motion Library User Manual
Page 4
![background image](/manuals/580132/4/background.png)
Publication 2098-PM001E-EN-P — July 2002
ii Table of Contents
Statements and Blocks . . . . . . . . . . . . . . . . . . . . . . . . . 1-23
Example 8 - Grouping Statements. . . . . . . . . . . . . . . . . 1-23
If-Else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24
Else-If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24
Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-26
While, For and Do-While Loops . . . . . . . . . . . . . . . . . . 1-26
Break and Continue . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27
Referencing the Motion Library
Control Setting Functions. . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Axis Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
long AxisDefinePos(long position); . . . . . . . . . . . . . . . . . . . . . 2-4
float AxisGetCommandCur(void); . . . . . . . . . . . . . . . . . . . . . . . 2-4
long AxisGetCommandPos(void);. . . . . . . . . . . . . . . . . . . . . . . 2-4
float AxisGetCommandVel(void); . . . . . . . . . . . . . . . . . . . . . . . 2-4
long AxisGetFeedbackOffset(void); . . . . . . . . . . . . . . . . . . . . . 2-4
long AxisGetFeedbackPos(void); . . . . . . . . . . . . . . . . . . . . . . . 2-4
float AxisGetFeedbackVel(void); . . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetFGain(void);. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetIGain(void); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetKff(void); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetKp(void); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetLowerCurLimit(void); . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetPGain(void); . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
long AxisGetPosError(void);. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetUpperCurLimit(void); . . . . . . . . . . . . . . . . . . . . . . 2-5
float AxisGetVelError(void); . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetFeedbackOffset(long offset); . . . . . . . . . . . . . . . . . 2-6
long AxisSetFGain(float fgain); . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetIGain(float igain); . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetKff(float kff);. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetKp(float kp); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetLowerCurLimit(float limit); . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetPGain(float pgain); . . . . . . . . . . . . . . . . . . . . . . . . 2-6
long AxisSetUpperCurLimit(float limit);. . . . . . . . . . . . . . . . . . . 2-7
Axis Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Axis Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9