DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Mathematical Features November.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Advertisements

INSTRUCTION SET ARCHITECTURES
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Characters and Strings.
JavaScript Part for Repetition Statement for statement Cpecifies each of the items needed for counter-controlled repetition with a control variable.
Chapter 10.
Chapter 8 Characters and Strings Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
COMPSCI 125 Spring 2005 ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3: Numeric Data *Variables *Numeric data.
Chapter 9 Formatted Input/Output Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
Chapter 3 Numerical Data. Topics Variables Numeric data types Assignment Expressions.
Data types and variables
Chapter 2 Data Types, Declarations, and Displays
JavaScript, Third Edition
 2007 Pearson Education, Inc. All rights reserved C Characters and Strings.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
Computer Science 121 Scientific Computing Winter 2014 Chapter 3 Simple Types: Numbers, Text, Booleans.
Expressions and Interactivity Chapter 3. 2 The cin Object Standard input object Like cout, requires iostream file Used to read input from keyboard Often.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Outline Variables 1.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Streams Streams –Sequences of characters organized.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Chapter 9 Formatted Input/Output. Objectives In this chapter, you will learn: –To understand input and output streams. –To be able to use all print formatting.
Computer Arithmetic Nizamettin AYDIN
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Project Management November.
Introduction to Python
Power PMAC Electronic Cam Tables April 2014
 Pearson Education, Inc. All rights reserved Formatted Output.
1 Lecture 5 Floating Point Numbers ITEC 1000 “Introduction to Information Technology”
Fixed-Point Arithmetics: Part II
IT253: Computer Organization
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Data Structures January 2012.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character.
Data Representation in Computer Systems
Computer Science 111 Fundamentals of Programming I Basic Program Elements.
Chapter 3 Processing and Interactive Input. 2 Assignment  The general syntax for an assignment statement is variable = operand; The operand to the right.
CNG 140 C Programming Lecture Notes 2 Processing and Interactive Input Spring 2007.
A First Book of ANSI C Fourth Edition Chapter 3 Processing and Interactive Input.
Input, Output, and Processing
1 C - Memory Simple Types Arrays Pointers Pointer to Pointer Multi-dimensional Arrays Dynamic Memory Allocation.
8-1 Embedded Systems Fixed-Point Math and Other Optimizations.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Operational Summary November.
CSC 221 Computer Organization and Assembly Language
Introduction to Programming with RAPTOR
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
 2008 Pearson Education, Inc. All rights reserved Pointers and Pointer-Based Strings.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
MA/CS 375 Fall 2002 Lecture 3. Example 2 A is a matrix with 3 rows and 2 columns.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Expressions and Interactivity. 3.1 The cin Object.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
MA/CS 375 Fall 2003 Lecture 3. .* Multiplication We can use the.* operator to perform multiplication entry by entry of two matrices:
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
Variables Symbol representing a place to store information
MA/CS 375 Fall 2002 Lecture 2. Motivation for Suffering All This Math and Stuff Try the Actor demo from
Tokens in C  Keywords  These are reserved words of the C language. For example int, float, if, else, for, while etc.  Identifiers  An Identifier is.
MATLAB Constants, Variables & Expression Nafees Ahmed Asstt. Professor, EE Deptt DIT, DehraDun.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Shared Memory December 2013.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Compensation Tables November.
Computer Science 121 Scientific Computing Winter 2016 Chapter 3 Simple Types: Numbers, Text, Booleans.
Chapter INTRODUCTION Data Types and Arithmetic Calculations.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Variables, Operators, and Expressions
MATLAB DENC 2533 ECADD LAB 9.
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Presentation transcript:

DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Mathematical Features November 2013

DELTA TAU Data Systems, Inc. 2 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Floating-Point Math Power PMAC processor has hardware floating-point engine –5–10x (+) faster than Turbo PMAC software-library implementation –Single-precision (IEEE 32-bit) supported –Double-precision (IEEE 64-bit) supported, default for user programs Double-precision provides much greater resolution and range than PMAC/Turbo PMAC 48-bit format –18 more bits in the mantissa – 256K x increase in resolution/range –Range of ±1.80 x 10 ±308 –Suitable for key automatic motor calculations –Suitable for axis calculations (trajectories, kinematics, lookahead) –Suitable for user-program calculations

DELTA TAU Data Systems, Inc. 3 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Numerical Representations Receiving numerical values in text strings (e.g. P1=3) –Standard decimal format No arbitrary limit on number of decimal places permitted –Scientific notation Format {mantissa}E{exponent} (e.g E10) Mantissa does not need to be normalized (e.g E9 is OK) –Hexadecimal (with $ prefix) Non-negative integers only Reporting numerical values in text strings –Reporting format independent of receiving (e.g. hex vs. decimal) –Automatic decision on number of decimal places reported (formatting to fixed number of decimal places must be done in host computer) –When not an exact floating-point representation of fraction, full length is reported (~16 digits)

DELTA TAU Data Systems, Inc. 4 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Floating-Point Math in Automatic Routines Motor phase and servo routines use floating-point math –Were fixed-point math in PMAC/Turbo PMAC –Speed and precision of floating-point math now suitable for these calculations Many problems with fixed-point math eliminated –Register units are standardized (e.g. counts, milliseconds) –No position rollover worries –No velocity saturation worries –Minimal quantization noise introduced in “aggressive” filtering –No conversion overhead from axis calculations Axis calculations use 64-bit floating-point math –Effective range before resolution-loss problems increased 256K times compared to Turbo PMAC

DELTA TAU Data Systems, Inc. 5 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Floating-Point Math in User Script Programs Machine control applications require the use of many different numerical formats –Inputs and outputs are fixed-point (Boolean, 16-bit, 32-bit, etc.) –Most motion calculations are floating-point Power PMAC Script environment does automatic type matching of different numerical formats –Fixed-point and floating-point representations –1-bit to 64-bit formats All “inputs” to calculations converted to 64-bit floating-point format All mathematical operations done in this format If calculation has a “result”, it is converted (if necessary) to required format User does not need to concern himself with format conversions (Note that user C-language programs must follow C rules for type matching and format conversions)

DELTA TAU Data Systems, Inc. 6 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Special Floating-Point Representations Special representations that are part of IEEE-754 standard Power PMAC reports these “values” with the text shown here inf, -inf (+/-infinity) –Obtained (for example) by division by 0 –Operations that generate +/-inf do not create errors –inf > any finite number, -inf < any finite number, in a comparison nan (not-a-number) –Obtained (for example) by function domain error (e.g. sqrt(-1) ) –Obtained when requesting value of element in non-existent hardware –Operations that generate nan do not create errors –Boolean isnan function can be used to check -0 (minus zero) –Obtained by underflow of negative values –Equivalent to 0 (“plus zero”) in any subsequent operations +/-inf, nan generally useful as diagnostics; in application, best to check before operation that could produce

DELTA TAU Data Systems, Inc. 7 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data User Global Variables “Global” variables can be shared between programs –P-variables (65,536 total) Double-precision (64-bit) floating-point variables Accessible from all coordinate systems Declared as “global” (outside of a program) for IDE substitutions Accessible from C programs with pshm->P[i] –Q-variables (8192 per coordinate system, not overlapping) Double-precision (64-bit) floating-point variables Separate coordinate systems access different variables for same name Declared as “csglobal” (outside of a program) for IDE substitutions Accessible from C programs with pshm->Coord[x].Q[i] –M-variables (16,384 total) Pointer variables; take on format of what is pointed to Accessible from all coordinate systems Declared as “ptr” (outside of a program) for IDE substitutions Not directly accessible from C programs (use API functions)

DELTA TAU Data Systems, Inc. 8 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Using M-Variables in Power PMAC Most registers can be accessed without M-variables, by element name M-variables with declared names can be convenient Software (memory) registers rarely accessed with M-variables –Most users satisfied with standard data structure names –Some users want to shorten names e.g. ptr Mtr1FE->Motor[1].PosError –Some users want to customize names e.g. ptr LoadAxisEndPos->Coord[1].TPExec.Pos[6] Hardware (I/O) registers commonly accessed with M-variables –Declared M-variable name will be meaningful for application e.g. ptr LaserOn->Acc68E[1].DataReg[4].6 –Some I/O registers have no element name, defined by address e.g. ptr LightCurtainBroken->u.io:$D

DELTA TAU Data Systems, Inc. 9 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Defining M-Variables Defined to data structure element (takes on format of element) M{constant}->{data structure element} General definition in I/O space M{constant}->{format}.io:{adr_offset}[.{start}[.{width}]] General definition in user shared memory space M{constant}->{format}.user:{adr_offset}[.{start}[.{width}]] Self-defined (useful to create particular numerical format) M{constant}->*{format}[.{width}] M-variable formats –s – signed integer that saturates –i – signed integer that rolls over –u – unsigned integer that rolls over –f – short (32-bit) floating-point (does not take {start} or {width} ) –d – long (64-bit) floating-point (does not take {start} or {width} ) –{start} = 0 to 31 (default is 0, not limited to 1 & multiples of 4) –{width} = 1 to 32 (default is 32, not limited to 1 & multiples of 4)

DELTA TAU Data Systems, Inc. 10 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC I-Variables “Legacy” feature intended for convenience of experienced Turbo PMAC users Point to Power PMAC data-structure savable setup elements that are essentially equivalent to present Turbo PMAC I-vars: –For Motors 0 – 31: I0 – I3199 –For Coordinate Systems 0 – 15: I5000 – I6599 –(Note that I0 – I99 taken for Motor 0, I5000 – I5099 for C.S. 0) –For “Gate1” ICs 0 – 19: I7000 – I7999 –For “Gate2” ICs 0 – 3: I6800 – I6999 Usable in programs and on-line commands Setup elements for new features, motors, C.S.’s generally not given I- variable numbers Can find out what element is used by an I-variable with on-line command I{constant}-> e.g.: I428-> I428->Motor[4].InPosBand

DELTA TAU Data Systems, Inc. 11 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC User Local Variables “Local” variables are used within a program –L-variables (8192 per C.S., PLC, & on-line command processor) Double-precision (64-bit) floating-point variables Not (directly) accessible outside of program where used Declared as “local” (inside of a program) for IDE substitutions –R-variables are renamed L-variables for passing/returning values to/from general subroutines Rn of calling routine equivalent to Ln of called routine Permit true “stack” argument passing to subroutines –C-variables are renamed C.S. L-variables for passing/returning axis values to/from kinematic subroutines Cn is equivalent to L(MAX_MOTORS+n) for C.S. –C.S. and PLC data structures provide full read access to local variables Coord[m].Ldata.L[n] or PLC[m].Ldata.L[n] accesses Ln relative to L0 of present program Coord[m].Ldata.Lindex or PLC[m].Ldata.Lindex accesses number of L0 of present program relative to root L0 Coord[m].Ldata.R[n] or PLC[m].Ldata.R[n] accesses Rn relative to R0 of present program

DELTA TAU Data Systems, Inc. 12 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Local Variable Stack Example This example uses default “stack offset” of 256 –Other offsets can be declared –IDE declares optimal offsets automatically Rn of calling routine equivalent to Ln of called routine Rn of calling routine equivalent to L(n + StackOffset) of calling routine Pass/return arguments should start with R0 of calling, L0 of called –IDE manages these definitions and assignments automatically

DELTA TAU Data Systems, Inc. 13 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Local D-Variables “Non-stack” set of local variables for each C.S., PLC, communications thread Separate from L, R, & C “stack” local variables 53 variables (D0 – D52) for each environment Used for “read” argument passing from letter/number format –Especially useful for RS-274 “G-Code” CNC-style programs –Not intended for multiple levels of subroutines (no stack) Used for storing queried axis values –From commands like pread, dread, vread, fread D0 used for kinematic routine input/output flags Can be accessed “externally” by structure name –e.g. Coord[x].Ldata.D[n], Plc[i].Ldata.D[n]

DELTA TAU Data Systems, Inc. 14 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Auto-Assigning User Names to Variables Requires use of Project Manager in IDE When you don’t care what variable is assigned, use declarations –global MyPvar1, MyPvar2, MyPvar3(16); –csglobal MyQvar1, MyQvar2, MyQvar3(256); –ptr MyMvar1->{definition}, MyMvar2->{definition}; –local MyLvar1, MyLvar2, MyLvar3(7); Project manager automatically assigns variables to names Can set starting variable numbers for auto-assign with PVARSTARTn, QVARSTARTn, MVARSTARTn directives –Directives in /usrflash/project/pp_proj.ini Defaults are PVARSTART8192, QVARSTART1024, MVARSTART8192 Variables with lower numbers available for manual assignment or “raw” use Local variable auto-assigns always start with L0 –L0 to L(n-1) for n arguments into routine, Ln and up for internally declared

DELTA TAU Data Systems, Inc. 15 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Capabilities with Declared Variable Names When writing programs, just use declared variable names, e.g.: MyPvar1 = MyMvar2 + 7; Can access from IDE terminal, watch window, etc., e.g.: MyPvar1 &2MyQvar3 MyMvar2 = 1 If non-local variable declared with a value, e.g.: global MyPvar4 = 3; –Value is automatically assigned to the variable on download, power-up, and reset –Very useful for setting power-up default values –Value can be expressed as constant or expression (e.g. 5 * 65536), but expression cannot use variables Communications program gpascii -2 can use declared variable names

DELTA TAU Data Systems, Inc. 16 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Manual Assigning User Names to Variables Requires use of Project Manager in IDE When you do care what variable is assigned, use definitions –#define MyPvar1 P10 –#define MyQvar7 Q50 –#define MyMvar3 M200 Simple text substitution on download Should use variables numbered below P/Q/MVARSTART # Communications program gpascii -2 can use defined variable names Can be most important for local (L) variables to coordinate variable passing properly (IDE does automatically for subroutine arguments) –#define MyLvar1 L0 –#define MyLvar2 L1 –#define MyRvar1 R0 –#define MyRvar2 R1

DELTA TAU Data Systems, Inc. 17 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Variable Arrays For any numbered variable type (P, Q, M, I, L, R, D, C) Specific variable can be specified by mathematical expression in parentheses –e.g. P(P1-P2+7), L(Index-1) Technically, these are function calls, so use ( ), not [ ] –Compare to indexed data structures, which use [ ] for index Computed expression value rounded down to next integer (if necessary) before used to select particular variable Usable in motion and PLC programs, & many on-line commands Can use arrays with variable declarations in IDE –global MyParray(32) declares 32-element P-variable array –If IDE project manager assigns P620 – P651 to this array, MyParray(Index) becomes P(620+Index) –No protection against index exceeding declared array length Note distinction between arrays, vectors, and (2D) matrices

DELTA TAU Data Systems, Inc. 18 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Script Math: Scalar Functions Trig functions using radians: sin, cos, tan, sincos Inverse trig functions using radians: asin, acos, atan, atan2 Trig functions using degrees: sind, cosd, tand, sincosd Inverse trig functions using degrees: asind, acosd, atand, atan2d Hyperbolic trig functions: sinh, cosh, tanh Inverse hyperbolic trig functions: asinh, acosh, atanh Log/exponent functions: log (or ln), log2, log10, exp, exp2, pow Root functions: sqrt, cbrt, qrrt, qnrt Rounding/truncation functions: int, rint, floor, ceil Random number generation : rnd (32-bit), randx (64-bit), seed Miscellaneous functions: abs, sgn, rem, madd (mult & add), isnan

DELTA TAU Data Systems, Inc. 19 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Script Vector & Matrix Functions Treat sets of consecutively numbered variables as 1D vectors or 2D matrices for mathematical operations –Global P-variables if Ldata.Control = 0 (power-on default) –Local L-variables if Ldata.Control = 1 –Global user shared memory Sys.Ddata[i] variables if Ldata.Control = 2 (new in V1.5) Particular variables used in vector or matrix specified by function arguments: –Starting variable number –Length for vectors –Number of rows and columns for matrices Functions permit more compact user code Functions execute much faster than multiple user code scalar operations

DELTA TAU Data Systems, Inc. 20 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Script Math: Vector Functions Operate on continuously numbered set of variables Same set of variables can be treated as 2D matrix for other purposes Functions that produce new vectors (returned value is “OK” flag – must “put” somewhere even if don’t use) –vadd: Adds 2 vectors together to produce 3 rd vector –vcopy: Copies contents of vector into 2 nd vector –vscale: Multiplies each vector element by common scale factor, result in 2 nd vector Functions that produce scalar (as returned value) only –sum: Adds a number of evenly spaced elements together (as for trace of matrix) –sumprod: Multiplies pairs of elements of 2 vectors together, adding products into returned value (as for dot product)

DELTA TAU Data Systems, Inc. 21 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Script Math: Matrix Functions Operate on consecutively numbered set of variables Elements in same row are consecutively numbered Functions that produce new matrices (returned value is “OK” flag or determinant of result matrix – must “put” somewhere even if don’t use) –mmul: Multiplies 2 matrices together to create 3 rd matrix –mmadd: Multiplies 2 matrices together, adds product to 3 rd matrix –minv: Inverts a square matrix to create a 2 nd matrix –mtrans: Transposes a matrix to create a 2 nd matrix –msolve: Solves simultaneous set(s) of equations represented by square (coefficient) matrix and 2 nd (constant) vector/matrix Functions that produce scalar (as returned value) only –mdet: Calculates determinant of square matrix –mminor: Calculates specified minor determinant of square matrix

DELTA TAU Data Systems, Inc. 22 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Declared Vector and Matrix Names In IDE, can declare array variables for vectors and matrices, e.g.: global MyVector1(3), MyVector2(3);// P-variables, declared outside program global MyMatrix1(9), MyMatrix2(9); local MyVector3(3), MyVector4(6);// L-variables, declared inside program Local MyMatrix3(9), MyMatrix4(36); Function calls can then use declared names, e.g.: Ldata.Control = 0;// Use global P-variables MyResult = sum(&MyVector1(0), 3, 1); MyTest = vcopy(&MyVector1(0), &MyVector2(0); MyResult = mdet(&MyMatrix1(0), 3); MyTest = minv(&MyMatrix1(0), &MyMatrix2(0), 3); Ldata.Control = 1;// Use local L-variables MyResult = sumprod(&MyVector3(0), &MyVector4(3), 3, 3, 1); MyTest = vscale(&MyVector3(0), 2.5, &MyVector4(3), 3); MyResult = mminor(&MyMatrix3(0), 3, 1, 2); MyTest = msolve(&MyVector4(0), MyMatrix4(0), 6, 6); Note that do not need to start with element 0 of vector/matrix

DELTA TAU Data Systems, Inc. 23 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Operators and Conditional Comparators Arithmetic operators –+ (add), - (subtract), * (multiply), / (divide), % (modulo) –Normal rules of algebraic precedence apply Bit-by-bit logical operators –& (bit-by-bit AND), | (bit-by-bit OR), ^ (bit-by-bit exclusive OR) –~ (bit-by-bit invert; unary operator – technically a function) – > (shift right) Conditional comparators –== (equals), != (not equals), ~ (approx. eq.), !~ (not approx. eq.) –> (greater than), < (less than) –>= (greater than or equal to), <= (less than or equal to) Condition combinatorial operators –&& (AND), || (OR) Condition negation operator ! (NOT)

DELTA TAU Data Systems, Inc. 24 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Standard Assignment Operators General syntax: {variable} {operator} {expression} Expression following operator evaluated during program flow Resulting value immediately used to set value of variable preceding operator –If motion program is looking ahead due to blending, buffered dynamic lookahead, and/or tool radius compensation, assignments can appear out of sequence with executed motion –Use synchronous assignments to delay actual assignment until resulting executed motion Simple assignment: = (expression value written into variable) Assignments with arithmetic operation: +=, -=, *=, /=, %= Assignments with logical operation: &=, |=, ^= Assignments with shift operation: >>=, <<= Increment/decrement assignments: ++, --

DELTA TAU Data Systems, Inc. 25 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Synchronous Variable Assignments Needed primarily because motion programs must calculate ahead during sequence of blended moves –Standard assignments would occur “too soon” compared to moves –Synchronous assignments are delayed to be in sequence with moves General syntax: {variable} {synchronous operator} {expression} Most variable types can receive synchronous assignment –Not just M-variables as in PMAC/Turbo PMAC –Including pre-defined data structure elements –No local variables or self-referenced M-variables can receive Expression following operator evaluated during program flow Resulting value stored in buffered queue along with operation type Each coordinate system has an independent buffered queue Actual assignment using operator occurs at beginning of execution of next commanded move (at start of blend) In PLC programs, use to assure that commanded move has started

DELTA TAU Data Systems, Inc. 26 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Synchronous Variable Assignments (cont.) Simple assignment: == (expression value written into variable) –For any type of variable format Assignments with arithmetic operation: +==, -==, *==, /==, %== –*==, /==, %== for floating-point variables/elements only Assignments with logical operation: &==, |==, ^== –For integer variables/elements only Increment/decrement assignments: ++=, --= Useful in PLC programs to know that commanded move has started, e.g.: P1=0; P1==1; jog1=100000;// P1 set at start of jog move while (!(P1) || !(Motor[1].InPos)) { }// Move not started or ongoing M1=1;// Set output when move has finished and settled // Motor must be assigned to a C.S. to trigger sync assignment in PLC

DELTA TAU Data Systems, Inc. 27 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Synchronous Assignment Motion Program Example One move lookahead (for simple blending): X10;// 1 st move X20;// 2 nd move Q1 = 30;// Standard assignment M1 = 1;// Standard assignment M2 == 1;// Sync assignment X(Q1);// 3 rd move Q1 set to 30 at X=10 (t1) –Needs to be done at lookahead time to calculate next move properly M1 set to 1 at X=10 (t1) –Output would appear out of sequence M2 set to 1 at X=20 (t2) –Output would appear in sequence

DELTA TAU Data Systems, Inc. 28 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Synchronous Assignment Buffer Synchronous assignments must be buffered from time encountered in program until delayed execution Default buffer space for 1M (1,048,576) synchronous assignments –Size can be changed in IDE Project Manager (pp_proj.ini file) Coord[x].SyncOps specifies how many of these assignments reserved for this C.S. in buffer –Default value of 8192 for each C.S. (sufficient for almost all applications) –To change buffer organization, set new values for Coord[x].SyncOps, save, and reset (new buffer offsets calculated automatically on reset) –No need to define second-stage buffer with special lookahead –C.S. needs to buffer for length of lookahead and retrace at any given time (buffer space is reused) Large numbers of buffered assignments only needed for applications with special lookahead (and especially lengthy retrace)

DELTA TAU Data Systems, Inc. 29 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Script String Functions Operate on character (byte) arrays in user shared memory buffer Specify string variable with starting index value i in Sys.Cdata[i] Functions that manipulate string variables: –sprintf, strcat, strcpy, strncat, strncpy, strtolower, strtoupper Functions that interrogate string variables: –strchr, strcmp, strcspn, strlen, strncmp, strpbrk, strrchr, strspn, strstr, strtod All functions return a value that must be “put” somewhere Methods to use/transmit strings: –Script program send, cmd, system commands Referenced within text by %s designator Starting character index for string specified after text e.g. send1"Error: %s“,512 –C routines and applications Access string with character (byte) pointer into user shared memory buffer Note that C can use strings elsewhere as well (but no Script access to these)