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

  • 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 25
Publication 2098-PM001E-EN-P — July 2002
1-14 Programming Motion Control in C
Example 4 - A Jog Program
#include <motion.h>
#define JOGREVERSE 7 /* Input 7 */
#define JOGFORWARD 8 /* Input 8 */
#define ACCDEC 10000 /* counts/second**2 */
#define JOGVEL 20000 /* counts/second */
#define STOPPED 0 /* Jog modes */
#define FORWARD 1
#define REVERSE 2
/* This program uses inputs 7 and 8 to Jog the axis in the
reverse and forward direction, respectively. It will
continue to run until a Stop or Kill command is issued from
Ultraware. */
int main (void)
{
long Jogging;
InitMotionLibrary();
AxisEnable();
JogSetAcc(ACCDEC);
JogSetVel(JOGVEL);
JogSetDec(ACCDEC);
while (!StopRequested())
{
Jogging = JogGetMode();
if (!JogInProgress()) {
if (InputGetState(JOGREVERSE) == ON)
JogReverse();
else if (InputGetState(JOGFORWARD) == ON)
JogForward();
}
else if (((InputGetState(JOGREVERSE) == OFF) &&
(Jogging == REVERSE)) ||
((InputGetState(JOGFORWARD) == OFF) &&
(Jogging == FORWARD)))
JogStop();
}
AxisDisable();
return 0;
}
Vue de la page 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 113 114

Commentaires sur ces manuels

Pas de commentaire