Rockwell-automation 2098-IPD-xxx Ultra5000 C Programming using the Mot Manual de usuario

Busca en linea o descarga Manual de usuario para Equipo Rockwell-automation 2098-IPD-xxx Ultra5000 C Programming using the Mot. Rockwell Automation 2098-IPD-xxx Ultra5000 C Programming using the Motion Library User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 114
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente

Indice de contenidos

Pagina 1 - Ultra5000

Ultra5000™ C Programming using the Motion LibraryProgramming Manual

Pagina 2 - Important User Information

Publication 2098-PM001E-EN-P — July 2002P-2 PrefaceContents of this ManualThis manual contains the following sections:Related DocumentationThe followi

Pagina 3 - Table of Contents

Publication 2098-PM001E-EN-P — July 2002A-2 Updates to the Motion LIbraryUpdates to the Motion Library for Ultraware Release 1.2 New Library Functions

Pagina 4 - Chapter 2

Publication 2098-PM001E-EN-P — July 2002Updates to the Motion LIbrary A-3Modified library FunctionsLatchGetOutput(channel);In previous Ultraware versi

Pagina 5 - Table of Contents iii

Publication 2098-PM001E-EN-P — July 2002A-4 Updates to the Motion LIbrary

Pagina 6

Publication 2098-PM001E-EN-P — July 2002IndexAAllen-Bradley supportgeneral informationP-3IMC e-mail addresses, see back coverIMC fax numbers, see back

Pagina 7 - Table of Contents v

Publication 2098-PM001E-EN-P — July 2002 I-2 Indexdeclarations 1-19definition1-21, 1-21- (arithmetic operator)1-20-- (arithmetic operator) 1-2

Pagina 8 - Appendix A

Publication 2098-PM001E-EN-P — July 2002 Index I-3CamGetCycleCount 2-22CamGetCycleLimit 2-22CamGetFreeSegments 2-22CamHarmonic 2-27CamHarmonicCy

Pagina 9 - Who Should Use this

Publication 2098-PM001E-EN-P — July 2002 I-4 IndexProgramIsRunning 2-16ProgramKill 2-15ProgramRun 2-15ProgramStop 2-15RatchetGetVel 2-11Ratche

Pagina 10 - Conventions Used in this

Publication 2098-PM001E-EN-P — July 2002 Index I-5AxisGetPGain 2-5AxisGetPosError 2-5AxisGetUpperCurLimit 2-5AxisGetVelError 2-6AxisIsEnabled 2-

Pagina 11 - Allen-Bradley Support

Publication 2098-PM001E-EN-P — July 2002 I-6 IndexMoveAtSpeed 2-46MoveCloseBuffer 2-41MoveCorrect 2-41MoveCorrectAbs 2-42MoveCorrectInc 2-42Mo

Pagina 12 - P-4 Preface

Publication 2098-PM001E-EN-P — July 2002 Index I-7break 1-27build (command) 1-2conditional expressions 1-21constants 1-5continue 1-27control flo

Pagina 13 - Creating A Basic Motion

Publication 2098-PM001E-EN-P — July 2002Preface P-3Using Online HelpThe following types of online help are available:Allen-Bradley SupportAllen-Bradle

Pagina 14

Publication 2098-PM001E-EN-P — July 2002 I-8 IndexSerialPutChar 2-16SerialPutString 2-17SerialReceiverFull 2-17SerialTransmitterEmpty 2-17Slee

Pagina 18 - Example 2.1 Explained

Publication 2098-PM001E-EN-P — July 2002 0013-1085-005-01Supercedes Publication 2098-PM001D-EN-P – January 2002 © 2002 Rockwell Automation, Inc. All

Pagina 19

Publication 2098-PM001E-EN-P — July 2002P-4 Preface

Pagina 20 - Example 2.2 Explained

1 Publication 2098-PM001E-EN-P — July 2002Chapter 1Programming Motion Control in C IntroductionThe chapter introduces you to the C language and progra

Pagina 21 - #define name replacement_text

Publication 2098-PM001E-EN-P — July 20021-2 Programming Motion Control in CThe first short program you will write: • Moves the axis 1000 counts in the

Pagina 22 - Example 2.3 Explained

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-33. Open the source file and enter the following text with the text editor:#

Pagina 23 - User Defined Functions

Publication 2098-PM001E-EN-P — July 20021-4 Programming Motion Control in CExample 1 ExplainedAny C program, whatever its size, consists of functions

Pagina 24 - Example 3 Explained

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-5Variables, Loops, and Constants The next example is a motion program that m

Pagina 25 - Program Stop

Publication 2098-PM001E-EN-P — July 20021-6 Programming Motion Control in CExample 2.1 ExplainedThe program still consists of a single function main.

Pagina 26 - Example 4 - A Jog Program

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-7endpoint) the loop ends, and execution continues at the statement that foll

Pagina 27 - Example 5 - A Gear Program

Important User InformationBecause of the variety of uses for the products described in this publication, those responsible for the application and us

Pagina 28 - Non-Volatile Storage

Publication 2098-PM001E-EN-P — July 20021-8 Programming Motion Control in CExample 2.2 - Varying the Program using VariablesThere are many different w

Pagina 29 - Notice that in the line

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-9is executed, and the condition is re-evaluated. The loop terminates when th

Pagina 30 - Expressions

Publication 2098-PM001E-EN-P — July 20021-10 Programming Motion Control in CExample 2.3 - Another Variance of the Program using VariablesA third way t

Pagina 31 - Arithmetic Operators

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-11User Defined FunctionsA function provides a convenient way to encapsulate

Pagina 32 - (binary form)

Publication 2098-PM001E-EN-P — July 20021-12 Programming Motion Control in C{MoveSetAcc(accdec); /* Initialize index move*/MoveSetVel(velocity);MoveSe

Pagina 33 - Conditional Expressions

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-13The declarationlong insert(long distance, long velocity, long accdec);just

Pagina 34 - Operator Precedence

Publication 2098-PM001E-EN-P — July 20021-14 Programming Motion Control in CExample 4 - A Jog Program#include <motion.h>#define JOGREVERSE 7 /*

Pagina 35 - Control Flow

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-15Example 5 - A Gear Program#include <motion.h>#define ADCCHANNEL 1 /*

Pagina 36

Publication 2098-PM001E-EN-P — July 20021-16 Programming Motion Control in CHoming with Latch FunctionsLatch functions are used to capture axis positi

Pagina 37

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-17controller’s non-volatile memory but only one of each type may be accessed

Pagina 38 - While, For and Do-While Loops

i Publication 2098-PM001E-EN-P — July 2002Table of ContentsPrefaceIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 39 - Break and Continue

Publication 2098-PM001E-EN-P — July 20021-18 Programming Motion Control in CTypes, Operators, and ExpressionsThe C language allows you a great deal of

Pagina 40

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-19Two limitations that apply to variable names are: • Underscores (“_”) coun

Pagina 41 - #include <motion.h>

Publication 2098-PM001E-EN-P — July 20021-20 Programming Motion Control in Clists the precedence and describes the functions and any limitations place

Pagina 42 - Control Setting Functions

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-21Relational and Logical OperatorsThe relational operators (<, <=, >

Pagina 43

Publication 2098-PM001E-EN-P — July 20021-22 Programming Motion Control in CFor example, the following code yields the absolute value of a number. if

Pagina 44 - Axis Attributes

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-23Control FlowIn this section you will learn about the functions that contro

Pagina 45

Publication 2098-PM001E-EN-P — July 20021-24 Programming Motion Control in CIn grouping example A, the assignment statement is included in the while l

Pagina 46

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-25The last statement (else) performs the default or “none of the above” case

Pagina 47

Publication 2098-PM001E-EN-P — July 20021-26 Programming Motion Control in CSwitchThe switch statement performs a multiple path decision. It tests whe

Pagina 48 - Axis Services

Publication 2098-PM001E-EN-P — July 2002Programming Motion Control in C 1-27the update (expression3) is evaluated. The loop is repeated until test (ex

Pagina 49 - Axis Status

Publication 2098-PM001E-EN-P — July 2002 ii Table of ContentsStatements and Blocks . . . . . . . . . . . . . . . . . . . . . . . . . 1-23Example

Pagina 50 - Control Attributes

Publication 2098-PM001E-EN-P — July 20021-28 Programming Motion Control in C

Pagina 51

1 Publication 2098-PM001E-EN-P — July 2002Chapter 2Referencing the Motion LibraryThis chapter provides information on the functions available in the U

Pagina 52 - Control Services

Publication 2098-PM001E-EN-P — July 20022-2 Referencing the Motion LibraryControl Setting FunctionsControl Setting functions directly control aspects

Pagina 53

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-3Control Attributes• ControlGetFault• EncoderGetFaultState• EncoderGetOutput•

Pagina 54

Publication 2098-PM001E-EN-P — July 20022-4 Referencing the Motion LibraryAxis Attributeslong AxisDefinePos(long position);Sets the axis command posit

Pagina 55 - Program Services

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-5float AxisGetFeedbackVel(void);Returns the feedback velocity of the axis in

Pagina 56 - Serial Services

Publication 2098-PM001E-EN-P — July 20022-6 Referencing the Motion Libraryfloat AxisGetVelError(void);Returns the velocity error in counts/second. Not

Pagina 57 - Timer Services

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-7long AxisSetUpperCurLimit(float limit);Sets the upper current limit in Amps.

Pagina 58 - Timer Status

Publication 2098-PM001E-EN-P — July 20022-8 Referencing the Motion LibraryAxis Serviceslong AxisDisable(void);Disables the axis (amplifier). Returns 0

Pagina 59 - Motion Functions

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-9Axis Statuslong AxisIsEnabled(void);Determines if Axis is enabled. Note: Pri

Pagina 60

Publication 2098-PM001E-EN-P — July 2002Table of Contents iiiControl Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10lo

Pagina 61

Publication 2098-PM001E-EN-P — July 20022-10 Referencing the Motion LibraryControl Attributeslong ControlGetFault(void);Returns controller fault. Vali

Pagina 62 - Cam Attributes

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-11long EncoderGetFaultState(long channel);Returns state of fault checking for

Pagina 63 - Cam Services

Publication 2098-PM001E-EN-P — July 20022-12 Referencing the Motion LibraryControl Serviceslong ControlClearFault(void);Clears a controller fault. Ret

Pagina 64 - Cycloidal Curve

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-13long EncoderSetPolarity(long channel, long polarity);Sets the polarity of t

Pagina 65 - Cycloidal Harmonic Curve

Publication 2098-PM001E-EN-P — July 20022-14 Referencing the Motion Librarylong SequencerAddNode(long frame, void* fptr, void* dptr);Inserts a user fu

Pagina 66

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-15Program Serviceslong InitMotionLibrary(void);Initializes the motion library

Pagina 67 - Harmonic Curve

Publication 2098-PM001E-EN-P — July 20022-16 Referencing the Motion LibraryProgram Statuslong ProgramIsRunning(char* name);Determines if the specified

Pagina 68 - Harmonic Cycloidal Curve

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-17long SerialPutString(const char *string);Puts a character string into the A

Pagina 69

Publication 2098-PM001E-EN-P — July 20022-18 Referencing the Motion LibraryTimer Statuslong TimerDone(long channel);Returns non-zero if specified time

Pagina 70 - Modified Sinusoidal Curve

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-19Motion FunctionsMotion functions include all functions that cause or direct

Pagina 71 - Modified Trapezoidal Curve

Publication 2098-PM001E-EN-P — July 2002 iv Table of Contentslong CamCloseTable(void); . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23l

Pagina 72

Publication 2098-PM001E-EN-P — July 20022-20 Referencing the Motion LibraryGear Attributes• GearGetVel• GearSetRatio• GearSlewSetAcc• GearSlewSetDecGe

Pagina 73

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-21Move Attributes• MoveSetAcc• MoveSetDec• MoveSetPos• MoveSetVelGet and set

Pagina 74

Publication 2098-PM001E-EN-P — July 20022-22 Referencing the Motion LibraryCam Attributeslong CamGetCycleCount(void);Returns the cam cycle count.The c

Pagina 75 - Cam Status

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-23long CamSetCycleLimit(long limit);Sets the cam cycle limit. The cycle limit

Pagina 76 - Gear Services

Publication 2098-PM001E-EN-P — July 20022-24 Referencing the Motion Librarylong CamCycloidal(long master_position, long follower_position);Adds a cycl

Pagina 77 - Jog Attributes

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-25long CamCycloidalHarmonic(long master_position, long follower_position);Add

Pagina 78 - Jog Services

Publication 2098-PM001E-EN-P — July 20022-26 Referencing the Motion Librarylong CamDisable(void);Disables electronic cam. Returns 0 if successful, or

Pagina 79 - Jog Status

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-27long CamHarmonic(long master_position,long follower_position);Adds a harmon

Pagina 80 - Move Attributes

Publication 2098-PM001E-EN-P — July 20022-28 Referencing the Motion Librarylong CamHarmonicCycloidal(long master_position, long follower_position);Add

Pagina 81 - Move Services

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-29long CamLoad(char* name);Loads cam table number one. • The name argument sp

Pagina 82

Publication 2098-PM001E-EN-P — July 2002Table of Contents vlong GearInProgress(void); . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37

Pagina 83

Publication 2098-PM001E-EN-P — July 20022-30 Referencing the Motion Librarylong CamModifiedSinusoidal(long master_position,long follower_position);Add

Pagina 84

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-31long CamModifiedTrapezoidal(long master_position,long follower_position);Ad

Pagina 85

Publication 2098-PM001E-EN-P — July 20022-32 Referencing the Motion Librarylong CamOpenTable(long table_number,long size,long order);Opens the cam tab

Pagina 86 - Move Status

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-33long CamQueueReset(void);Resets the queue.Returns 0 if successful, or -1 if

Pagina 87 - Digital and Analog I/O

Publication 2098-PM001E-EN-P — July 20022-34 Referencing the Motion Librarylong CamSaveTable(long table_number,char *name);Saves a cam table.• The tab

Pagina 88 - Digital Input Status

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-35Cam Statuslong CamIsEnabled(void);Determines if electronic cam is enabled.

Pagina 89 - Digital Output Attributes

Publication 2098-PM001E-EN-P — July 20022-36 Referencing the Motion LibraryGear Attributesfloat GearGetVel(void);Returns the gear velocity in counts/s

Pagina 90 - Digital Output Services

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-37long GearSlewDisable(void);Disables gearing slew. Returns 0 if successful,

Pagina 91 - Digital Output Status

Publication 2098-PM001E-EN-P — July 20022-38 Referencing the Motion Librarylong JogSetDec(float dec);Sets the default deceleration for the jog. Decele

Pagina 92 - Latch Functions

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-39long JogStop(void);Stops the jog motion using the programmed deceleration v

Pagina 93

Publication 2098-PM001E-EN-P — July 2002 vi Table of ContentsAnalog Output Attributes . . . . . . . . . . . . . . . . . . . . . . . 2-48long Ana

Pagina 94 - Latch Services

Publication 2098-PM001E-EN-P — July 20022-40 Referencing the Motion Librarylong JogInProgress(void);Determines if a jog is in progress.Returns non-zer

Pagina 95

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-41Move Serviceslong MoveAbort(void);Halts motion immediately, ignoring decele

Pagina 96 - Latch Status

Publication 2098-PM001E-EN-P — July 20022-42 Referencing the Motion Librarylong MoveCorrectAbs(long position);Corrects a move to stop at a new target

Pagina 97 - Non-Volatile Array

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-43long MoveDV(long distance, float vel);The distance argument is the delta di

Pagina 98 - Non-Volatile Array Services

Publication 2098-PM001E-EN-P — July 20022-44 Referencing the Motion Librarylong MoveDwell(float time);The time argument specifies the time duration fo

Pagina 99 - New Library Functions

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-45long MovePosition(long position);Starts an absolute move to the specified p

Pagina 100 - Release 1.2

Publication 2098-PM001E-EN-P — July 20022-46 Referencing the Motion LibraryMove Statuslong MoveAtSpeed(void);Determines if a move is currently at the

Pagina 101 - Modified library Functions

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-47Digital and Analog I/O FunctionsDigital and Analog I/O functions control di

Pagina 102

Publication 2098-PM001E-EN-P — July 20022-48 Referencing the Motion LibraryAnalog Output Attributeslong AnalogOutputSetVoltage(long channel, float vol

Pagina 103

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-49long InputGetState(long channel);Returns the state of the digital input spe

Pagina 104 - I-2 Index

1 Publication 2098-PM001E-EN-P — July 2002PrefaceIntroductionRead this preface to familiarize yourself with this manual. This preface covers the follo

Pagina 105 - Index I-3

Publication 2098-PM001E-EN-P — July 20022-50 Referencing the Motion LibraryDigital Output Serviceslong OutputSetAllOff(void);Turns all digital outputs

Pagina 106 - I-4 Index

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-51Digital Output Statuslong OutputGetAll(void);Returns the state of all digit

Pagina 107 - Index I-5

Publication 2098-PM001E-EN-P — July 20022-52 Referencing the Motion LibraryLatch FunctionsLatch functions control registration events. The table prese

Pagina 108 - I-6 Index

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-53long LatchGetCount(long channel);Returns the value of the latch counter. Th

Pagina 109 - Index I-7

Publication 2098-PM001E-EN-P — July 20022-54 Referencing the Motion LibraryLatch Serviceslong LatchOnIndex(long channel, long encoder, long rising);Ar

Pagina 110 - I-8 Index

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-55long LatchOnInput(long channel, long input, long rising);Arms a latch to tr

Pagina 111

Publication 2098-PM001E-EN-P — July 20022-56 Referencing the Motion Librarylong LatchSetAutoMode(long channel, long mode);Sets the auto mode of a latc

Pagina 112

Publication 2098-PM001E-EN-P — July 2002Referencing the Motion Library 2-57Non-Volatile Array FunctionsNon-volatile array functions store numeric valu

Pagina 113

Publication 2098-PM001E-EN-P — July 20022-58 Referencing the Motion Librarylong LongArraySetElement(long element, long data);Stores data into a previo

Pagina 114

1 Publication 2098-PM001E-EN-P — July 2002Appendix AThis appendix summarizes the library functions added in various releases of the Ultraware software

Comentarios a estos manuales

Sin comentarios