DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Data Structures January 2012.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Structure of a C program
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 6. 2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single Value Pass by Reference Variable Scope.
 2003 Prentice Hall, Inc. All rights reserved. 1 Functions Modules: functions and classes Programs use new and “prepackaged” modules –New: programmer-defined.
Lesson 6 Functions Also called Methods CS 1 Lesson 6 -- John Cole1.
1 Functions Modules: functions and classes Programs use new and “prepackaged” modules –New: programmer-defined functions, classes –Prepackaged: from the.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC as a Linux Computer January.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
User C Programs in Power PMAC December 2013
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Mathematical Features November.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Project Management November.
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
Power PMAC Electronic Cam Tables April 2014
Operator Precedence First the contents of all parentheses are evaluated beginning with the innermost set of parenthesis. Second all multiplications, divisions,
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
 2006 Pearson Education, Inc. All rights reserved Arrays.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Talking to Power PMAC November 2013.
A First Book of C++: From Here To There, Third Edition2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
CHAPTER 07 Arrays and Vectors (part I). OBJECTIVES 2 In this part you will learn:  To use the array data structure to represent a set of related data.
Copyright © 2012 Pearson Education, Inc. Chapter 6: Functions.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Encoder Conversion Table January.
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
Chapter 6: User-Defined Functions
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Operational Summary November.
Copyright © 2012 Pearson Education, Inc. Chapter 6: Functions.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Fundamentals of C and C++ Programming. EEL 3801 – Lotzi Bölöni Sub-Topics  Basic Program Structure  Variables - Types and Declarations  Basic Program.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
CE Operating Systems Lecture 17 File systems – interface and implementation.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
Lecture 3 Introduction to Computer Programming CUIT A.M. Gamundani Presentation Layout from Lecture 1 Background.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
Functions Math library functions Function definition Function invocation Argument passing Scope of an variable Programming 1 DCT 1033.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 6: Functions.
C++ Programming Lecture 14 Arrays – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Shared Memory December 2013.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Compensation Tables November.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Chapter 02 (Part II) Introduction to C++ Programming.
ECE 103 Engineering Programming Chapter 30 C Functions Herbert G. Mayer, PSU CS Status 8/9/2014 Initial content copied verbatim from ECE 103 material developed.
Chapter 1: Introduction to Computers and Programming.
OPERATORS IN C CHAPTER 3. Expressions can be built up from literals, variables and operators. The operators define how the variables and literals in the.
Software Troubleshooting Eliminate possible programming and timing errors by stopping all programs ( and ). Use the Executive program terminal and send.
C++ for Engineers and Scientists Second Edition Chapter 12 Pointers.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Chapter 2 Introduction to C++ Programming
© 2016 Pearson Education, Ltd. All rights reserved.
Java Primer 1: Types, Classes and Operators
Revision Lecture
C Basics.
Chapter 6: Functions Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
User-Defined Functions
Bare Metal System Software Development
Module 2: Computer-System Structures
Lecture 18 Arrays and Pointer Arithmetic
Bare Metal System Software Development
Module 2: Computer-System Structures
Presentation transcript:

DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Data Structures January 2012

DELTA TAU Data Systems, Inc. 2 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Data Structures Main provided method of organizing Power PMAC information –Both hardware (I/O) and software (memory) registers –Includes saved setup elements (like old I-variables) –Includes unsaved control elements –Includes read-only status elements –Mostly replaces I & M-variable use of PMAC/Turbo PMAC Pre-defined by Delta Tau –User cannot create own data structures/elements in Script environment No need to know numerical addresses of structure elements –Mostly replaces “memory & I/O map” of PMAC/Turbo PMAC Accessible through on-line commands, Script and C programs IDE has “intellisense” database of structure names –Automatically presents possible “completions” as you type –Can select from list to finish name –F1 function key “help” provides full manual description

DELTA TAU Data Systems, Inc. 3 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Script Environment Access From both on-line commands and buffered program commands Structure and element names are not case sensitive No need to “include” any header files for access No need to declare these pre-defined elements Script environment automatically performs type-matching –No need to worry about element data length or format Power PMAC prevents user changes to “write-protected” elements –Error returned for on-line command attempt –Buffered program attempt results in “no-op” (no error reported, no abort) Power PMAC prevents out-of-range values from being assigned –Error returned for on-line command attempt –Buffered program attempt results in “no-op” (no error reported, no abort)

DELTA TAU Data Systems, Inc. 4 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Classes of Data Structure Elements Saved setup elements –Have factory default values set on re-initialization ($$$***) command, or on power-up/reset with a fault or configuration change –Last-saved values copied from flash memory on normal power-up or reset –Present active values copied to flash memory on a save command Non-saved control elements –Have default values (usually 0) set on power-up, reset, re-initialization –User can set values at any time in application –Not affected by save command Status elements –Values automatically set by Power PMAC –Most are write-protected in Script environment –Some permit user writing for special operations Each class of element has a separate chapter in Software Reference

DELTA TAU Data Systems, Inc. 5 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Important Data Structures Sys.Global “system” elements Motor[x].Motor elements, indexed by Motor # Motor[x].Servo.Motor servo algorithm elements Coord[x].Coordinate-system elements, indexed by CS # EncTable[n].Encoder table elements, indexed by entry # CompTable[m].Comp table elements, indexed by table # Gate1[i].DSPGATE1 Servo IC elements, by IC # Gate1[i].Chan[j].DSPGATE1 channel elements, by channel # Gate2[i].DSPGATE2 MACRO IC elements, by IC # Gate2[i].Chan[j].DSPGATE2 channel elements, by channel # Gate3[i].DSPGATE3 Servo IC elements, by IC # Gate3[i].Chan[j].DSPGATE3 channel elements, by channel # GateIo[i].IOGATE I/O IC elements, by IC # Gather.Data gathering elements Macro.MACRO ring elements

DELTA TAU Data Systems, Inc. 6 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Specifying Data Structure Indices Index is in square brackets, not in parentheses Index must be integer constant or local L-variable –No expressions, no fractions –If calculating index value, must do this in separate program command that assigns value to L-variable, e.g. L0=Ldata.Motor; Motor[L0].JogSpeed=100; Indices always start at 0 –Motor[x]. index value matches Motor number (#x) –Coord[x]. index value matches C.S. number (&x) –ASIC index value matches ASIC number (but ASIC numbering scheme different from Turbo PMAC) –ASIC channel index (0 – 3) is one less than ASIC channel number (1 – 4) –Constant index values can range from 0 to Sys.MaxItems - 1 –Variables used for index can range from L0 to L(1022 – Sys.MaxItems)

DELTA TAU Data Systems, Inc. 7 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Specifying the Address of an Element The “.a” suffix added to the end of an element name specifies the “address of” the element –Generally do not need to know the numerical value of this address –Actual numerical value can vary with system type and compilation –Can get numerical value by querying {element name}.a A “p” at the beginning of an element name specifies “pointer to” –These elements are set to an address value –When queried, Power PMAC reports back element name with “.a” suffix (if the address is that of a known element) Examples: Motor[1].pDac=Gate1[4].Chan[0].Pwm[0].a// Set motor output pointer Motor[2].pDac// Query motor output pointer Gate1[4].Chan[1].Pwm[0].a// Power PMAC response Gate1[4].Chan[0].Pwm[0].a// Query element address $d // Power PMAC response

DELTA TAU Data Systems, Inc. 8 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data C Access to Data Structures Must include header file in C compilation build: #include Must access software elements with pshm->{data structure element} –C functions have pshm declared automatically –Independent C applications must declare: e.g. struct SHM *pshm; –Sys structure name is implicit: e.g. pshm->ServoPeriod (for Sys.ServoPeriod) –Other structure names must be used: e.g. pshm->Motor[1].JogSpeed Must respect variable type of each element according to C rules Element names in C are case-sensitive No write-protection or out-of-range/saturation protection Some “internal use” elements not accessible (in lieu of write protection) For hardware elements, only “full-word” (32-bit) structure elements can be accessed from C program –Full-word elements often contain multiple partial-word elements e.g. Gate1[i].PwmCtrl contains Gate1[i].PwmPeriod and Gate1[i].PwmDeadTime –Must mask (and maybe shift) to isolate “partial-word” element –Script full-word element of same name may be less than 32 bits e.g. in script, Gate1[i].PwmCtrl is 24 bits (high 24 of 32)

DELTA TAU Data Systems, Inc. 9 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data C Access to Hardware Data Structures Hardware (I/O) data structures not part of “pshm” shared memory Two methods of C access to hardware data structures 1 st (recommended) method: define your structure variable –Use API function provided by Delta Tau – e.g.: GateArray1MyFirstGate1IC;// Declaration of structure variable MyFirstGate1IC = GetGate1MemPtr(4);// Assignment to address –Now use element(s) in this structure – e.g.: MyFirstGate1IC->Chan[0].CompA = MyCompPos << 8; MyTriggerFlag = MyFirstGate1IC->Chan[3].Status & 0x80000 >> 19; 2 nd (slightly faster) method: define int pointers to structure & element –Use base address offsets auto-detected by Power PMAC – e.g.: MyFirstGate1Ptr = pshm->OffsetGate1[4]; –Compute absolute address of particular element pointer – e.g.: MyFirstGate1Ch0CompAPtr = (int *) piom + ((MyFirstGate1Ptr + 0x3C) >> 2); –Use this pointer variable – e.g.: *MyFirstGate1Ch0CompAPtr = MyCompPos << 8;