Rockwell-automation 2098-IPD-xxx Ultra5000 C Programming using the Mot Instrukcja Użytkownika Strona 1

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Ekwipunek 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 Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 114
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów

Podsumowanie treści

Strona 1 - Ultra5000

Ultra5000™ C Programming using the Motion LibraryProgramming Manual

Strona 2 - Important User Information

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

Strona 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

Strona 4 - Chapter 2

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

Strona 5 - Table of Contents iii

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

Strona 6

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

Strona 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

Strona 8 - Appendix A

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

Strona 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

Strona 10 - Conventions Used in this

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

Strona 11 - Allen-Bradley Support

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

Strona 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

Strona 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

Strona 14

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

Strona 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

Strona 19

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

Strona 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

Strona 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

Strona 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:#

Strona 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

Strona 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

Strona 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.

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 32 - (binary form)

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

Strona 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

Strona 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 /*

Strona 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 /*

Strona 36

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

Strona 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

Strona 38 - While, For and Do-While Loops

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

Strona 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

Strona 40

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

Strona 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

Strona 42 - Control Setting Functions

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 47

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

Strona 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

Strona 49 - Axis Status

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

Strona 50 - Control Attributes

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

Strona 51

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

Strona 52 - Control Services

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

Strona 53

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

Strona 54

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

Strona 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

Strona 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

Strona 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.

Strona 58 - Timer Status

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

Strona 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

Strona 60

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

Strona 61

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

Strona 62 - Cam Attributes

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

Strona 63 - Cam Services

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

Strona 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

Strona 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

Strona 66

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

Strona 67 - Harmonic Curve

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

Strona 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

Strona 69

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

Strona 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

Strona 71 - Modified Trapezoidal Curve

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

Strona 72

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

Strona 73

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

Strona 74

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

Strona 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

Strona 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

Strona 77 - Jog Attributes

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

Strona 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

Strona 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

Strona 80 - Move Attributes

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

Strona 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

Strona 82

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

Strona 83

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

Strona 84

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

Strona 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

Strona 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

Strona 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

Strona 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.

Strona 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

Strona 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,

Strona 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

Strona 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

Strona 93

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

Strona 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

Strona 95

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 102

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

Strona 103

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

Strona 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

Strona 105 - Index I-3

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

Strona 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

Strona 107 - Index I-5

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 112

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

Strona 113

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

Strona 114

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

Komentarze do niniejszej Instrukcji

Brak uwag