Rockwell-automation 2098-IPD-xxx Ultra5000 C Programming using the Mot Manuel d'utilisateur Page 28

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 114
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 27
Publication 2098-PM001E-EN-P — July 2002
1-16 Programming Motion Control in C
Homing with Latch
Functions
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;
}
Non-Volatile Storage
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
Vue de la page 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 113 114

Commentaires sur ces manuels

Pas de commentaire