Homing With Latch Functions; Example 6 - A Homing Program; Non-Volatile Storage - Allen-Bradley Ultra5000 Programming Manual

C programming using the motion library
Hide thumbs Also See for Ultra5000:
Table of Contents

Advertisement

1-16
Programming Motion Control in C
Homing with Latch
Functions

Non-Volatile Storage

Publication 2098-PM001E-EN-P — July 2002
Latch functions are used to capture axis position when certain events
occur. The following example shows their use in a simple homing
routine.

Example 6 - A Homing Program

This program simulates a simple homing routine while demonstrating
the use of Latch functions.
#include <motion.h>
#define HOME_OFFSET 250
#define HOME_VEL 5000.0
#define HOME_ACC 160000.0
#define HOME_DEC 160000.0
int main(void)
{
InitMotionLibrary();
AxisEnable();
JogSetVel(HOME_VEL);
JogSetAcc(HOME_ACC);
JogSetDec(HOME_DEC);
JogForward();
LatchOnIndex(1,1,TRUE);
while (!LatchTriggered(1)) { }
JogStop();
while (JogInProgress()) { }
MoveSetVel(HOME_VEL);
MoveSetAcc(HOME_ACC);
MoveSetDec(HOME_DEC);
MoveAbsolute(LatchGetOutput(1)+HOME_OFFSET);
while (MoveInProgress()) { }
AxisDefinePos(0);
return 0;
}
Global variables are handled through arrays created in Ultraware and
stored in the Ultra5000 non-volatile memory. Refer to the Ultraware
User Manual (2098-UM001F-EN-P) for information on creating
non-volatile arrays.
There are two types of arrays that can be created in Ultraware: those
containing long integer values and those containing floating-point
values. You may create as many arrays as you have space for in the

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents