Home

PMAC Motion Control for LabVIEW 5.0 PMACPanel User Manual

image

Contents

1. Detailed descriptions for operating the three encoder handling methods are covered later At the top of the diagram are VIs to handle the Jog control and PVE indicator Below this PmacEncoderCompareConfig configures the encoder s compare control bits when the Configure Compare button on the panel is clicked Configuration can be done by the PLC e PmacEncoderCompareConfig Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the Input Compare Control bits for the specified Encoder Number are set Otherwise they are fetched from PMAC and provided by Output Compare Control Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 32 0 pec eoeeeentanaas He Output B ool F E der Number i32 1 16 fi ae ee ala ae 5 ans Mp pae Output Compare Control Cluste Input Compare Control Cluster 122 Encoder Capture and Compare Operation PMAC PanelPRO User Manual Dey Open a Pan Motor PYE Cluster Configure the Compare E qual Operation IEE ARS CS RS PORE ree ee an Or nin ner rains ra nar rns ra or rarr r Configure Compare z a True P Motor Jog Hotor Encoder Fg ga TETA ot hg TATATA TT TTE TET TET EATE EATE EATA TATE aa TATE TATE TATE Ran a is ha aha hhh LiF Sv Update date TE aa Disable Comp I PLE base Sub eH a _A P101 PLC 5W Compare Interval Comp Pulse PLC Comp Pulse PLC EF E Emme
2. int 13 Reset the buffer counters for i 0 i lt MOTOR MAX i BufferCount i 0 return nokErr The code above has the same structure as PmacDPRRealTimeMotor even though it is longer The PMAC Busy Bit is processed as before Instead of assigning the fetched data directly to the items of the cluster it is stored in a set of global arrays The BufferCount array keeps track of the next array location to be written when valid data is available for storage There is a cryptic IF clause involving the ServoTimer data and BufferCount The actual storage of fetched data in the temporary arrays requires that the ServoTimer not be the same as that of the last sample Otherwise the array would contain multiple samples of the data After the temporary arrays are updated the CIN check the current buffer count against the desired buffer size If there are enough samples in the temporary array the data will be copied from the temporary arrays into the cluster of arrays passed back to the VI This requires each array in the cluster to be resized using LabVIEW s NumericArrayResize and then the data copied from the temporary array into the data buffer that will be returned to the VI Once the basics of this requirement are understood clusters and arrays are easy to handle in the CIN There are some conditions associated with this approach The temporary storage arrays have a fixed size defined by MOTOR_MAX and BUFFER_MAX They
3. 160 DPR Dual Ported RAM PMAC PanelPRO User Manual The bit VIs are PmacDPRNumericDWordBitTest This VI queries the DPR DWord bit specified by DPR Numeric Spec Cluster and returns the value in Bit Value Device Number 132 0 DPA DPR Numeric Spec Cluster DBitT ii e PmacDPRNumericDWordBit This VI operates on the DPR DWord bit specified by DPR Numeric Spec Cluster When Set Get is false the default state the value of the bit is queried and returned by Bit Value with Response Available true When Set Get is true the specified bit is set to the value of Bit State either true or false Device Number 132 0 npp F Available Bool F SethGet Bool F lt esponse Syallable Bool F DPR Numeric Spec Cluster L Bit Value Bool Bit State Bool Bit field operations are a little more complex The following VI allows the specification of an entire X Y word and sets or clears multiple bits in a single operation depending on the control input PmacDPRNumericDWordSetMask This VI operates on the DPR DWord bit field specified by DPR Numeric Spec Cluster When Set Get is false the default state the Mask specified by DPR Numeric Spec Cluster is AND d with the specified address to produce the output Bit Field Value Response Available is true When Set Get is true the Mask is either OR d or XOR d with the contents of the field at the specified address If XOR OR is false the mask i
4. GP Machine Input GP MachineOutput C Counter The physical inputs are copied into the output port located in a different bit field to drive the GP Machine Output array and the LEDs on the physical device If the Counter box is checked a bit is rotated through a number and written the physical port thereby driving the LEDs This is shown on the diagram below GP MachineOutput The two VIs that implement the example require a little discussion so that custom PmacAcc VIs can be developed or modified e PmacAccMachinelnput8 If Set Get is false or not wired get the Machine Input Port contents Response Available will be true to indicate that the Outputs contain the value If Set Get is true set the Machine Input Port using Input Value Response Available will be false and the outputs default to Input Value Device Number 132 0 a Poo Response Avallable Bool F SetGet Bool F 247777 Output Value us 0 Input Value us 0 me utpat Bool Array 5 e PmacAccMachineOutput8 If Set Get is false or not wired get the Machine Output Port contents Response Available will be true to indicate that the Outputs contain the value If Set Get is true set the Machine Output Port using Input Value Response Available will be false and the outputs default to Input Value Device Number 132 0 a mn boos Response Available Bool F SetGet Bool F lt 0 Output Value ue 0 Inout Walue 2 w Output Bool Array 2 66 Application
5. 16 PMACPanelPRO Basics PMAC PanelPRO User Manual Global ICVs PmacGlobal General PMAC setup and configuration are provided by this collection for VIs These capabilities are used for the development of supervisory VIs Accessory ICVs PmacAcc PMAC has numerous accessories that are used to provide digital I O analog I O and control capabilities This includes the Acc 16D front panel and the alphanumeric display This collection provides basic ICVs that access the memory mapped data used by these accessories Position Capture and Triggering ICVs PMAC has the ability to capture exact motion positions in response to external triggers and generate triggers when specified positions are reached This capability can in conjunction with National Instruments DAQ boards be used to capture a position or trigger instrument control in response to specified positions PmacHome This collection of VIs provides access to the I Variables and memory variables required for defining homing criteria and determining home position offset PmacEncoder This collection provides VIs to access and control the encoder gate array for position capture and compare There are also tools for developing background PLC programs for generating Compare Equal outputs Program Development and Encapsulation Tools Developing PLC and motion programs that work seamlessly with PMAC Panel Pro requires four major components 1 Tools to edit and create prog
6. The program controls implemented by the Program Exec cluster send on line program execution commands to PMAC A brief description of the button operations is given here For detailed descriptions of PMAC s implementation of the command see the associated documentation in the PMAC Software Reference Manual or the online help available through Help Show Help e Begin Point PMAC to the coordinate system and program number specified Load the actual program from PMAC The command sent to PMAC is amp CS b PROG where CS is the specified coordinate system number and PROG is the current program number e Run Execute the program from where it is If pointed to the beginning with Begin then start there If aborted or motion is halted using the associate buttons restart the program from its current location The command sent to PMAC is R e Step Execute a step to the next move or dwell in the program performing all the intervening computations The command sent to PMAC is R e Prog Hold Bring the coordinate system velocity to zero thereby holding moves where they are but allowing jogs Restart the program with RUN or STEP The command sent to PMAC is e Jog Pop up a jog panel to allow motor jogging after a Prog Hold The jog panel must be closed before the panel before returning to this panel to restart the program with RUN or STEP Closing the panel returns all jogged motors to their pre jog position with j Commands sen
7. setting FALSE otherwise ie Aa setting nine ris to ban AER E E est for Response Available ix30 Prop Gain Eas w30 Prop Gain Easy ind Dery Gain Eas 31 Derv Gain Easy EA x33 Integ Gain Eas ie indo Integ Gain Easy 40 Application Basics PMAC PanelPRO User Manual The use of PmacIVar as opposed to the PmacI VarSet and PmacI VarGet Vis groups the controls into sub units that are a little more manageable They are used extensively in the ICVs introduced later PmacTutor6b Accessing PMAC Memory PMAC makes extensive use of the Motorola 56K memory mapped architecture This includes various encoder registers DAC and ADC values digital I O ports etc Details of PMAC s memory organization can be found in the PMAC Software Reference Manual and should be consulted when accessing memory The PmacMemory collection of VIs simplifies the access and manipulation of this architecture and its binary representation LabVIEW numerical controls and indicators can be configured to display this information as either hex or decimal data independent of the integer representation of the data Data is actually received from PMAC and sent to PMAC in this collection using ASCII hexadecimal strings When defining a PMAC address to access the Address Spec String input to the following VIs can be in either hexadecimal or decimal form Both strings below access the same address Yeo COO Y 49152 Reading Memory Data The
8. i od Itern Hames Initialize the gather specification T Chose a e E E o Set Panel Gathering flag 4 i bau ath ath Gat jea L a a ef i tep Esa go ned 12321 Samples i a me op gt etup Start E a ae to 1000 for 250 mS i plot cluster Setup gathering registers then back to 0 and start gather If your ee from Gather Spec array El a 3 program starts the gather 2 i i amp exclude PmacGatherStatt e j 2 Halt gather F oe a 2 i collect data as 2D array of doubles If your program halts gather you e 1 don t need PmacGatherStop Gathered data can be Execute step or motion program J In sequence i Active Plo i Plot Color Gathering 2 i a Plot Name 2 i mt fi aaa eeu a aaa ea ea a ae aa ea a ea ea a ea ea ee aa ea ee eer a ATAATA 86 Development Tools PMAC PanelPRO User Manual Data is actually gathered in this tool when either the Gather Program or the Gather Step buttons are clicked They require the Gather Spec Cluster created by the program or generated by PmacGatherSelect The gather process begins by executing in sequence the following five VIs In the diagram the sequence of operations is located in a case structure e PmacGatherSetup Use the information in Input Gather Spec Cluster to setup a gather operation on PMAC Output Gather Spec Cluster should be wired to PmacGatherStart PmacGatherStop and
9. 17500 0 16000 0 12500 0 10000 0 fo 0 S000 0 2500 0 xY Po E Pos 0 0 l i i Ep Fna PETI Gror o0 5000 0 100000 150000 20000 t 14f am The indicators on the middle left of the panel display the actual X Y motor positions as retrieved by PmacDPRRealTimeMotors The yellow cursor in the plot is the target position for the move and determines the values of M501 and M502 When the yellow cursor is clicked and dragged to a new position the target position for the move is set and executed by the motion program The green worm will begin moving toward the yellow cursor with the red cursor bringing up the rear 0 0 00 M501 Dbl 5 0 00 M5027 Dbl EJ Enable Poll Program Progen Run El The diagram for the example is similar to those already discussed The motion program wrapper VI on top handles the program execution Below this is the VI handling the DPR Numeric cluster containing M500 M502 Close Loop Mtrs IP Praman Fun E h o py E Program Running Close enone et sae DPR Numeric Slave Cluster Numeric Slav __ Enable Track GE 5 Mi Cursor Posion ppe peg Woot DEI i T Y Surface C e Cluster DPR Numeric Slave Cluster 4L R r k ee x a Da eration Timer Sa Pig DPR Dual Ported RAM 165 PMAC PanelPRO User Manual The query for motor positions used to update the plot is provided by PmacDPRRealTimeMotors The configuration of this capability is done outsi
10. If DPR Variable Background buffer operation is enabled this VI can be used to fetch the data specified during the configuration The input Enabled can be used to enable and disable the actual fetch The Default un wired condition is true When New Output is true Output Value Array contains the most recent background data When Enabled is false Output Value Array contains the last valid data even though New Output is false Output Enable Bool VEGEB Specification Cluster fo WAGE Status Cluster 168 DPR Dual Ported RAM PMAC PanelPRO User Manual The Write Read and Input Value Array inputs are not functional currently Future releases may implement this capability Device Number 132 0 Enabled Bool T pp nnn Wew Dae Boal YEGB Specification Cluster Whrite T i ReadiF Bool Output Value Array Input Value Array Note on Supporting PmacDPRVarBack CINs The CINs to support this collection of VIs are significantly more involved than the previous collections The comments in the code provide enough information to try to tackle changes alone PmacDPRVarBackVectorExample This example replaces PmacDPRVarBack with PmacDPRVarBackVectors Its use is almost identical to PmacDPRVarBackExample The only difference is that the bottom buffer has a PmacGatherSpec cluster defined as constant containing entries for P44 and P45 Therefore the Address Items need not be specified Simply check the Enabled box The diagram is not prese
11. Iint32 Move Time 132 7 uInt16 Motor Motion_ul6 LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean LVBoolean Motor Activated Open_Loop Neg_Limit_Exceeded Pos Limit_Exceeded Home In Progress Block_Request Desired_Velocity_Zero Data Block Error Dwell_In Progress Integration_Mode Running_Move Open Loop Phased_Motor Hand_Wheel_ Enabled LVBoolean Neg_Limit_Exceeded LVBoolean Pos _Limit_Exceeded LVBoolean Motor Activated t TD2 J CIN MgErr CINRun int32 Device_Number_i32_0_ TD1 DPR_Real_Time_Motor_Cluster TD2 DPR_Real_ Time Servo Cluster LVBoolean ValidData int32 DevNum Device_Number_1i32 0 _ int32 MNum Motor_Number_i32 1 8 1 1 SERVOSTATUS Servostacus Tell PMAC we re doing our thing PmacDPRSetHostBusyBit DevNum 1 Check if PMAC is busy doing its thing if PmacDPRGetPmacBusyBit DevNum Fetch all of the available data DPR Real Time Motor Cluster gt ServoTimer_132 PmacDPRGetServoTimer DevNum DPR_Real_ Time Motor _Cluster gt Motor_ Activated LVTRUE PmacDPRMotorEnabled DevNum MNum 0 LVFALSE DPR Dual Ported RAM int32 Motor_Number_i32 1 8 1 Shorter dereferenced name 147 PMAC PanelPRO User Manual ServoStatus Fetch cluster and then individual items ServoStatus PmacDPRMotorServoStatus DevNum MNum DPR_Real_Time_Serv
12. RRE Output Enable Bool A successful query of PMAC s DPR depends on whether PMAC is accessing the memory If Wait for Valid is true the VI places queries to PMAC until a successful read at which time New Output is true indicating valid output data If Wait for Valid is false the query may or may not succeed If the query fails New Output is false and the output clusters contain the data fetched during the last read Device Number 132 0 ces Mew Output Bool Enabled Bool T y o pape jem DPR Real Time Serva Cluster walt For Valid Bool T f IPA Real Time Motor Cluster Coord Specify Cluster Dooce Motor PVE Cluster The fetching of multiple motor data by PmacDPRRealTimeMotors requires an array of motors and produces an array of clusters This VI differs from PmacDPRRealTimeMotor in that it does not provide Coordinate System conversions This is not provided because it would require assembling an array of Coord Specify Clusters If the Coordinate System conversion of Real Time data for multiple motors is needed use the PmacDPRRealTimePVE and apply the transformation to the individual cluster elements in the output arrays e PmacDPRRealTimeMotors Query PMAC DPR Real Time Fixed buffer Motor and Servo data for the list of motors specified in Motor Number Array When Enabled is true the Default state the data for the specified motors is fetched and used to build an array of DPR Real Time Motor Clusters and DPR Real Tim
13. This is useful in preventing commands from being repeatedly sent to PMAC 22 Application Basics PMAC PanelPRO User Manual I gt Untitled 2 File Edit Operate Project Windows Help lt 4 apt Application Fort E 2 s Change to Indicator Synchronous Display Find Terminal Show Data Operations Create Key Navigation Replace Data Range PMAC Panel Pro Indicator and Control Clusters PMAC Panel Pro makes extensive use of predefined indicator and control clusters to make the development task easier These clusters are easy to drop into an application It is necessary to understand what clusters are how to edit them and how to access the individual controls and indicators they contain An example of a Motor Status Jog Cluster PmacMotorStatJog is shown here Running Running Hove Dwell YW arming Fatal Following Error Following Error Amplifier Fault Error fl halk Motor status Jog Cluster A lot of work went into developing indicator clusters with proper names and item descriptions When Help Show Help is enabled extensive descriptions of PMAC Panel Pro cluster items can help the user understand what is displayed and what operations are performed by controls and indicators Cluster Item Access The individual items of each PMAC Panel Pro cluster are named and given a Tab Order Within PMAC Panel Pro generally they are unbundled without the name so that the diagrams are a little easier to fit on a s
14. and displays it on the panel PmacEncoderToCoord uses the transformations discussed above to compute Xformed Encoder Pos directly from this encoder position Output Value Double Dey Open ENC Capture Home Offset CTF I Caa formed Encoder Pos Enc Serva Raw Encoder Pos Mot mnt Mot TEs Motor PVE Cluster Motor Encoder EE aa et poo bE Position Capture for Non Homing Purposes The encoder architecture and its use for homing operations was introduced earlier Homing is a firmware command and therefore does not require monitoring of the capture flags access the capture register or do anything with the value To use the position capture function for operations other than homing in the program e Configure the capture condition e Monitor the capture flag e Process the capture register Do this using a PLC or using PMAC Panel Pro directly PLC Capture Flag Processing If using a PLC to handle the capture operation monitor the position captured flag bit bit 17 of the encoder control status register using MLLI gt x C0001 and the captured position using the M Variable MLOS gt X 22C003 0 24 6 This status bit turns true when the trigger condition turns true It returns to a non triggered false state when the capture register M103 is read As long as the status bit is true the capture function is disabled you must read the capture register to re enable the capture function The example program MOVTRIG
15. breadboards The terminals are well labeled and the chances for shorts are limited Analog I O Channels PMAC output signals may or may not be connected to the analog input channels on the DAQ board In several of the examples that follow the servo clock and JEQU signals are connected to Channel O and 1 for the purposes of demonstrating of how the clock looks To configure test and operate these inputs refer to the appropriate National Instruments manual Trigger and Scan Clock Connections Acquisitions from PMAC can be triggered in many ways Use the JEQU signal to start or stop acquisition at a precise position or use general purpose digital outputs and synchronous M Variables The servo clock and or the JEQU signal can also be used for the scan clock thereby synchronizing the DAQ sample rate with PMAC s primary timekeeper E Series Boards Connect the start trigger to PFIO TRIGI the stop trigger to PFI1 TRIG2 and the scan clock to PFI7 STARTSCAN Legacy MIO Boards Connect the start trigger to STARTRIG the stop trigger to STOPTRIG and the scan clock to OUT2 Note Two or more channels must be scanned when specifying an external scan clock Legacy MIO 16X MIO 16F 5 and MIO 64F 5 The start and stop trigger pin is EXTTRIG Connect the scan clock to OUT2 Note Two or more channels must be scanned when specifying an external scan clock Lab 1200 Series Boards Connect the start or stop trigger to EXTTRIG Hardware pre triggering
16. whether that motor is defined in the coordinate system In the example motor 1 is defined in coordinate system 1 The orange text color indicates that the CS defined in CS Scale Cluster s caption is being addressed The CS Definition Cluster is a derivative of the larger cluster and can be used in conjunction with PmacMotorsPVE on your application panels Coord Defined Bool Output Value Double Coord Defined Bool Output Value Double Coord Definition String Motors PYE Cluster The lower portion of the panel is a modified PmacCoordSpecitfy cluster used to specify a motor coordinate system and conversion from encoder counts to coordinate system units The modifications were made by replacing individual control items in the stock cluster with types that are more appropriate The orange numeric position indicator and its caption indicate the motor definition within the specified Coord Number 62 Application Basics PMAC PanelPRO User Manual CS Definition Cluster CS Scale Cluster Definition String Scale Factor Defined LLELCCCCe Coord Number Coordinate System 1 Conversion between encoder counts and coordinate system units are supported for Individual motors and arrays of motors Coordinate Specify Cluster Coord Sys1 w Motor __ Motor Position E i Convert Bool F EE ooo Menu rings are great for selecting motors and coordinate system numbers However they start at zero so remember to add
17. 3 j SELECTOR is DIR HOME HOLD ABORT 3 6 x bo SAA ore ALL FREQ ON OFF 7 D PWR y o Haw FEED RATE one Application Basics 67 PMAC PanelPRO User Manual The diagram shows that PMAC is queried for the contents of the three locations and then converted into appropriate types for processing The selector field is extracted as are the individual control status bits To make this panel control PMAC use the same control layout and generate the appropriate commands by borrowing portions of PmacMotorJog etc 68 Acc Disp Dew oe fc eo t Open mee a ee ciil 2 Send E El ang T SELECTOR E of a Feed Hold E Bo gt aus i n Jem Resp ngia Lono Hie A m t E o E m t m t o a E A PMAC PanelPRO User Manual DEVELOPMENT TOOLS Serious PMAC configuration tuning and setup require the use of Pewin 32 Pro Once this step 1s completed development of the PMAC Panel Pro application can begin PMAC Panel Pro supplies a number of tools and application VIs to aid in this process and provides architecture for adding more There are ten standalone development tools covered in this chapter They make extensive use of the ICVs introduced previously and form an excellent introduction to the PMAC Panel Pro integration IC Vs introduced later in this manual e PmacTerminal A basic ASCII terminal with useful ICVs for monitoring the coordinate system and motor status In addition several new I
18. Bool F Output DPR Numeric Cluster The code for the CIN is shown here To use the macros include the file PmacDPRNumericCINCluster h located in PmacDPR Include Next code h PmacDPRNumeric Macros include PmacDPRNumericCINCluster h include lt pmacu h gt include lt dprrealt h gt typedefs typedef struct int32 M444 1323 float64 M445_Dbl int32 M446 Mask_132 LVBoolean M446 _XOR_OR LVBoolean M447_Bit LVBoolean M448 _ Bit t TDI typedef struct int32 M444 i32 float64 M445_Dbl int32 M446 Bit Field LVBoolean M447_Bit LVBoolean M448 _ Bit TDZ CIN MgErr CINRun int32 Device_Number_132_0_ LVBoolean Ser Get Bool F LVBoolean Response_Available_Bool_F_ TD1 Input_DPR_Numeric_Cluster TD2 Output DPR Numeric Cluster int32 DevNum Device_Number_i32_0_ Using the macros PmacDPRNumericDWord Set_Get_Bool_F_ 0xE0O0 Input_DPR_Numeric_Cluster gt M444_ 132 Output_DPR_Numeric_Cluster gt M444_132 PmacDPRNumericDouble Set_Get_Bool_F_ ORE OL Input_DPR_Numeric_Cluster gt M445_Dbl Output_DPR_Numeric_Cluster gt M445_Dbl PmacDPRNumericDWordMask Set_Get_Bool_ F_ UxEO2Z Input_DPR_Numeric_Cluster gt M446_Mask_132 Input_DPR_Numeric_Cluster gt M446_XOR_OR Output_DPR_Numeric_Cluster gt M446_Bit_Field PmacDPRNumericDWordBit Set_Get_Bool_ F_ OES X e 8y Input_DPR_Numeric_Cluster gt M447_Bit Output_DPR_Numeric_Cluster gt M447_Bit Pmac
19. DPR location is set The mapping of PMAC addresses to PC addresses is involved and requires a bit of work to understand In general each 24 bit PMAC word requires one 32 bit PC word For PMAC specified as M447 gt DP DE03 the offset should be E03 Device Number 132 0 rpp Response Available Bool F aa Re EGE ae Output Value i32 Input Value 2 DPR Dual Ported RAM 159 PMAC PanelPRO User Manual e PmacDPRNumericDbl This VI is used to Set or Get PMAC double M Variables defined in DPR as M447 gt F DE03 PMAC handles the translation of PMAC s representation into Intel format when the F specification is used Device Number 132 0 en DPA eee Response Available Bool F RAE EE Dutput Value Dbl Offset P Input Value Dbl e PmacDPRNumericWord This VI is used to set or get PMAC long M Variables defined in DPR as M447 gt DP DE03 where the equivalent intel representation is 16 bits PMAC handles the translation of PMAC s representation into Intel format when the DP specification is used Device Number 132 0 men IPR eaaa Response Available Bool F eee eo Clutput Value i16 Offset P Inout Value i16 The implementation of these VIs closely follows that used by PmacMemory and PmacIVar The VI will get the specified value unless the Set Get input is true in which case it does a set operation The diagram shown below demonstrates how this is done with a Call Library VI using the PmacDPRSetD W
20. Gathering Automatic copying of user specified data to the host Of these seven mechanisms one through four are completely supported by the PmacDPR collection of VIs Mechanism 5 is not required in that the same capabilities albeit slightly slower are provided using the existing VIs Mechanism 6 is way beyond the requirements of anything a developer should attempt with PMAC Panel Pro Generally PMAC does not use mechanism 7 In this section four collections of VIs are introduced in PmacDPR that provide the capabilities required for mechanisms 1 4 These are PmacDPRFixedBack Fixed Background data buffer PmacDPRNumeric General numeric access to unallocated DPR memory PmacDPRRealTime Fixed Real Time data buffer PmacDPRVarBack Variable Background data buffer In each of the four collections contains e A configuration VI to enable and configure the operation e VIs to read or write the data using convenient clusters and types e VIs to buffer multiple data samples into vectors for charting and analysis e Examples of all capabilities Several indicators and controls are provided to handle the data in easy to use clusters In many instances previously introduced concepts and clusters are used in ways that tightly integrate the new capabilities available through DPR into PMAC Panel Pro s familiar architecture Once the structure of a configuration fetch and vector VI are understood for one of the collections the other
21. LabVIEW example that performs repeated acquisitions synchronized by the external trigger supplied by EQU1 using PMAC s servo clock as the scan clock In the default version of the example channels 0 1 and 2 will be sampled at PMAC s default servo clock of 2262 Hz The waveform chart in the panel below shows a triangle signal the EQU trigger pulse and the servo clock Run this VI by selecting Trigger Servo in the menu ring and clicking the Run DAQ button on PmacDAQMove after the PLC is configured and enabled and the motor is jogging If the motor is not jogging the VI will wait five seconds for the trigger and then time out The EQU signal is configured to be active low The jitter in the EQU signal can be seen more clearly in this example The analog signal is now sampled synchronously with the servo clock Note that the servo clock trace in the chart is even caught once on CH2 For instructions select Show yl Info from the Windows menu device choose trigger type transposed waveform graph at START OR STOP i00 J TRIGGER channels Ga a 40 fiz n n S 5 0 servo Elo number of scans pretrigger 0p to acquire Scans 250 i 25 7A O time limit sec trigger edge Pee co falling ae l l l input limita e 0 000000 100 000000 49 00000 x0 Brut SC ar ER gek ime out el EE a i m PMAC and NI DAQ Interfacing 135 PMAC PanelPRO User Manual Further Sampling Options The three examples presented
22. Limit SWItch ccccccccccccccccccscseecseccceeeeaneeeeeeeeeeeeaeeeeeeeeeeeaeeeeeeeeeeeeaaaeeeeeeeeeesaaaeeseeeeeeeessaaeaseeeeeeseaaaaess 106 Homing from PLC and Motion Programs oeeeesesssnnnneenssssnnnnnnsssseeennnssssseersssssssssreressssssreressssssrerenssssseeresssssne 106 Piac omne IY ae e E a E E E E 106 Configuring the Position Capture TriggeT eeeeeeeeesssssssssssseerrressssssssssssseeeerrresssssssssssssseeeeeeereresssssssssssseeeeeee 107 Monitoring the Home Position Capture ccccccccccssscccccccccccneseseccceeeaaesseeeeeeeeaeeeeeeeeeeeeeeaaseeeeeeeeeeeaaaaeseeeeeeeeesaaaassees 109 Home Position Transformations sirarni inini an a EEE E AA A E EE E AEA Ill Pe aS Waves PILK Programmis canter sccatenssaceonansetaonattas tenis cowed onan soda EE a a SEE 113 ENCODER CAPTURE AND COMPARE OPERATION cccccccssssssssscsssssssscscscccccccsssssssssssssssssssssssssssssssscees 115 Pmiacl ACOGETPOSIMONE X AAI sereine aE E EErEE a ENE EEE EEA a ENER 115 Encoder Position Transformations ooooennnnnnnnnennnssseennnnssssseeronssssseeresssssseeerossssseerreosssssrrrorssssseeeereessssseeerersse 115 Position Capture for Non Homing PUurposes ccssssssseeeeccceeeceeeeeaaaaesesseseeeeeeeeeeeeeeeeaaaaeeessseeeeeseeeeeeeeeeeeneaaas 117 PLC Capture Flag PrOCOS SING vacncsierocutescsassceesdinnasinsaceatenetiadentyisenstauedeacedntadaabiomoduntdesaevoiredehastntacmetenediadeatesdeatiensdenie 117 PmacEncoderCaptureExanmip sacian caaea
23. Open communication to PMAC using the PComm 32 Pro device driver Check type ROM date and ROM Version Provide Device Number for other VIs Select the mode of communication using the Communication Mode drop down menu To make the selection permanent make the selection the default use the right mouse button and select the Data Operations Make Current Value Default option This must be done in conjunction with the options available on the PMAC control panel Device Number i32 0 pen e PmacDevClose Close the PComm 32 Pro device driver PMAC will continue running as programmed as long as power is applied Dey Device Number 132 0 Case All basic PMAC Panel Pro application diagrams will open PMAC and pass the device number into the application s main loop where the primary logic is executed Structuring the main loop this way establishes a dependency between the opening of the device and the execution of the rest of the application Application Basics 27 Open the Device If desired the default configuration of PmacDevOpen needs modification set as default and resave Double click PmacDevyOpen on the left and execute it The VI fetches the Pmac Type Rom Date and Rom Yersion thereby verifying the corect operation operation of PEomm3 Here is a stop button to gracefully halt application execution Note the Mechanical PMAC PanelPRO User Manual If you want to be careful close the device after you are done This ts
24. Overview I PMAC PanelPRO User Manual Live Circuit Contact Procedures Never attempt to remove a person from a live circuit with bare hands To do so is to risk sure and sudden death If a person is connected to a live circuit the following steps should be taken Call for help immediately De energize the circuit if possible Use a wood or fiberglass hot stick to pull the person free of the circuit Apply cardiopulmonary resuscitation CPR if the person has stopped breathing or is in cardiac arrest Obtain immediate medical assistance Electrostatic Sensitive Devices Various circuit card assemblies and electronic components may be classified as Electrostatic Discharge ESD sensitive devices Equipment manufacturers recommend handling all such components in accordance with standard ESD procedures Failure to do so may void the warranty Hardware Interfaces When interfacing PMAC signals with any other data acquisition equipment use extreme caution to avoid shorting signals to supply or ground potentials Furthermore observe all signal load voltage and current limitations Failure to do so may void the warranty Magnetic Media Motors and amplifiers may generate strong magnetic fields Do not place or store magnetic media tapes discs etc within ten feet of any magnetic field Technical Support Delta Tau will respond to any questions or concerns regarding PMAC Panel Pro Contact the Delta Tau Technical Support Staff using the f
25. PIO COMMUMCATON BUG e Sasis nnna E EA EEEE E 10 Trouble Shooting PMAC Panel Pro Communi cation ccccccccccccccsssssssssseseeeeeceeceeeeeeeaaaaaesseseseeeeeceeeeeeeeeeaeaaaeseesees 10 PMACPFPANELCPROBASIC arcs oss AE a a edocs decevereiaves 11 PMAC Panel Pro and PMAC as Client and Server ccccccccccccsssssssseeseeeecceeeeeeeeeeeeeeesaaaeseessseeeeeeeeeeeseeeasaaaaanseees 1 Application Development Components ccccssssssssseeeeeeeceeeeeeeeaaaseesseseseseeeeeeeeeeeeeeeeeeaaaaesssseeeeeeeeeeeeseeeeeaaaaaaaeesses 12 FEWN D2 TTO T MAC LECU Con tic ia EE A niet satan E E eta ebossciaesaeamecstaees 12 PtalkDTPRO ActiveX Controls for Visual C and Visual BASIC 1 cccccccccceccccceceeceeeceea sae sessessseeeeeeeeeseseeeeaaas 12 PMAC Panel Pro PMAC for LabVIEW 5 0 ccccccssssssccccccccscscsnssseecceccaaassseeccecsaaausseesececsauanseeeceessaaaaasseescesaaananes 12 PMAC Panel Pro Interface to PCommM 32 Pro 0 cccccccceseecceecececceeeeaeseeseseeeeeeeeeeeeeeeeeeaaaaeseeeseeeeeeeeseeeeeeeaaaaagaeesses 13 PEV CE NONO OCI rE tn on vi einen coc ET OETA eo dadic rhe ea eon oats ad ate EO 13 Query RESPONSE Communicall l savisessa EENAA SEANAR NENEN alae T EUNE 14 Lab VIEW ana PMAC Numeric Data sssrini a E e a eat 14 POO N O e E E 15 DPD O D E T a E E adeeuacie ss 15 PFMAG Panel Pro Oromi zati Oses ia ESETE E EEEE EEEE EENE 15 Device Management ANd COMMUNICALION cciviicsics ei anaE EEEE EAEE EEEE EENE 16 DUET VCS OS TI CC
26. PMAC Panel Pro SOftWAL EC occccccccsseccccccccc cen eeeeeece eee eeeeeeeeeeee eee aeeseeeeeeee Gass eeeeeeeeeGGGasesEeScEGGGGG AAA EEEEEEE AAA AAEEEEEEEGEAEEEEEEEES 4 Commis uiine The Device Drivel oss cover eneroicranwuenescnntesdven send seueunisvexneanehapeized heseueudsanezoldsanpuentenenOantecsuendzenwnnddhesnonneseoeuutses 5 Tesine the Device CL ta sence tects enw tdestiacnstadna R E E EE EEE iene E E E EO ERa EOE R Raen E 5 Contigurine LAG V UB Wats cnacaneinns adtcnenseizesivansionnwedieatueddvan net ea EE e Ee Eaa A EEEn ERa ANETE E Eaei entices 6 Installing the Release View ccccsccccccccccssseeeeececceeeneeeeeseeeeeeeeeeeeseeeeeeeeaaeeeeeeeeeeeaasaeeeeeeeeeeaaaasaenceeesaaaassseeeeeeeaaaaseeeees 6 Creating a Custom VIEW oseesssssssseeessssseeersssssseeerrsssssseeeresessssseeeressssseeeeressssseerresssseeererssssseeeesssseeeresssseeeeesssseeeeet 7 MASS OR O e E E EA A E E E acateseteseasacsiane 7 TTA ics et cos waco ecg sc sc ease esa es cto stag ea gu gos ass a atc E secede se ao ie eae E S Configuring PMAC Panel Pro Communication cccccccceeccececeeeeeeeaaeseeeessseeeeeeeeeeeeeeeaaeaeessesseeeeeeeeeeeseeeeeeeeaaaaagees 8 Testing PMAC Panel Pro Communmication ccccccsssssssssseeeeeeeeeeeeeeeeeeaeseeeeseeeeeeeeeeeeeeeeeaaeseeeeeesseeeeeeeeeeeeeeeeeeeeaaaaaaess 9 PMAC Communication 1 V QiQD1OS oi casaccerssiavedsiatatorssctetasaiataninsssiardsecedstsesests Wubeatatertibbavessiwtadesaadeatnasaeeasrsiarddoeotesiea 9 PCOmm 32
27. PMAC reports command line errors The preferred setting is I6 1 In this mode PMAC errors are properly parsed by PMAC Panel Pro and reported to the user with a pop up dialog I58 DPRAM ASCII Communication Enable This parameter enables or disables the DPRAM ASCII communications function When 58 1 PMAC Panel Pro sends and receives communication through DPRAM When I58 0 communication is done via the Bus or Serial Port Enabling ASCII communication is not required to access DPRAM available using other PMAC Panel Pro capabilities Using DPRAM ASCII communication modifies 3 and will disable PMAC Panel Pro s ability to properly parse error messages effectively The preferred value is 158 0 This implies that Bus or Serial is the preferred Communication Mode to be specified for PmacDevOpen This has little impact on overall performance and does not preclude the use of DPRAM for memory mapped purposes PComm 32 Pro Communication Buffers PMAC handles commands and responses in a very simple manner PMAC commands that generate responses place the responses in an internal buffer that is transferred into the caller s buffer If the entire response does not fit in the caller s buffer the data is held in PMAC until the remainder of the buffer is fetched New commands sent to PMAC flush the response buffer prior to executing the new command Hence responses that are not fully retrieved are lost Communication with PMAC via PComm 32 Pro requires
28. PmacEncoderCaptureFlag Encoder Status Control Cluster can be used with PmacEncoderStatControl Encoder Status Flag Cluster can be used with PmacEncoderStatFlags Encoder StatusContral rt Position Capture Control gt Capture Flag Control ERcoder Status Control Cluster Encoder Status Flags Cluster e PmacEncoderRegServo Query PMAC for the two position registers containing commutation phase and servo position Servo Position is actual encoder position in counts referenced to a power up reset position of zero Encoder Phase is used internally for commutation Device Number 132 0 Enc Encoder Phase i32 Encoder Number 132 1 16 1 Servi Serva Position te e PmacEncoderRegisters Query PMAC for all registers for Encoder Number Assemble the values into a PmacEncoderRegisters Cluster Device Number i32 0 Encoder Number rt 1 161 7 Generally the remaining members of this collection will not be used in the application but are provided for completeness These are Device Number 132 0 Encoder Number 132 1 16 1 Encoder Registers Cluster e PmacEncoderRegTime e PmacEncoderRegDAC e PmacEncoderRegCapture e PmacEncoderRegADC Encoder Capture and Compare Operation 125 PMAC PanelPRO User Manual 126 Encoder Capture and Compare Operation PMAC PanelPRO User Manual PMAC AND NI DAQ INTERFACING In previous sections PMAC s position capture and compare capabilities were introduced PMAC Panel Pro provides a number
29. Pro an entirely new world of motion control applications and capabilities opens Motion that triggers acquisitions and responds to data gathered by SCXI VXI and industrial automation networks such as DeviceNet and Field Bus is now possible using LabVIEW s popular and powerful graphical programming environment PMAC Panel Pro is an easily extensible set of more than 250 Virtual Instruments VIs Indicators and Controls that communicates with and controls PMAC from LabVIEW It allows creation of a LabVIEW application that can monitor and control everything PMAC is doing using LabVIEW while at the same time preserving an understanding of the existing PMAC interface Manual Layout This manual explains how to install and use PMAC Panel Pro to develop custom applications It assumes that the system integrator and PMAC Panel Pro developer has a basic understanding of the PMAC motion control board and LabVIEW It does not cover the hardware and electrical configuration of PMAC or the use of Pewin 32 Pro If questions about a particular aspect of the installation arise do not attempt the task until a thorough understanding is gained Contact Technical support at any time during the installation Refer to the Technical Support paragraph below for information Use Caution When Running the Examples PMAC Panel Pro has many examples to introduce itself and verify that things are working properly Review the following issues before actually running the ex
30. Reseed odneo Backlash ea These clusters are organized to reflect the 4 bit organization of the status words The first column is for the first four bits 23 20 the second column for the second four 19 16 etc Note that some bits are not defined They are reserved or for internal use Also note that for motor status word two 3 bits are interpreted as the coordinate system to which the motor is assigned i I i ii Status Indicator Colors Human factor considerations play a major role in how colors are assigned to an application s status indicators Is green good Is it true If green is true and red is false then an Amplifier Fault is green Setting up the definitions can be very confusing In PMAC Panel Pro status indicators attempt to convey a generally useful meaning by the LED s color and text To clarify this a few examples are covered in more detail Feel free to change colors and text to reflect the intent within the application e Following Errors These are red when there is an error For these status bits that means the bit is true When the bit is false the indicators are gray there is no error Gray can generally be interpreted as not true or not dangerous The text in the indicator says what the indicator 1s Warning Following Error either way e In Position This indicator is red when the motor is not in position the bit is false Its text says Not In Position The indicator i
31. The CIN returns two clusters and a Boolean indicating whether the fetch operation succeeded The CIN is only executed when the input Enabled is true If Wait for Valid is true the while loop will execute the CIN until New Output is true thereby waiting until the fetch from DPR succeeds Repeated requests for DPR data is done by the diagram rather than the CIN code If the C code waited in a while loop that was never satisfied the application could not be aborted EEH Eer hp Tip eaaa TF Motor al Cluster Code Interface Node ode Interface Node 6 Motor PYE Cluster DPR i AEA me Bale a New Output Bool E dducu cess sA se deucieishsauceshsnausiakeceocebansecdbcnskzecdnakeds i This VI s CIN code has a simple structure but places many calls to PComm 32 Pro This is the reason this VI was selected to implement with a CIN rather than 20 or 30 Call Library Function VIs To simplify the code several lines from the actual source have been removed to demonstrate the basic ideas 146 DPR Dual Ported RAM PMAC PanelPRO User Manual CIN Source File include extcode h include lt pmacu h gt include lt dprrealt h gt Types Defined by LabVIEW When the Stub was Created typedef struct y TD13 typedef struct int32 ServoTimer 132 float64 float64 float64 float64 float64 float64 Comm ad Pos DbL Position DOL Velocity_Dbl Follow _ error Dbl Master_Pos_Dbl Comp_Pos_Dbl invsz DAC 1323
32. Value aaa aa aa a a at Update a e in PHACPanel Sica the PLC tsn t doing itl no PLE j Sub GF Comp Setup PLC ong PIDI PLO SW Compare Inte on E Setup and are PLC Compare operations Stop E da T At the bottom of the diagram is logic to service the panel s P101 slider when it changes Changes in the value update P101 and enable the encapsulated PLC PmacPosCompSetup covered earlier Above this is the wrapper VI for PmacPosCompGen The Disable Comp Pulse panel button can be used to turn the PLC on and off as desired When this PLC is not executing a compare trigger occurs and software increments are true the case to the right executes and computes the next Compare Value The final piece of the example is PmacEncoderTrigger which was covered earlier In this example the Enable Compare input is true whenever Enable Compare or software Update are true This updates the encoder registers thereby arming the compare operation A noted earlier PmacEncoderTrigger handles the configuration of compare operations and monitoring of capture and compare flags The implementation of the VI is complex so it is not covered here However one of its pieces may be of use in the application The following VI is used by PmacEncoderTrigger to enable and configure compare operations e PmacEncoderCompare This VI reset Encoder Number s compare equal function and set the position register using Input Compare Position when E
33. Variant Cluster PUM Long Cluster The purpose of the 2Var and Var2 VIs is to convert clusters of specific types to and from neutral PmacPQM Variant types for building arrays that bundle PQM cluster controls into a single item e PmacPQMaArray Set or Get a collection of PQM variables as defined by an array of PmacPQM Variant clusters Device Number 132 0 ona Mew Output Bool Set G et il Input Variant Array The use of arrays greatly simplifies the development of PQM configuration panels for your applications PmacProgSubVI VIs created by PmacTerminalEdit accepts the arrays as inputs and provide them as outputs This allows the updating of the program P Q or M Variables prior to actually executing the program and monitoring any PQM variable used by the program as it executes erent Output Variant Array 96 Encapsulated Motion Programs and POMs PMAC PanelPRO User Manual PmacPQM Datalogging PMAC Panel Pro supports data logging of PmacPQM clusters using the VIs in the PmacFile collection These can be modified to support record attributes such as time stamps in support of your particular needs e PmacFileDatalog Manage datalog operations for type neutral PmacPQM Variant Arrays Operations as specified by the radio buttons in Datalog Control Cluster are performed when Append Read is true A file must be selected prior to executing the operation using the Create Open button or New File button in the cluster The fil
34. X Y Z axes and rotary U V W axes then the program executes its moves using the motors assigned to those axes The coordinate system status reflects the state of the executing program and the combined state of all motors in the system If all motors are in position then the coordinate system is in position If any motor has a warning following error then the coordinate system has a warning error Coord Status Cluster Coord Yar Cluster Ho Program 500 ix87 Default t A mS Running 50 ix88 Default t S Curve m5 aera ee 1000 00 x89 Default Feedrate t M see doc o e S 1000 00 ix90 Feedrate Time Units see doc Pa a 1644 _ ix95 Feedhold Decel see doc Continuous Continuous Motion Reg Motion Hode Run Time Amplifier Error Fault Warming Fatal Following Error Following Error C 5 1 aiskiai Her Output B ool F Seem Output Coord l ar Cluster i S oo x96 Circle Error Limit see doc 0 x91 Default Program Number x92 Move Blend Disable ain i g 4 5 Coord Humber i l Yar Set 4 E 3 J a 64 Application Basics PMAC PanelPRO User Manual The diagram also has a familiar architecture Coord l ar Cluster Coord Status Cluster a z Coord Ctr StatEr og EE Coordinate System Status ICVs There are as expected indicators for both coordinate system status words and a few miscellaneous VIs that will be introduced in
35. _ Device Number 132 0 YJy pgp Convert To Coordinate Bool Coordinate System 132 1 8 pews Command Executed Bool F Motor Number 132 1 8 1 mm ee Coord Specify Cluster Motor Jog Control Cluster When buttons in the cluster are clicked the appropriate on line command is assembled and sent to PMAC The diagram for this VI illustrates the general architecture PMAC Panel Pro uses to generate on line commands from control clusters User ils might want to know when a command was executed T Command Executed Bool F Assemble the appropriate command based on which button was hit Device Number i32 0 B utt E utt Butt wa SStr SStr S Str E Peer rere errr teri rr rer rrr errr ey oa ede ty ge qn E GSES a 7 SB 7 I a I EEH DEL Motor H umber iaz 1 8 1 semble a Coord Specif Cluster og commands are always in encoder counts i If the control value is in C S Units convert them Coord Specify Cluster Convert To Coordinate Bool Note If generating Motor or C S specific commands send the Motor or C S number along with the command There are a few things to note about the organization of this VI Unbundled command buttons are used in conjunction with a string format VI and PmacButtSendStr to create and send an appropriate command to PMAC The position parameter required by some commands is converted into encoder units if the actual control value is in C S units Using
36. a iiai iaaa AAN Ea E EE SEa aiaiai 117 External Triggers for Position Capture cccccccccccccscsessscceeceeeeeneeseseeceeeeeaenseeeeeeeeeaaaeeeeeeeeeeeaaaasseeeeeeeaesaaaaeeeseeeeeaas 119 PMAC Position Compare Operation sci tascecaaavacnidecuneccencandacpnceiadieacnadassacidbncidcaubedenaddiaduddncdanene den desdaiiouddessendacdacendees 119 NOLO MNG laa Ges l a T E COPE AE A CPE E Tere A E rere E nee ere rere 120 Pre loading the Compare Position sucssiseriisiieninii einni nin tae AEN taal saisiaks EEEE ated heise 120 In ecerine TRETAL ACON ariii E AR RAE A O N A A A 120 TECC OO ATG e O a E a A E E A E hepseeesaaaese 120 PmacEncoderCompare eel escencia ei aaa o aaa TEES Sa Oa aaia 121 Meihod TSPC OPTa ON rissin a A A A A A AA E AR 124 Method 2 ONG n0 ON CTO O eiei a E a aa accede 124 Method 3 PMAC Panel Pro Interval Generation onnnnnnnnnnnnnnnnnnnsssssssssssssseeereresssssssssssssseeereresssssssssssseeee 124 Pmac Encoder REOSE Seion a E EEE Ta 125 ENOT INCOUS FOV NC OCS S rii i E AE VEA AOE oc TEE OTONI RATETA 125 Table of Contents iii PMAC PanelPRO User Manual PIMAC AND NEDAO INTERFACING coression aaa aaa aaia 127 Extemal PMAC SISTA ls a acetsceancectssedccnciasaunigdaneninghaieamaganseea sa tadaasdeunnesoentaneusependedaaaanaacaap eiengenh enous aiar aani eiri aiii 127 Compare E quals Outputs JE OU scssasasassiiasearnraschcassnsceuasanandedeaanecdacsansoiesseaacaaadaaoeacsoinacsaustaaiebiaanesdans Ter SNO OE EES 9 onna EN NN
37. a later exercise The PmacMotorsPVE cluster generated by PmacMotorsPositions is unbundled and the array of values is passed to the PmacMotorsPlotSelect VI e PmacMotorsPlotSelect Motors Array contains positions velocities or following errors for all motors on your PMAC Select Bool Array defines which motors are copied into Selected Motors Cluster for plotting on LabVIEW strip charts XY Point Cluster contains two values for X Y plotting New Selection is true when Select Bool changes and indicates the Plot Attributes Array of Clusters and X Y Plot Attribute Cluster contain new information for updating plot legend attributes iia Selected Mobos Cluster Hotors Array OTON xy Foint Cluster na Mew Selection Bool F select Bool Array Plot Attributes Array of Cl EE 47 Plot Attribute Cluster Setting the plot attributes is done in the case structure in the lower right of the diagram below Plot Attributes Array of Clusters contains an Active Plot index Plot Color and Plot Name as supplied by PmacMotorsPlotSelect When New Selection is true the case is executed and the array is auto indexed The cluster of attributes is unbundled and used to set the three attributes for the plot rrr d One important thing to note is that Motor Number and Coord System are specified using LabVIEW rings These controls start their indexing from 0 not 1 Hence to use them to specify legitimate motors and coordinate systems they must be incremented
38. after all other DPR mechanisms have been enabled PComm 32 Pro might and sometimes does move things around when reconfiguring DPR If more than one buffer is created do not delete a previously created buffer Again PComm 32 Pro will shift things around and it is likely that the remaining buffers will contain garbage If a buffer is deleted delete and recreate the remaining buffers If the Enabled box is un checked that buffer is deleted Chances are that the remaining buffer will give out garbage data Un check the remaining buffers and then re check them Things will now behave as expected The diagram for this example demonstrates how easy it is to create and access a buffer At the top left is the VI to handle the Gather Select Cluster Review the PmacTerminalGather section to answer any questions On the top right are the PLC and motion program handlers DPR Dual Ported RAM 167 PMAC PanelPRO User Manual ri gt _ Fr pa Ho Ea Gather Selection Items Enabled Enabled PLC Enable PLC PLE Enabled FF Taub yl JE esata ita oa een nea rror rir a pe Gat i es Gather Select Cluster Oper Show PQM1 Panel a e m a BGB Status Cluster Group 2 T CPR eee Y UAC ery A BUNT War Gather Gather Spec Cluster Cluster ale BGB Status Cluster A gE Ged GEG There are two almost identical configurations to handle the two buffers Each consists of a configuration VI PmacDPRVarBackConfig and PmacDPRVarBa
39. application develop logic to save the Log Buffer to a file Realize that the size of this buffer could grow very large if the application uses status monitoring ICVs and the contents of the log buffer is not saved and emptied at reasonable intervals PmacTutor3 Sending Commands Using Buttons PMAC Panel Pro contains the PmacButton collection of VIs that send a command string to PMAC when an input button state is true The applications panels will make constant use of these capabilities e PmacButtGetStr Send Command String to PMAC and wait for a response when Button State is true When Response Available is true Response String contains the response If Response Available is false Response String defaults to the empty string Device Number 132 0 Command String Button State Bool e PmacButtSendStr Send Command String to PMAC when Button State is true Response Available is true when PMAC has processed the command Device Number 132 0 Command String Button State Bool Response 4yvallable Bool F Reponse String Response Available Bool F Use PmacButtGetStr for commands that expect responses and PmacButtSendStr for commands that do not expect responses PmacButtSendStr does not return a response so the input Button State is passed through to facilitate execution sequence dependencies Application Basics 33 PMAC PanelPRO User Manual The panel shown here demonstrates the use of these VIs the conversion
40. are shown in the ring Click Begin and the Program Execute cluster loads the program into the list buffer from PMAC Click Run and the program will begin executing Watch the execution by clicking the cursor in the screen The currently executing program line will highlight and track the program through its steps This dynamic display only works when the cursor is in the screen Coord System A few issues about PMAC program execution must be understood PMAC pre computes moves several lines ahead of the currently executing motion to allow motion blending Because of this the highlighted line may not reflect the moves the machine is currently executing For detailed information on this see the PMAC User Manual 80 Development Tools PMAC PanelPRO User Manual The implementation of the tool uses two VIs to generate program execution commands and monitor the currently executing program line These VIs are e PmacProgExec Interactively executes the program specified in Program VI State Cluster in response to button clicks in Program Execute Control Cluster New Program is true when Begin is clicked and Program List Cluster contains a new listing Command Executed is true when any button in Program Execute Control Cluster is clicked Device Number i32 0 Program vl State Cluster Program Execute Control Clu New Program Bool F Program List Cluster Command Executed Bool e PmacProgDebug Query PMAC for currently executing li
41. at the sample motion program PmacPQMTest pmc that PMAC will run pmc is used by Delta Tau software tools to indicate a motion program Note that the associated encapsulation VI PmacPQMTest vi was created by PmacTerminalEdit PmacPQMTest pmc gt USE CS amp 1 Parsed by PMAC Panel Pro during download Close Always close any open buffers amp 1 Define the CS 1 gt 1000x nil gt Redefine M1 as standard output port mlay TTO 8 6 U open prog 32 Parsed during download clear Otherwise appended to buffer linear Set move modes abs ta P1 Set move Accel time is Pl e250 tm1500 ml Show bit on port move X to P2 Encapsulated Motion Programs and POMs 93 PMAC PanelPRO User Manual X P2 DELAY P3 Delay for P3 mS ml Update the port X P4 Move X to position P4 DELAY1500 ta250 New move parameters tslz25 tm750 ml 4 Return home xO dwell 100 ml 0 close This program uses four P Variables to define its execution and motion 1 P1 Acceleration time for first few moves 2 P2 First X position 3 P3 Delay time after move 4 P4 Second X position Because P Q and M Variables are used to configure a motion or PLC program PMAC Panel Pro provides a collection of VIs to take values from panel controls and set associated P Q and M Variables for use by the programs Then start program execution The panel for the example shows a familiar set of indicators to monitor m
42. bit rollover are not handled by this VI When Enable Compare is true Encoder Number s compare equal function is reset and the compare equal register is set using Input Compare Position This value is interpreted as being in CS units if Covert is true and Motor Number is defined in Coord Number Otherwise this value is interpreted as being motor position in encoder counts Output Compare Position is a persistent copy of Input Compare Position when Enable Compare was true The occurrence of the compare equal condition is indicated by Compare Equal Bool being true This does not reset the latched condition When Encoder Number captures a position Position Captured is true and the encoder s capture register is queried and converted into Capture Position in motor position encoder counts or Coord Number CS units If Motor Number is not defined in Coord Number or Convert Bool is false the Capture Position is motor position in encoder counts If Convert Bool is true and Motor Number is defined in Coord Number the value is in CS units Device Number 132 0 Encoder Number 132 1 16 1 cc boo Positian Captured Bool F Coord Specify Cluster gug Capture Position Dbl Enable Compare Bool F Compare E qual Bool F Input Compare Position Dbl Output Compare Position Dbl External Triggers for Position Capture Using the HOME LIM or FAULT flags for other than their obvious purpose is very common in PMAC It requires a
43. controls the configuration of the eight inputs If it connects pins 1 and 2 the default setting the inputs are biased to 5V for the off state and they must be pulled low for the on state If E7 connects pins 2 and 3 the inputs are biased to ground for the off state and must be pulled high for the on state In either case a high voltage is interpreted as a 0 by the PMAC software and a low voltage is interpreted as a 1 Memory Mapped Access to I O Typically these inputs and outputs are accessed with M Variables In the suggested set of M Variable definitions variables M1 through M8 are used to access outputs through 8 respectively and M11 through M18 to access inputs 1 through 8 respectively This port maps into PMAC memory space at Y address FFC2 A collection of VIs to access these are found in PmacAcc Synchronous M Variables In a motion program when PMAC is blending or splining moves together it must be calculating in the program ahead of the actual point of movement This is necessary in order to be able to blend moves together and to be able to do reasonable velocity and acceleration limiting Depending on the mode of movement calculations can be one two or three moves ahead of the actual movement Why Synchronous M Variables are Needed When assigning values to variables is part of the calculation the variables will get their new values ahead of their place in the program when looking at actual move execution For P and Q Va
44. disable plc 18 close PmacPosCompGen pmc close Service Routine to Service Encoder Register open plc 19 clear if m116 1 m103 m1l05 Update next compare position ml105 m105 plol mlil 0 Reset control bit mili 1 endif close The PLCs can be downloaded and executed using PmacTerminalEdit and PmacTerminal or as we will show in a moment encapsulated with a wrapper VI and controlled from an application panel PmacEncoderCompareExamp This example demonstrates three methods for using PMAC Panel Pro to handle encoder compare operation These are extremely useful for synchronizing data acquisition operations with complex motion The three methods are 1 Using encapsulated versions of the PmacPosCompSetup and PmacPosComGen PLC s to generate position interval clocks 2 Directly setting an encoder compare position from the application for a one time position compare trigger Encoder Capture and Compare Operation 121 PMAC PanelPRO User Manual 3 By servicing the control status and position registers directly from PMAC Panel Pro The panel shown below has Motor Encoder and Coord System knobs a Motor PVE indicator and a Jog control cluster At the top left of the panel is an LED that flashes green when a compare equal condition occurs Below this is a cluster of three buttons that allow the configuration of the encoder control bits When these are properly set click the Configure Compare button to set the en
45. does not cover the internal operation or implementation of these VIs or members of these collections in detail They are involved and way beyond what most developers will want to know about PMAC Panel Pro Feel free to examine their contents and make changes as desired 76 PmacProgSelect Query PMAC for a description of all loaded motion programs by reading PMAC s internal buffers If First Time is true Menu String Array contains a sorted list of all loaded programs by program number The VI maintains New Selection Index as a state from execution to execution Translation of Program Selection Index into Program Number occurs when First Time Strings is true or Program Selection Index is not equal to New Selection Index New Output true indicates that Program Number New Selection Index and Menu String Array contain new data Device Number 132 0 Mew Output Bool F Program Selection Index Program Number ri First Time Bool F New Selection Indes 2 Menu Sting Array PmacPLCSelect Query PMAC for a description of all loaded PLC programs by reading PMAC s internal buffers If First Time is true Menu String Array contains a sorted list of all loaded PLC programs and their execution state by PLC number for the menu ring in PLC Select Cluster Button String Array contains information to change the description of the button in PLC Select Cluster so that it toggles the selected PLC s execution state when clicked The VI maintains New Selectio
46. empty buffers into which responses are placed The empty response buffers for PmacCommGetStr and PmacCommRespStr are created as 128 byte buffers If larger default buffers are needed the size of the buffer can be increased to 256 PComm 32 Pro internals cannot handle buffers larger than this PMAC Panel Pro handles larger response buffers internally using PmacCommGetBuffer Trouble Shooting PMAC Panel Pro Communication At this point it is assumed that the driver was successfully configured and tested as outlined in the Configuring the Device Driver and Testing the Device Driver sections If these steps were skipped review them now If Pewin 32 Pro or PComm 32 Pro are installed and they work the problem is with the configuration of PmacDevOpen or the communication I Variables e Inthe event that LabVIEW crashes when running PmacDevOpen reboot the computer to eliminate any damage to the driver and memory caused by the crash e Verify the correct operation of the device driver by checking the configuration using MotionExe or the Control Panel Applet When OK is selected from the setup dialog the driver attempts to contact PMAC and reports the success or failure of the attempt e Check the driver operation communication with PmacTest Pro or Pewin 32 Pro e Revisit the driver configuration and make certain that the device number and communication modes specified match those specified for PmacDevOpen Make changes to the VI and retest the communic
47. equal control bits The PLC enables the PmacPosCompGen PLC and disables itself Thus when P101 is changed the Comp Setup LED briefly turns green to indicate that the setup PLC is executing When it enables PmacPosCompGen the Comp Pulse LED turns green to indicate that it is active then the Comp Setup LED turns red to indicate that it has disabled itself This is all done using the encapsulated PLC Sub VIs If the motor is jogged now the PmacPosCompGen PLC will generate compare equal pulses every P101 encoder counts It does this by monitoring the encoder Compare Equal flag for the true condition setting the next position adding the increment for the next position and resetting the encoder s compare equal control bits Because the PLC handles the flags usually PMAC Panel Pro does not see the compare equal condition because the PLC services the trigger so quickly Even if PmacEncoderTrigger sees the trigger condition it does not service it Bring the trigger to the external world by clicking Output on EQU Line button and then clicking Configure Compare Do this before starting the Jog or enabling PmacPosCompSetup so that you do not interfere with PmacPosCompGen s handling of the encoder flags If the external EQU signal is configured connect an oscilloscope to the appropriate pins on JEQU or the E Point jumpers documented in the PMAC User Manual and see the generation of the interval pulses The next section will demonstrate how to use these p
48. external trigger The operation is set up and later serviced in software The actual latching is executed in hardware without the need for software intervention This means that the only delays in a position capture are the hardware gate delays less than 100 nsec thereby providing a very accurate capture function Trigger Condition The position capture register can be used both automatically as in the firmware homing routines that handle the register directly and manually where the program handles the register Manual handling of the capture register will be covered in a later section During motor setup x25 specifies which set of flags associated with one of the encoder counters is used for that motor It is important that the flag number match the position encoder number for the motor If using ENCI for position loop feedback use Flags1 HMFL1 LIM1 FAULT1 and CHC1 as the encoder index channel The trigger event that causes the position capture is determined by Encoder I Variables 2 and 3 1902 and 1903 for Encoder 1 Encoder I Variable 2 defines what combination of encoder third channel CHC Index channel transition and encoder flag transition trigger the capture If Encoder I Variable 2 specifies the use of a flag Encoder I variable 3 determines which flag usually the home flag HMFLn Once these have been configured the on line HOME command will use the position capture feature automatically Homing Homing is a PMAC f
49. here demonstrate that there are many options for triggering and controlling the sampling of the data e If the servo clock or the EQU signals are sampled along with the data a time code is synchronized with the data e Ifa gather is performed on one of PMAC s position or velocity registers while using position compare intervals the sampled data can be related with precise cycle by cycle motor positions or other motion characteristic Using these approaches servo accurate positions can be achieved for every sample of the data With LabVIEW s analysis tools detailed data reductions can be performed that relate position velocity and physical measurements Other Interface Options There is no reason that the DAQ boards DIO cannot be used to control PMAC s MIO inputs and vice versa Multipurpose DAQ boards having timers can be used to generate position capture triggers as can the board s D A capabilities Other possibilities include the use of the timers to generate time base control for PMAC Although not covered here use the sample PMAC generated clocks and signals to trigger and clock bench instruments used to communicate with using GPIB 136 PMAC and NI DAQ Interfacing PMAC PanelPRO User Manual PCOMM 32 PRO CODE INTERFACE NODES This section documents a basic framework for developing LabVIEW Code Interface Nodes CINs using Microsoft Visual C This topic is important if e More sophisticated control over a VIs imple
50. in either bus or serial communications applications and of course for actual serial communications In a standalone or bus communications application there is no need for a host drop on the cable As is the case for the communications lines the clock lines cannot be tied from the RS 422 port of a PMAC PC to the RS 232 port of a PMAC Lite With the RS 422 option on the PMAC Lite Opt 9L connection to a PMAC PC is possible but the connector pinouts are different If serial communication is not being used but the serial data lines are connected with the clock signals it may be desirable to deactivate the serial port to prevent noise on the lines from creating input command characters to PMAC On PMAC PC PMAC Lite and PMAC VME this is done by setting jumpers E44 E47 ON on PMAC STD by making DIP switches softwarel 5 to software1 8 all off Be aware of the fact that J4 has 5 VDC on pin 10 General Purpose Digital Inputs and Outputs The PMAC JOPTO connector J5 on PMAC PC Lite and VME provides eight general purpose digital inputs and eight general purpose digital outputs Each input and each output has its own corresponding ground pin in the opposite row The 34 pin connector was designed for easy interface to OPTO 22 or equivalent optically isolated I O modules Delta Tau s Acc 21F is a six foot cable for this purpose The PMAC STD has a different form of this connector from the other versions of PMAC Its JOPT connector J4 on th
51. is shown below Note that the Device Number Motor Number and Buffer Length are all passed to the CIN when Enable is true The CIN fetches the DPR samples and builds the vectors on every execution of the CIN 99 of the time the CIN returns a false value for New Output because it still has more samples to accumulate When it has accumulated Buffer Length of samples it copies them to DPR Real Time Vector Cluster and returns a true for New Output Enabled Bool T Device Number 132 0 Coord Defined Bool Output Aray Double Coord Definition String DPR Real Time Vector Cluster The CIN code for this type of VI is a bit more complex than those presented already It requires a data buffer for storing the accumulated samples and it requires some manipulation of the vectors in the returned cluster As defined the data buffers are global thereby making them accessible to any reentrant copy of the VI The topic of handling arrays in CINs is thoroughly covered in the LabVIEW CIN Reference Manual To simplify the code several lines have been removed from the source to demonstrate the basic ideas CIN Source File Standard Includes and Definitions See Actual Source File 132 vector typedef struct imtsZ2 CcimSize int32 Value 1 TD2 typedef TD2 TD2Hdl float64 vector typedef struct ImMt3sZ dimSize float64 Value 1 t Loos typedef IDS ITD3Hd1 Cluster of arrays typedef struct TDZHGl Ser
52. latched When it is true the Real Time data buffer is enabled When it is false the operation is disabled DPR Dual Ported RAM 143 PMAC PanelPRO User Manual e PmacDPRRealTimeConfig DPR Real Time Fixed buffer is configured to update motor information every Servo Period for all motor between 1 and Enable Motor Numbers when Enable is true Operation is disabled when Enable is false Output Enable is true when operation is enabled The VI maintains the state Operation of DPR Real Time buffers overlaps with DPR Fixed Background operation in that the number of motors enabled must be the same Device Number 132 0 Enable Bool T 7 Servo Pernod i32 1 Enable Motor Numbers 132 1 PmacDPRRealTimeMotor fetches DPR data for a single motor This has an optional enable signal in this case provided by the configuration VI It also has an optional Wait for Valid input and a Coord Specify Cluster that is used to specify the Motor Number and standard Coordinate System conversions for the production of the PVE cluster e PmacDPRRealTimeMotor Query PMAC DPR for the Real Time Fixed buffer Motor and Servo data When Enabled is true the Default state the data for Motor Number is fetched and used to build DPR Real Time Motor Cluster and DPR Real Time Servo Cluster Motor PVE Cluster contains data in encoder counts or coordinate system units depending on the state of Coord Specify Cluster See PmacMotorPVE for details on how this is done
53. later exercises e PmacCoordStatl Create a status indicator cluster for the PmacCoordStat1 indicator containing the status for Coord Number Device Number 132 0 Coord Coord Number i3 1 cta cs Coordinate System Status Wo e PmacCoordStat2 Create a status indicator cluster for the PmacCoordStat2 indicator containing the status for Coord Number coe Loord Coordinate System Status Wo Coord Number 132 1 State Application Basics 65 PMAC PanelPRO User Manual PmacAcc ICVs This series of exercises introduce the PmacAcc collection of ICVs These form templates that combine PmacMemory s direct access of memory with PmacIVar s Set Get architecture that access PMAC s memory mapped devices Using this approach the bit field and address specifications can be hidden in the VIs This collection of VIs will grow as Delta Tau adds support for its numerous accessories The Machine Input Output VIs and a simple example of the Acc 16D control panel will be demonstrated PmacTutor14 Machine Input and Output This tutorial demonstrates two VIs The first one allows access to the general purpose machine input port and one that accesses the output port On the demonstration box used for the development of PMAC Panel Pro switches drive the inputs and the outputs drive a set of LEDs When running the example the GP Machine Input indicator directly reflects the operation of the physical switches Pmac Acc Machine I O
54. not required and PmacView doesn t really care Reopening the device without closing it is not a problem If pou don t close the device tt remains open as long as the YI that opened the device remains in memory This means ou can open the device and simply use the device number typically 0 without reopening Its a useful trick when you understand this Action is Latched PmacDevOpen should be executed ONCE tn your applciation prefereably outside of any execution loop Once PMAC ts opened the device number should be wired to all Is that need it this is most of them Several techniques to ease the development process are noted in the diagram descriptions These should not be relied upon in the final application PMAC Panel Pro was designed to be easy to use To avoid having to provide PmacDevOpen with a device number communication mode etc every time it is used the VI was configured with defaults for the device number and communication mode in the PMACPanel Basics section of this manual If using more than one PMAC or to access the device using more than one mode use one of two equally simple methods 1 Make copies of PmacDevOpen and rename the copies e g PmacDevOpenSerial or PmacDevOOpen and PmacDev1Open Set the defaults for the device number and communication mode as desired Use these exactly as PmacDevOpen would be used 2 Make a copy of PmacDevOpen and add input terminals for the device number and or com
55. of CVs to configure monitor and operate these capabilities When coupled with National Instrument s data acquisition boards PMAC and PMAC Panel Pro can be used to build highly integrated and precise motion based data acquisition systems using GPIB SCXI VXI or DAQ boards This section will demonstrate how to couple standard NI DAQ boards to PMAC to synchronously trigger data acquisition at specified positions and even use PMAC s servo clock as the DAQ sampling clock The examples presented here in no way limit the wide array of possibilities or approaches that can be used to trigger synchronize and organize the motion based DAQ applications Experience and requirements will define the approaches that best meet individual needs The examples of PMAC DAQ interfacing assume that there 1s a basic understanding of LabVIEW s data acquisition capabilities and the acquisition boards that will be used Similarly there must be some understanding of PMAC s external connectors and their configuration Connections will be made between these boards If not certain of abilities precisely which signals are needed where to locate them or what to connect them to do not attempt to connect them The boards the host computers and many other items can be damaged easily Make certain the information presented in this section the hardware manuals for the type of PMAC and the DAQ boards have been thoroughly reviewed Contact Delta Tau or National Instrumen
56. of PMAC responses into numeric data for use in LabVIEW and the use of non latched mechanical action to enable polled status for real time This step demonstrates the use of PrnacView Button Wla 1 This group of controls looks the same as those in Tutonal 2 However the Priacyiew Vl behind them simplifies the sending of the command string Send 1 Command String 1 Response String 1 2 Buttons with nor latched machanical action can be used to provide useful status information depending on the application s needs The response is converted to a numerical representation for display or manipulation Poll P d oll Fresse Lt Position Response String 0 00 Converted Motor 1Position When sending commands to specific motors or coordinate system always send the motor or coordinate system number along with the command Because of the multithreading and G Execution model sending the motor or coordinate number with one call and then the command with another ad can and will cause problems matching the command to the motor or coordinate number Note that in the diagram for this VI the sending of the command to PMAC is simplified by the use of the PmacButtGetStr The button is directly supplied to the VI rather than wrapping the PmacCommRespStr VI in its own case structure Sending commands in response to buttons is so common that this added capability makes application development significantly simpler Command String i
57. position capture if one is used see 1902 etc Setting HMFLn Home Flag n 0 1 LIMn Negative Limit Signal Z oO SSS O pe 1 2 LIMn Positive Limit Signal n 3 3 FAULTn Amplifier Fault Signal n 108 Homing Encoders and Position Capture PMAC PanelPRO User Manual Typically this parameter is set to zero because in actual use the LIMn and FAULTn flags create other effects that usually interfere with what is trying to be accomplished by the position capture To capture on the LIMn or FAULTn flags either disable their normal functions with Ix25 or use a channel n where none of the flags is used for the normal axis functions The VI for the cluster 1s e PmacEncoderlVarCapture Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the Encoder I Variables for the specified Encoder Number are set Otherwise they are fetched from PMAC and provided by Output Encoder I Capture Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 132 0 ee Pa Her Output Bool F Encoder Number 132 1 16 1 7 bo iis codexie aici Set Get Bool F p7 P P se Input Encoder Capture Clu As noted if using the LIM or FAULT flags steps must be taken to modify their normal operation These are safety limits that as a rule stop motion and disable the amplifier not useful when trying to home the motor or s
58. reduced to a single VI PLC PLC Enable FF 240 7 PLE Enabled Dev oO P e oa PRPS PSF runor ranor r marnomo ror re raro rr PC ees DPR al True EE N Clet i j W Input DPR Numeric Cluster G gt 732 Iteration Timer mS Mt EET PG The diagram for the DPR Numeric Cluster VI is shown below Copy this and modify it to support individual requirements Note that the addresses are specified by cluster constants These can be created using the right mouse button and selecting Create Constant Set Get Bool F Device Number 132 0 EYICE ee 132 DPR Joenessa Response Available Bool F bai EEH TER E Output DPR Humeric Cluster PmacDPRNumericCINClusterExample This example takes the previous example a little further and implements the actual handling of DPR data using a CIN This can be useful if there is many data being transferred or there is trouble maintaining dozens of PmacDPRNumeric Vis or have special data handling requirements that benefit from a CIN The diagram handling the five M Variables in the example above are reduced to a single CIN VI that will handle the reading and writing of the data with direct PComm 32 Pro calls To simplify development of these CINs PmacDPR defines a set of macros that make life easy 162 DPR Dual Ported RAM PMAC PanelPRO User Manual Device Number 132 0 Set Get Bool F Input DPR Numeric Cluster Response Available
59. sampling interval experiences a blip of approximately 75 mS 5 and 10 mS blips in between the major buffer updates can be noticed From a practical point of view the Servo Timer vector definitively identifies the time each sample was taken This can be used to resample the other data vectors or handled however chosen Until Delta Tau includes DPR data gathering in PComm 32 Pro use regular data gathering if servo accurate sampling is required This form of gathering does not support strip charting on a continuous basis As can be seen in this panel the interval required to process both fetches is between two and four mS without the update of the charts When the vectors have been accumulated the updating of the charts requires between 75 and 100 mS The diagram for the example is similar to that of PmacDPRRealTimeExamp The configuration VI is the same The Vector VI PmacDPRRealTimeVectors is similar to PnacDPRRealTimeMotors in that it takes an Enable input It also has a Buffer Length input Rather than a Coord Specify Cluster provide a Motor Number The decision to do this is based on the view that whereas single Servo sample data for a motor might be used to drive a PVE type of panel cluster This is not true for a Vector operation The update of the chart is wrapped in a case structure Do not use the cluster of arrays unless Valid Output is true The arrays should have zero length but this may cause problems Dey 1 Unbundle the vectors of
60. shows the panel for the PmacTerminalJog tool The menu bar for the tool shows an entry for PMAC Panel Pro that contains the menu items for the development tools Development Tools 69 PMAC PanelPRO User Manual if PmacT erminallog vi Terminal Edit Motion Prograrn Execute Motion Program Global Configuration as Plot Motors Motor Number Coord Num Plot Motor ssr VA E Gather Data I Wars Motor P Y E Modifying the Menu This is a custom menu named PmacTerminalMenu rtm that is set as the default for the application VIs run time menu To modify the application VI s menu or modify the existing one use the Edit Edit Menu option from the VIs panel to display the following dialog les Henu Editor DO Lab iew PMACPanel lbtPmacl erminal Pmac erminalM enu rtm File Edit Help lt a o gt ae Custom Previews File Edit Operate Windows PMACPanel Help gt File ltem Properties b gt Edit ltem Type gt Operate User ltem fe Windows 7 PMAC_Panel Item Name Jog Terminal Edit Motion Program Item Tag Execute Motion Program PMACPanel_T erminal Global Configuration Plot Motors iM Enabled Plot Motor s r Checked Gather Data l Wars Motor Help Shortcut Press key combination Select File Open to display the selection box then double click on PmacTerminal PmacTerminal Menu rtm or click OK This will change the VT s run time menu from the default or minimal options to custom Note that the p
61. simple interface circuit to be built to disconnect the physical limit or flag switches and connect the trigger signal of choice For example the system may have a proximity switch with TTL output to define HOME To use the HMFL input for specified position capture operations a TTL MUX or other form of digital selector can be used to connect the trigger signal wanted Realize that the motor does not need to be homed using this new trigger signal It will be used for position capture for registration or some other purpose In the system used to develop and demonstrate PMAC Panel Pro s capture capabilities a TTL signal generator was used to drive a reed relay at 5 Hz and trigger the home flag Using this configuration the Pos Captured LED flashes on and off dutifully signaling the capture of the position When the capture condition occurs PMAC Panel Pro reads the capture register and converts it into motor position or CS units depending on whether the Encoder Counts button in the Jog cluster is activated When the motor is jogging the numeric updates with every tick of the HOME trigger signal PMAC Position Compare OperationPMAc s encoder position compare function is essentially the opposite of the position capture function Instead of capturing the encoder position when an external signal changes compare operations generate a signal when the encoder reaches a specified position In fact the encoder register into which the captured position is
62. start and stop is not supported Connect the scan clock to OUTBI For triggers and scan clocks on PC LPM 16 DAQCard 500 and DAQCard 700 refer to the appropriate LabVIEW manual To find the actual pin numbers refer to the hardware user manual PmacDAQMove There are dozens of approaches to configuring a particular PMAC DAQ application Consider placing status and position monitoring VIs inside the main DAQ polling loop This requires organization of the configuration and maintenance of PMAC and DAQ device polling For the purposes of this section a multi threaded model was selected consisting of a main VI to control PMAC and self contained DAQ VIs found in the LabVIEW examples A few modifications were made to the DAQ examples such as defining defaults for the sample rates and channel configuration to demonstrate the sampling of the Compare Equal output Servo clock and a simple analog signal This allowed the examples to be created quickly and the operation of PMAC was validated in a more demanding execution environment PMAC and NI DAQ Interfacing 131 PMAC PanelPRO User Manual PMAC and AT MI0 16 Signal Connections The following examples were built using a PMAC Lite and a National Instruments AT MIO 16 The MIO card signals were accessed using a SC 2070 termination card The various PMAC signals were accessed using various terminal blocks of the proper sizes See the Hardware Reference Manual for the PMAC for a list of mating connect
63. supplied by EQU1 at the specified sample rate In our default version of the example channels 0 1 and 2 are sampled at 20KHz The waveform chart in the panel below shows a triangle signal the EQU trigger pulse and the servo clock Run this VI by selecting Trigger Only in the menu ring and clicking the Run DAQ button on PmacDAQMove after the PLC is configured and enabled and the motor is jogging If the motor is not jogging the VI will wait five seconds for the trigger and then time out 134 PMAC and NI DAQ Interfacing PMAC PanelPRO User Manual The EQU signal is configured to be active low Hence the first EQU pulse on the far left starts with the falling edge of the signal The default motor Jog rate configured by Ix22 is 32 counts mS With a position interval of 500 counts as configured by PmacDAQMove this results in a pulse every 15 625 mS Tthe next pulse occurs right around 15 mS in the chart device choose trigger type For instructions select Show Vl Into from the Windows menu Al START OR STOP 7 transposed waveform graph TRIGGER i00 channels Sig 0 1 2 ie Comp 5 0 number of scans pretiqger servo to acquire SCAN Asis sMo s 0 0 can rate trigger edge 2 5 s eoo00 00 falling 5 0 Cheol input limits time limit zec al 10 0 5 00 0 000000 0 020000 0 040000 0 049950 i data he e Al ime out oe ona rials Multi Trigger DAQ with Servo Clock Sampling PmacDAQSyncServo is a
64. the VI The device driver manager allows the selection of Serial Port or In PC Bus as the desired communication mode The same selection should appear in the Communication Mode drop list on the front panel The default mode specifies the use of the Bus If this is the correct mode no change is required If the desired communication mode is DPR the device driver control panel should specify In PC Bus along with a valid DPR address The Communication Mode in this panel should display DPR As with the device number make this value permanent by using the right mouse button clicking the Data Operations Make Current Value Default option and then saving the VI Testing PMAC Panel Pro Communication The final step in the installation of PMAC Panel Pro is to test its ability to communicate with the device driver After configuring PmacDevOpen and saving the default changes execute it using the run button on the menu bar The panel should change to reflect the Type Rom Date and Rom Version of the PMAC as shown here gt PmacDevO pen vi File Edit Operate Project Windows Help EE ap Application Font Ee EF aj EE Communication Hode Device Number a m Bus Y o Device Number i22 0 Pmac Type Rom Date Rom Yersion i 2 95 IUE The PMAC and the PComm 32 Pro communication drivers have been installed on the system PMAC Communication I Variables PComm 32 Pro supports communication with PMAC using UNICODE and standard C C
65. the name to the same base as the saved program For example if Program Buffer is saved to PmacTestl pmc a new VI named PmacTestl vi is created from PmacProgSubVI Program Buffer String Program State Cluster Using the example names above there are now two items with the same base name An ASCII program file PmactTestl pmc and a VI PmacTestl vi The icon for the new VI based on PmacProgSubVI shown here e PmacProgSubVI PmacProgSubVICreate makes a copy of this VI with a new name that matches the name of a motion program Because the motion program has the same name with a different extension this VI knows how to open parse load and run a motion program without intervention or extra inputs It allows the editing of the associated program and interactively executes the program Details of its implementation are contained in the manual The VI downloads the associated program when first loaded unless this option is disabled in the diagram and defaults for Program Number and Coord Number are provided for the Program VI State Cluster The interactive panel can be opened and used by setting Panel Show latched true See the documentation for PmacTerminalEdit and PmacTerminalExecute for details on interactive execution Click the Stop button on the panel to close it Development Tools 79 PMAC PanelPRO User Manual When the latched input Program Run is true Input PQM Variant Array is sent to PMAC to initialize a program s P Q or M
66. the program number or coordinate system number To provide this information set the constants in the case containing the Default Program and Default CS and save the VI 92 Encapsulated Motion Programs and POMs PMAC PanelPRO User Manual After the down load is complete repeated executions of this VI embedded in the application loop allow the display of the interactive panel or control and monitor the execution of your motion program The VI provides its Program VI State Cluster as an output so there is access to this information for building tools that are more sophisticated If the application provides a latched true input to Panel Show the panel is opened and activated The sub case within the large case can now execute and update the panel s display This approach eliminates a fair amount of execution overhead in maintaining a panel when not displayed The structure of this part of the diagram is obvious The one difference is that the Stop button has no loop to halt Instead it closes the panel and allows continued execution of the other operations in the VI Once the program is loaded the case on the far left can execute This structure performs two sequential operations First the PmacPQMArray VI is executed This will set specified PMAC P Q or M Variables using Input PQM Variant Array when Program Run is true If Program Run is false the specified P Q or M Variables are retrieved from PMAC and output in Output PQM Variant A
67. the use of LIM1 for motor 1 and setting 1125 to 2C000 disables the limit function It is a good idea to use the home offset parameter x26 to bring the home position out of the limit switch so the limits can be re enabled immediately after the homing search move without being in the limit Homing from PLC and Motion Programs The PMAC User Manual has an extensive section on homing techniques using PLC and motion programs These are not covered in this manual However the programs for these are included in the PmacHome collection of ICVs PmacHomeExamp Having covered the basics of position capture and homing from a purely PMAC perspective the ICVs available for use in the applications are outlined Examine the panel for PmacHomeExamp shown below Many of the panel clusters should look familiar There are three new indicator clusters associated with homing and a few new ideas associated with PLC program encapsulation In the bottom left is a very large PmacHomelIVar cluster that borrows extensively from PmacMotorl VarSafety and PmacMotorIVarMove It adds a new cluster for Encoder I Vars 2 and 3 On the far right is an indicator bar that directly displays eight encoder status bits Next to the Motor Number and Coord System knobs is a Home State Cluster This contains data from several I Variables and memory registers that define how motor position is transformed to encoder position The cluster is updated any time the Capture Encoder button i
68. to handle compare operations that require fast servicing These 120 Encoder Capture and Compare Operation PMAC PanelPRO User Manual documented are found in the PMAC User Manual PMAC application notes and in the Introduction to PMAC tutorial notes PmacPosCompSetup configures the capability by fetching the current encoder position adding the interval and initializing the encoder registers This PLC is executed once to configure the operation After configuring the operation it starts PmacPosCompGen This PLC monitors the encoder s compare equal flag When the specified position is reached it clears the flag loads the next compare position and calculates the next position to be used PmacPosCompSetup pmc close Define Encoder Registers milOl Sx2 gt c001 0 24 s 7 Actual position mLOS gt x SCc003 0 24 s 7 Compare register mLO0S gt x2S0750 0 24 s j Scratch register for rollover Define Encoder Compare Equal Register Control Bits miia gt xese000 11 1 Compare equal latch control mld 2s e000 12 1 Compare equal output enable mld 3K SCU00 13 fi Compare equal output invert mikes ks 0000 16 i Compare equal flag plOl 50 Count intecrement Configure the Compare Pulse open plc 18 clear Setup Compare Equal ml0O5 m101 p101 Save Increment actual position ml103 m105 Copy next pos into compare reg ml105 m105 plol Update next compare position m113 0 No invert on output bit enable plc 19
69. web site for documents and help files for a specific system PmacDocument Contains electronic copies of this document miscellaneous help items and a few useful bitmaps PMACPanelPRO Basics 19 20 PMAC PanelPRO User Manual PMACPanelPRO Basics PMAC PanelPRO User Manual APPLICATION BASICS Basics This chapter contains several systematic exercises that run through the hierarchy of PMAC Panel Pro to introduce the various concepts required to develop custom applications For detailed explanations of the individual VIs used in each tutorial consult the VI Reference First time users of PMAC Panel Pro must read this section Although most PMAC Panel Pro VIs can be used as is the developer is encouraged to use them as templates that can be extended and customized to meet the requirements of an individual application LabVIEW Techniques for PMAC Panel Pro The following are general LabVIEW programming techniques not related to a specific PMAC Panel Pro VI and therefore may not appear elsewhere in this manual It assumes that the user has taken a basic course in the use of LabVIEW or has equivalent experience PMAC Panel Pro s architecture was designed to hierarchically encapsulate common operations into VIs that it can be used to develop custom applications without doing a lot of basic communication parsing and wiring Depending on the application s requirements and the user s experience with LabVIEW there will be custom des
70. 0 99 0 Using this approach development of ICVs that manipulate collections of I Variables for a particular motor or coordinate system is easy PMAC Panel Pro does not check to see whether the I Variable being addressed exists its type or its range This information can be found in the PMAC Software Reference Manual The I Variable clusters introduced later perform this type of range checking where appropriate In addition to the organizational architecture I Variables are accessed differently by PComm 32 Pro Use the PmacResponse VIs introduced in PmacTutor4 to access them Application Basics 39 PMAC PanelPRO User Manual The problem is that depending on the value of I9 I Variable queries may be returned as decimal or hexadecimal values PMAC Panel Pro VIs in the PmacResponse collection do not support the conversion of hexadecimal responses into numerical data types If using PmacRespGetLong to request an I Variable like Ix25 a response of zero will be received if I9 2 or 3 If using PmacI VarGetLong the proper binary representation is received along with the ability to organize access into groups The panel for this exercise allows the modification a few Motor PID loop I Variables When creating the application s VI panels limit the range of controls to prevent potentially damaging data from being entered The Motor Humber contral limits the range of allowed Wallies to 1 8 Configure the display using the standard Labv
71. 000 100 X Mowe 1 in cm X Move in cm Delay in m This application specific PQM configuration VI does not actually send the variables to PMAC It creates a PmacPQM Variant array from the panel clusters that can be used by the encapsulated motion program VI in the main application Update reads the current P Variable values from PMAC and updates the controls on the panel Close the panel using Cancel and discard the new control values If OK is clicked the VI indicates there is a new PQM Variant Array available The disposition of the new data is up to the main application VI The description of the VI is Acceleration in m5 e PmacTestPQM1Panel Group several PQM clusters together and coordinate their operation with an encapsulated motion program VI Panel Show true displays the panel If supplying the Input PQM Variant Array and setting the Init with Input Variant Array true the controls initialize themselves using the array contents when the panel is displayed If not using these inputs first update the controls from PMAC Output PQM Variant Array maintains any changes made using the controls from execution to execution If OK is clicked New Output Bool reflects this Otherwise Output PQM Variant Array contains the current state of the cluster controls Encapsulated Motion Programs and POMs 99 PMAC PanelPRO User Manual Device Number 132 D J ppp New Output Bool Init w Input Variant Bool F Output PAM Variant Arra
72. 1 Convert To Coord Bool The diagram for PmacMotorsPositions shows that a command string is sent requesting the position This command is a control code and requires the proper option be set for the string constant The response will have as many positions as there are motors in PMAC The responses are converted into an array and processed by PmacCoordMotors2Coord which assembles the results into a cluster for display on a PmacMotorsPVE cluster This is different from a PmacMotorPVE cluster Motors Velocity Cluster Motor Error Cluster el aot ot et act E at at Device Number 132 0 Convert the response into Resp f String 4 Codes Display selected Coord Number 132 1 8 1 Convert To Coord Bool Application Basics 55 PMAC PanelPRO User Manual The PmacMotorsPVE cluster is comprised of an array of values a Boolean array to indicate which motors have been converted to CS units and a text label for the cluster indicating which coordinate system the display is using for those motors displayed in C S units Motors PVE Cluster The indicator cluster displays an array of values for all PMAC motors The array may be positions velocities or following errors The array of Boolean indicators indicate which values are in CS units The caption specifies the displayed values as being in encoder counts or a specific CS See the documentation for PmacMotor s Position PmacMotor sVelocity and PmacM
73. 1 before using the si The diagram for the query of coordinate system definitions is simple The lower portion of the diagram demonstrates how to use the conversion VIs to convert and display the motor position data The Coordinate Specify Cluster in this example is made from Menu Rings whose index always starts at zero Because PMAC motors and coordinate systems start their number at one you must add one to the selection index This is not necessary if using numeric controls in the Coordinate Specify Cluster The motor position is processed by PmacCoordMotorToCoord to produce three outputs that can be used to enhance the display of the data PmacCoordColor sets the color of the numeric indicators The Coordinate Definition String is used to set the indicator s caption after stripping the terminating lt CR gt The example shows the use of both named and unnamed unbundles to get the data required for the operation Dey Open Coord Number Coord GE Sorte Cluster Scale Cluster Scale E BracCoordScale checks only fetches the coordinate system definitions when aan Tear Sootainate number is changed a Definition Cluster Coord p Coord Ten coo TER E aa Coordinate Specify Cluster ae eee Fes lt H C pE D8 J a S Motor Number i32 0 7 0 atte Motor Position Ce eed does the Set text color and eerie T guerying Ce eed the conversion for you E on CS Definition q a fa ca Application Basics 63 PMAC Pa
74. 128 General Purpose Digital Inputs and Outputs s sssssssnnneneeessssssssssssssererrerssssssssssssseeerrrrerssssssssssssserreererreeeesss 128 Synchronous M VariableS o00aannnnennnneennnnnnssssseeeennnssssseerensssssreesosssssereoesssssrererosssseeresssssseereeeersssssereenssssseeeee 129 Position Capture FLAGS scrcpsdencwenctiagvenestectcmedaatestyetinacniowsdurbancteedalenbivodaateatotqnanestedieheh diecaehateinedaaduensasoredemaiewatemartlewtienste 130 PFA SANS A EA N E EE ET E A E E E E E E 131 Analog O Channels seressrcrctscaniieciis indsender a E a E i aa Re r Rinas Ee eaaa e aiei 131 Trigger and Scan Clock Connections oooeeeeeeeeennsssssssseeeeerressssssssssssseeeeeereressssssssssseeterreeessssssssssssssseeeeeeeeeno 131 Foa DAO MO E ar eT eer ET E E E AE E AEE 131 PMAC and AT MIO 16 Signal ConnectionsS eeesssessssssnnnneeeenesssssssssssssseecereerereesssssssssssssseeeeeeeessssssssssesssseeeeeee 132 Salke Wa AO eere a a E EEEE iateiuhatai iinet eidedaosceussanuvabecauaee 134 Muti I aT DAU erae E E 134 Multi Trigger DAQ with Servo Clock Sampling cccccccccceccccccceeeaeeeseeeseeeeecceceeeeeeeeaaaaaesseeeseseeeeeeeeeeeeeeeeeaaas 135 ECC h Sampin CU ONS csc ain esceuenn ts ctaniint oan cinauneecmeusacie sae detnia soda aka dset oomtnpacdeiabiteeianiecainchndsetscesoucwanaledantancceameduatiess 136 Oher ITC ONS siessen E r i E osewaaateakesaminien dural T E 136 PCOMM 32 PRO CODE INTERFACE NODES isccccssesccs
75. 8 and dividing by the I10 default 3 713 707 If 110 is changed modify this value in the diagram Coord Defined Bool Velocity Double Coord Definition String Device Number 132 0 Coord Specify Cluster e PmacMotorError Query PMAC for Motor Number s following error Following error is the difference between motor desired and measured position at any instant When the motor is open loop killed or enabled following error does not exist and PMAC reports a value of zero Device Number 132 0 Coord Defined Bool Following Error Double Di a a Coord Definition String The implementations of these VIs rely on the PmacCoord collection to convert values reported in motor encoder counts to coordinate system units This capability is a fundamental component of PMAC Panel Pro The diagram for PmacMotorPosition shows that these VIs format a command string to request the desired motor position and let PmacCoordMotor2Coord process the response Device Humber 132 0 Coord Defined Bool Coord Specify Cluster Position Double C e PmacCoordMotor2Coord Coord Specify Cluster specifies a motor within a CS and an attempt to convert Input Value from encoder counts to CS units If the motor is not defined in the CS no conversion is applied If the motor is defined and Convert is true Coord Defined is true and Output Value is scaled from encoder counts to CS units Coord Definition is a string specifying Output Value units as E
76. A A E EA EANA Z Maiore Ved sasssc cect concaasconctanacceignecanhecaaaeanaeiaetianeacaiga E ad tain canta ae aota tea Z MCCA TC AIL SU OU A E E T E E 2 CELING STARILE Db cre E E erro emer eer eres 3 Unpacking and Inspection oeseoeeeeeeeesssssssssssseeetrererssssssssssssseeterrressssssssssseseeterrrrssssssssssseseterereressssssssseseeeerrreesssssss 3 PREA A Omn OT eee a E E a E 3 Customer Furnished Hardware nnneenssesssssssseeeeeeessssssssssssssestrerressssssssssssssseeerrerrssosssssssssseettrreeessssssssssseeeerereeessssss 3 Customer Furnished Software eeeesessssssseseeererrssssssssssssssetereeressssssssssssssseeetrerersossssssssssseetereressssssssseseeeerereesssesss 3 D ES N a S S gt National Instruments SOftWALE cccccccccccssccccccccccceecnessseeceeeeeaeeeseeeeeeeeaaeeseeeeeeeeeaaeeeeeeeeeeeeeaaaeeeeeeeeeeaaeaseeeeeessaaaaaeeeeeeeas 4 Microsol SOWO 4 COREE CREE CRE EPC RET TET TREE TERE ET REPRE A rer errr pene etree eerie errr crer errr rreer ere err 4 PMAC Options for PMAC Panel Pr s s siso2sssqssnecrncssnancacacsiapecastaanutereaamedease dobse tndawagasaiavehapneenasabaces seendaancaniaecsdaveuomaden 4 PMAC Panel Pro and the Computer s Display cccccccccccccccceeceaeeseessseseeecceceeceeeesaaaaasssssseeeeeeeeeeeeeeeeeeeseaaaaagees 4 eis a Ea PTAC Pane L Pet Oar asaen tate vac saad aaatacasmnencanneanacean ang uiaatanauseneta cee den sucasapsmacantaaoncorneagacssianeaeasneamecessennetesoscancaet 4
77. AC for the value of 1123 When Good Bad is clicked the incorrect command 3 is sent resulting in an error The log of this bad command appears in the Command String and Response String items in the PMAComunication Cluster on the right The error dialog pop up will also appear allowing to continue or abort the application Click Continue Response String 3332 0D z Pmac Communication Command String Response String i123 gt 32 _ Buffer Log Bool F 203 Num Commands i32 Communication Log String Processed Error String 32 Click to clear log when Enabling or Disabling loggin Good Bad Buffer a OFF COFF Buffer Enable Enable Click to send a bad command Buffer Disable Disable Enable and Disable communication PmacCommGlobal cluster for Bi loggin If the Buffer Enable button is clicked all communication is appended to the Communication Log Buffer in the cluster To stop logging click Buffer Disable This only stops the logging of communications If the Buffer Empty box and Buffer Enable is clicked the buffer is cleared before logging is enabled 32 Application Basics PMAC PanelPRO User Manual The diagram for this exercise is shown here Get Strin Dey g Open lease Ja gt Processed Error String Good Bad Resp Camm rene gt String Paar abe _ Pmac Communication i123 Prac Comm Global Cluster AE Butter Enable ESE Butter Empty To use logging in the
78. ASCII strings PMAC Panel Pro is configured to use C C ASCII strings not UNICODE due to the use of LabVIEW s Call Library VI to interface LabVIEW with PComm 32 Pro PMAC uses I Variables to define communication characteristics These are important to verify because the behavior of PMAC Panel Pro depends on their value If PMAC Panel Pro communication is not operating properly configure these values using Pewin 32 Pro or the PMACTest Pro application included with PMAC Panel Pro l1 Serial Port Mode This parameter specifies whether PMAC will use hardware flow control using CS and whether a software card address is required with each command At present no software card address is required hence I1 should have a value of 0 or 1 If desired a card address can be pre pended to all communication with some modifications to PmacCommSendStr PmacCommGetStr and PmacCommRespStr Getting Started 9 PMAC PanelPRO User Manual I3 I O Handshake Control This parameter determines what characters if any PMAC uses to delimit a transmitted line and whether PMAC issues an acknowledgment handshake in response to a command The preferred setting 1s I3 2 14 Communication Integrity Mode This parameter allows PMAC to compute checksums for the communication bytes sent between PComm 32 Pro and PMAC This value should be 14 0 because PMAC Panel Pro does not currently add or strip a checksum I6 Error Reporting Mode This parameter specifies how
79. Background Example I Valid Output 4 5 4 5 3 E 4 6 DPR Fired Motor Cluster oe i E 7 DE Target Pos Dbi 1 e 1 oo I Bias Pos D hi Motor Number Coord System oo f Yelocity Dbl Coordinate Axis z Enable lin Pos Motor Motron 3 E Warmin Fatal 3 n j Following Error Following Error A l i Pa Enable Motor Numbers Londens Poman pun 13 Iteration Timer m5 Chart 20000 0 Config Pom aie 10000 0 T J 0 0 g 1000000 0 0 0 r a ionannniae 3 E 2000000 0 20 0 ND 10 0 a 8 0 0 Coord System 2000 0 Coord Axis 1000 0 Buff Len 128 0 0 ma o Enable To execute the example select how many motors PMAC should copy to DPR using the Enable Motor Numbers knob and click the Enable button Enable the operation of the display clusters by checking the Enable box on the top left There are two clusters provided by PmacDPRFixedBack A DPR Fixed Motor Cluster for the specified motor and a DPR Fixed Coordinate Cluster for the specified CS If the Run button is clicked the data in the clusters will update e PmacDPRFixedBack Once DPR Fixed Background buffer operation is enabled this VI can be used to fetch the data for a specific Motor Number and Coord Number The input Enabled can be used to enable and disable the actual fetch The Default un wired condition is true Coord Axis Char is a string X Y Z A B C U V W indicating which axis in Coo
80. Basics PMAC PanelPRO User Manual The diagram for PmacAccMachinelInput8 is shown here to make a point about the PmacMemory VIs The VI fetches the machine input port data located at Y FFC2 bits 0 8 using PmacMemoryGet j Response Available Bool F i us Output Yalue ug 0 Output Bool Array amp This case illustrates an important behavior associated with PmacMemorySet This VI sets the contents of the bit field and provides as its output the entire 24 bit word This was done so that multiple copies of the VI can be chained together to handle multiple bit fields If the output of PmacMemorySet is taken and wired to Output Value for PmacAccMachinelInput8 Output Value will not be what is expected This is obvious when running PmacAccMachineOutput8 To remedy this use the Input Value that is used to set the field as Output Value PmacTutor15 ACC16D Control Panel This example fetches the contents of the several memory locations for the Control Panel port at Y FFCO Y FFC1 and Y FFC2 These registers allow the Acc 16D accessory to control the operation of motors and programs from an operator control panel The panel for the example responds to the physical panel by mimicking the switch operation If using an Acc 16D while running this example the various switches on this panel will respond in kind Pmac ACC 16D DELTA TAU DATA SYSTEMS DATE 11 10 97 PMAC MOTION CONTROL CARD VERSION 1 16D RESET IPOS B R ERROR FERR W D
81. C ERR codes and flagged with a modal dialog Device Number 132 0 Command String All the PMAC on line commands described in the PMAC User Manual and PMAC Software Reference Manual are valid commands See the appropriate manual for detailed command usage and syntax PMAC will accept multiple commands in a command string Those commands that generate a response will put the data into PMAC s output buffer whether or not it is retrieved If a command generates a response use PmacCommRespStr Response 4yvallable Bool F Response String Generally PMAC responses are single lines The exceptions to this are commands such as LIST PROG N LIST GATHER Note LabVIEW string controls do not treat a lt CR gt as anything other than a lt CR gt It is possible to tie this keystroke to a control on the panel Check the LabVIEW documentation on Key Navigation Option for Controls These commands will generate long multi line responses LabVIEW strings can handle these Depending on the size of the string indicator or control on the panel these may not wrap correctly This is a LabVIEW issue If PmacTerminal is executed and a long gather buffer is listed this will appear There is also an issue when entering strings using a control The natural temptation is to expect that hitting lt CR gt will cause the string to be sent LabVIEW does not work this way Panel values are input using the lt Enter gt key The panel and diagram for t
82. C a a E a 16 indicators COMI SA VLG ON Ghent ache a a A see anced vecceaeeduc at 16 ITO TOT TY Goat ares osracieh es E E AE E E tabac ons E tenner 16 COT Ae STI CYS sate sctetns Sos ue Sarde nsec Steicntn seeds ss oases E E hens one eo 16 CTO AEN a panssosedeptteaac tebeciotae us ana abel E E T saute one seetonisodiceoe 17 Table of Contents i PMAC PanelPRO User Manual ACO ANS aim S prereerrer ter E en oRTerener Treen Mrrerrer err errntrer ers errr cnr er rere AAN tr ere restr re trererrer rrr er ate 17 Position Capture and Triggering CVS ccccccccccccssssseesceceeeeaeeeeeeeeeeeaeseeseeeeeeeeaaeeeseeeeeeeeaaasseeeeeeseaaaaseeeeeeeeaaaaassees 17 Program Development ANd Encapsulation Tools ccccccccccssseccccccccecneeeeseeeceeeeneeseeeeeeeeeeeeaaeeeeeeeeeeeaaaaseeseeeeeaaaaasees 17 Data Gathering ANd Graphical TOOIS ccccccccccccccccccssseseeeeeceeeeeee cece cede ee eeEEEEEEEEEEE EEE EEE E EAA A GAGS GAA SESEEEE SEES Ee ed aa saga aaa ae IS Code Interface Nodes and Dual Ported RAM cccccccccccccsseeeescccece ccna eeeeeeeeeeea aa eeseeeeeeeeaaaeeeeeeeeeeeeaauaassesessaaaaassees 18 Sample Applications ccccccccsssecccccccccnsensseececcccnaasnssseecccesaaussseeeeecssuanssseeeceesaaauseeeeeeesaaaasseeseecsanaaeeeeceesauaganseseeeesaas IS Miscellaneous Utilities veccasicccsisnatesswansadavvnnndeadioataanenndodedswsbsaractenedaadeanbanideasveuraenctsndannovenoceadsbadhasvawedadendeeenueulestundzs 19 DOCG O essien iee e a aaa iE E ERa te
83. CS 2 e PmacTestCircle pmc in CS 3 e PmacTestCircles pmc in CS 3 98 Encapsulated Motion Programs and POMs PMAC PanelPRO User Manual PmacProgSubVIs were created for each program by running PmacTerminalEdit loading the programs one at a time and clicking the Create Prog VI This takes two minutes to do PmacTestPQM1 and PmacTestPQM2 are similar to PhacPQMExamp and use P Variables to configure their motion X Y Chart Motor Position Chart 25000 0 Motor 3 22500 0 ee Motor 1 20000 0 Motor 2 Motor 3 Motor 4 Motor 5 Motor 6 Motor 7 Motor 8 17500 0 15000 0 12500 0 10000 0 o1 7500 0 5000 0 We 4 AF a 20000 30000 40000 21 30 40 50 60 70 s0 90 100110120 WE 3i F r x a MEEI 100 s ae i pal PQM 2 Circles Circle srr The panel for satan is shown above The panel shows four sets of controls one for each program e A button to start the program e A button to show the encapsulated motion program s execution panel e An LED to indicate the execution state of the program e PQM 1 has an extra button that when clicked allows modification of its associated P Variables with the control panel shown below The VI architecture for doing this is not really a PMAC Panel Pro design issue but it demonstrates an approach for PQM configuration using pop up panels in a larger application 1000 oO in 100 l 3l 400 10 25 50 60 20 25 30 35 40 1000 s
84. CVs for controlling programs and PLCs are introduced e PmacTerminalEdit A simple editor for program development and downloading The tool also supports the creation of encapsulated motion and PLC program VI wrappers that hide the details involved in controlling and monitoring PMAC motion and PLC programs e PmacTerminalExecute An interactive debugger for monitoring and controlling the execution of PMAC programs e PmacTerminalJog A simple tool for jogging and controlling motors e PmacTerminalMotors A graphical tool for monitoring and plotting the motion of multiple motors in a real time strip chart e PmacTerminalMotorsX Y A tool for monitoring and plotting the motion of motors in a real time X Y chart e PmacTerminalGather A tool for specifying and gathering PMAC motion data and exporting it to Microsoft Excel e PmacTerminalMotorIVars A tool for configuring individual motor I Variables e PmacTerminalCoordIVars A tool for configuring coordinate system I Variables and monitoring coordinate systems e PmacTerminalGlobal A tool for monitoring PMAC s state saving configurations and configuring important global I Variables Tool Menus The tools distributed with PMAC Panel Pro can be integrated into an application using LabVIEW 5 0 s new ability to edit and process menu bar selections This allows the applications easy access to the development tools and an easy way to add custom tools The figure below
85. DPRNumericDWordBitTest QxK04 Y 8 Output_DPR_Numeric_Cluster gt M448_Bit DPR Dual Ported RAM 163 PMAC PanelPRO User Manual PmacDPRNumericResponse Response_Available_Bool_F_ Sec Get Bool F a return noErr As with all CIN nodes LabVIEW writes the function declaration and defines the parameter types The macros require that the device number must be defined DevNum no matter what it is in the parameter list The macros perform a conditional test for read write operations address calculations and PComm 32 Pro operations Generally the macros require an address and a pointer to the input and output elements of the cluster Bit operations require the bit number and Mask or Bit Field operations require the mask field mask and XOR OR operator The actual C code for the example contains the macros and their actual C counterparts to illustrate the operations performed PmacDPRNumericSlaveExample This example uses PmacDPRNumeric and PmacDPRRealTime capabilities to build an application that allows moving a 2 axis X Y table with the mouse To accomplish this the motion program shown below uses DPR mapped M501 and M502 to define the target position for motors 3 and 4 M500 is a Boolean used to control a loop that breaks the target position into a set of smaller moves The program is encapsulated in a VI for easy use USE CS 62 amp 3 3 gt 10x 4 gt 10y These are DPRAM mapped target coordinates
86. E AE AE AEE A EAEE EAEE E i 96 Fnac OM DUalo EINE sriganienie kisketa Nee eeN Ee EENE AEREN e EAE EEEE aTa dadia 97 Using Encapsulated Motion Programs cccccssssssssssssssseeeccceeceeeeeeeaeseessessseeeeceeeeeeeeeseeaeeeeeseesssseeeceeeeeeeeeaaaaagesesses 98 Poa Ui SE INN en E E E swaretees aves aaaceseresecueaeeceeestyenaeacauacedicecaseons 98 HOMING ENCODERS AND POSITION CAPTURE cccccccccccccccccccccccccccccccccccccccccccccccccccccccccsscsssssssecees 103 APO S11 VOM ASICS hss tacadessaasataanesonecanet cass ssqceesanncanesencduansoacessateseusanaaneesienanberaneosederdsasd iateanacan E 103 MPO Oe araa cauetenauetaate E nee 104 DUCT CONG ION asana an acaba sacs 6 sg nak vanes aka ost ae aa a 104 aa scence occ tanac ena aancussecn sen qnecene cased eahanacanteconetanes 2oceayeetedeaanatecsnaeamee saat aaadeassaaemsepieaeunnsacacta ah eseauaamasenoanaanee 104 Adoman BELG 7 g tener nTnr aren eereererereT TTrr rer terre cot Treerrrnereree or rrere rere re rrr crrrerrrerr rete rrr terete re cr treet trerre rrr err erere er trrce 104 Home OUD lE snanta CEE EERERED Teor roPe Pere Ty CNET ePreSrrneT eet erent err ete tTrrrterrrey er Terr eer eer trererrne eer etree 105 Home Positon OFFSCL cccccccccccccc sa eececececeeen ae ninna EAEN AAAA E Ea E aeaa Eaa ERTAN 105 Zero Move FOMUNG vicvsusivasssrirnnarensdviarinstenwolerdands sidecuvasdediuseiaracsowsdesteuasdenpnonedtedssdeiaregiuneteninsenedenstolaniandeebuedenties 105 Homing into a
87. Element Bool Second Word Binary Status ud e PmacGlobal PmacGlobalStat Query PMAC for PMAC s global status Report the two status words as arrays of Booleans and unsigned 32 bit integers Glob First Word 24 Element Bool Device Number 132 0 a z First Word Binary Status uaz 2 Second Word 24 Element Bool Second Word Binary Status wt 36 Application Basics PMAC PanelPRO User Manual Global status does not require a motor number or coordinate system number The Motor Number and Coord Number inputs coerce the range to protect you from mistakes Status bit definitions can be found in the PMAC Software Reference Manual More status processing VIs are introduced in later exercises Note PMAC supports up to eight motors and coordinate systems If a PMAC has fewer motors PMAC ignores commands to them PMAC Panel Pro does not supply button versions of these VIs that fetch status when the button input is true Generally status monitoring is not a user driven operation The panel for this exercise demonstrates the use of PmacMotorStat Use of the coordinate system and global status VIs is identical At the bottom of the panel are the raw status Boolean arrays Because spcify Boolean text for individual array elements cannot be specified they are left unlabeled The contents of these arrays can be indexed using standard LabVIEW array function VIs to select specific bits for any needs In this example several common status bits are us
88. Global This VI is a global copy of the PmacCommGlobal cluster used by several PmacComm VIs for error reporting and logging purposes amp Comm Pmac Communication Cluster This cluster maintains a log of communication between PMAC Panel Pro and PMAC Command String Last on line command sent to PMAC Response String Last response received from PMAC Communication Log String A multi line buffer of commands sent to PMAC and received from PMAC Num Commands 132 The number of commands sent to PMAC and logged in the Communication Buffer Application Basics 31 PMAC PanelPRO User Manual Buffer Log Bool F When true all communication is appended and logged to the Communication Log e PmacCommBuffer When Log Enable is true communication logging is enabled Log Enabled Bool Log String and Num Commands reflect the state of the log buffer when logging is enabled Log String is the empty string Num Commands 1 and Log Enabled is false when logging is disabled When Log Empty is true the log buffer is emptied Log Enabled Bool F Log Sting Num Commands 2 1 e PmacCommAppend Copy Command String and Response String to the Last Communication items in PmacCommGlobal If Logging Enabled is true they are also appended to the Communication Log Log Enable Bool Log Empty Bool Command String Comm Response String App The panel for this exercise demonstrates how communication is logged The VI queries PM
89. HE Comp Pos Db Block as a ioe Zero 4 5 4 5 3 3 3 6 A Jh af he ike 8 1 8 Coord System Motor Number O Convert to CS Valid Output O Wait For alid Single Motor EE es DAC i32 _ Time i32 BEG Motor Motion u16 Limit Exeoeded Linit Exceeded 4 5 _ Sample Period Oa o Cary eer commen peau EARE ae Mode o oaea bee a omens Request fra E Enable oe Numbers BEE ServoTimer i32 _ Enabled EE Comm d Pos Dbi HE Position Dbi oo Iteration Timer mS He Velocity Dbi HE Follow Error Dbi HE Master Pos Dbl oo Comp Pos Dbl Me DAC 32 HE Hoe Time i32 He Motor Motion u16 To execute the example how many motors PMAC should copy to DPR using the Enable Motor Numbers knob Sample Period is the number of servo cycles between copies to DPR The default value of five indicates that PMAC will update the Real Time data buffer every five servo cycles With a default servo rate of 2 2 kHz this corresponds to a 400 Hz sample rate otor Array Motor Teer 4 lt P iaieiaieiaie X fry earl Link Eaneoded Secon ee Faia CL Enable Motors 2 C Wait For Valid Valid Output Multiple Motors 142 DPR Dual Ported RAM PMAC PanelPRO User Manual Click Enable to start PMAC s Real Time data buffer Updates should take place immediately in the DPR Real Time Motor Cluster and DPR Real Time Servo Cluster on top Most noticeably the Servo Timer will increment rapidly reflectin
90. Jog Control Cluster Stop Jog Relatiwe ee ___JogTo Make Pre Joc 00 10 20 30 40 50 60 70 80 90 100 Encoder Counts ME Cluster Type Definitions LabVIEW allows the defining of cluster controls and indicators as strict types that are linked to the root control definition PMAC Panel Pro has chosen not to use this capability Clusters can be used and modified independent of the base definition This means that if changing cluster definitions the changes are not propagated to the VIs using it All instances of the control must be replaced by hand Or choose to define the ctl controls as strict types before using them Then every new instance of the control in the application will be linked to the raw control Accessing PMAC Panel Pro VIs To use PMAC Panel Pro Vis select the PMAC Panel Pro control sub palette attached to the PMAC Panel Pro lib directory Depending on the view installed the following screen may appear 24 Application Basics PMAC PanelPRO User Manual PmacMotorJ og ctl al fMotor p Motor Motor Flags ea I Movl PID Motor Motor Ih Motor kotor l 5 afel gLimit 5 elect Limits MovellMovellP E Limits Motor Motor i hitra t Stat State bior PMAC Panel Pro sub palettes use words rather than graphical icons to define the functionality just as the naming in the directory structure does To place a PMAC Panel Pro Control on the panel the icon is selected from the palette and placed
91. M501 gt F SDE06 gt X coordinate M502 gt F SDE0O7 Y coordinate gt RUN BOOL M500 gt Y 2SDEUS e 1 1 open prog 61 clear hml 4 i113 100 P209 1000 Vector distance per increment P211 10000 Slarcing positions M501 10000 P212 10000 M502 10000 Move tracking while M500 1 P221 M501 P211 Cartesian distance to go P222 M502 P212 PZ00 sgart P221 P27 P222 P222 if P200 gt P209 If longer than increment P200 P209 P200 Fraction of distance P211 P211 P221 P200 P212 P212 P222 P200 else P211 M501 P212 M502 endif 164 DPR Dual Ported RAM PMAC PanelPRO User Manual x P211 y P212 endwhile close The panel for the example is shown below When the VI is running and Enable Track is checked the values in DPR Numeric Slave Cluster M500 M501 and M502 are written to memory continuously for use by the motion program Checking Enable Poll sets M500 true so that clicking the Program Run button enables the program loop If the box is not checked prior to starting the motion program the loop in the motion program will not execute The Close Loop button is provided to close the servo loops 1f they are not closed or the initial rapid move to home results in a fatal following error X Pos 6420 60 DPR Numeric Slave Example Y Pos 13590325 4 Enable Track Iteration Timer mS 16 SY Worm Plot DPA Numeric Slave Cluster 20000 0
92. MAC s Global State This exercise introduces a number of indicators controls and VIs for controlling and monitoring PMAC s general operational characteristics This is done using status indicators a simple control cluster for sending PMAC commands and a few clusters for configuring I Variables In general these capabilities are used for supervisory purposes and not exposed to general users The architecture for PmacGlobal ICVs follows those already introduced The basics are introduced with these six VIs and their cousins e PmacGlobalBufferSize Monitor and control PMAC buffer space during system development Buffers Open is true if an open prog open rotary or open PLC command has been executed and the corresponding buffer has not been closed yet Available Buffer Memory specifies how much buffer space PMAC has left for gathering and programs A define gather command reserves all available buffer space If Close Buffers is true the gather buffer is deleted and a close command is sent to PMAC Device Number 132 0 Butters Open Bool Close Butters Bool F Available Buffer Memory te e PmacGlobalControl Generate PMAC on line commands for controlling PMAC program execution and save state Command Executed Bool is true when any button is clicked in Global Control Cluster Device Number 132 0 Globe Global Control Cluster Ctrl e PmacGloballVarComm Follow PMAC Panel Pro s standard I Variable VI architecture When Se
93. New Output is false and the output clusters contain the data fetched during the last read Device Number 132 0 Enabled Bool T Buffer Length m2 128 Motor Number 132 1 81 11 If both portions of the example are enabled ensure that each requests the data for a different motor New Output Bool OFPRA Real Time Vector Cluster DPR Dual Ported RAM 149 PMAC PanelPRO User Manual servo Accurate Sampling There is an important issue regarding the PmacDPR Vector VIs that must be understood to avoid misconceptions PMAC is a very fast real time controller that generates more data than could possibly be used in any given application Previously the PmacGather collection of CVs that utilized PMAC s data gathering capabilities was discussed The gather facility gathers and buffers a specified set of items at a specified servo rate using PMAC memory The gathered data can be transferred to the host later for decoding and use The PmacDPR Vector VI collects the data in host memory on an as it gets there basis Samples will be missed when the application is busy with other operations This can be seen in the example s red chart strip of the Servo Timer difference This strip chart is the difference between successive Servo Timer samples and reflects the jitter in the sampling Most samples are taken every five servo cycles in this example When a complete buffer is accumulated passed back to the VI and then used to update the chart the
94. OR its not the first element of a buffer AND the current servo timer value is not equal to last measurement THEN fetch the DPR data into the proper buffer elements if BCount 0 BCount gt 0 amp amp ServoTimer MNum BCount 1 ServoTimer MNum BCount Commanded_Position MNum BCount PmacDPRGetCommandedPos DevNum MNum 1 0 Position MNum BCount PmacDPRPosition DevNum MNum 1 0 152 BurrerCount MNu m F Check for full buffer then copy to LabVIEW data structs if BufferCount MNum Buffer_Length_132_128_ BCount BufferCount MNum DPR Dual Ported RAM PMAC PanelPRO User Manual Resize the arrays in the structure NumericArrayResize iL 1 UHandle amp DPR Real Time _Vector_Cluster gt Servo_Timer_132 BCount DPR_ Real Time Vector Cluster gt Servo_Timer_1i32 gt dimSize BCount Jy SizeL BCount sizeof int32 SizeD BCount sizeof float64 memcpy DPR_Real_Time_Vector_Cluster gt Servo_Timer_1i32 gt Value ServoTimer MNum SizelL memcpy DPR_Real_Time_Vector_Cluster gt Position_Dbl gt Value Position MNum S1izeD Indicate a valid buffer to caller and reset buffer counter BufferCount MNum 0 ValidData LVTRUE else ValidData LVFALSE No valid buffer PmacDPRSetHostBusyBit DevNum 0 PMAC can do its thing return nokErr CIN MgErr CINLoad RsrcFile rf
95. Offset u32 3548 Add Offset u32 Q Write Valid Output DD6A Start Address u32 Enabled Enabled ag To run the example specify a set of items to gather Use the PmacGatherSelect cluster on the top left The operation of this is outlined in the section on PmacTerminalGather As shown in the example there are three items defined To create a Variable Background buffer select the items to be in the buffer and check the Enabled box In the example the upper set was created to handle these three items The lower set was created to handle P44 and P45 that are generated by the PLC program The VBGB Status Cluster maintains information about the individual buffers and the entire pool Refer the VI Reference for details of each item The top status cluster item VBGDB indicates that it is buffer 2 whereas the bottom cluster indicates it is buffer 1 Buffers are assigned in the order created Num Entries indicates that the top buffer has three items as defined by the Gather Spec and the bottom buffer has two items When the first buffer was created the Total number of entries was 2 After the second buffer is created the Total number of entries is 5 Start Address indicates the start of the buffer in DPR This is the last location reserved by DPR The Start Address of the first buffer created indicates the first address that can be used for DPR Numeric access Notes on the Use of PmacDPRVarBack Variable Background buffers should be created
96. PMAC PanelPRO Delta_Tau Data Slane Pre Jat AC Difset DAT Bits f e m DELTA TAU Ny Data Systems Inc NEW IDEAS IN MOTION Single Source Machine Control Power Flexibility Ease of Use 21314 Lassen Street Chatsworth CA 91311 Tel 818 998 2095 Fax 818 998 7807 www deltatau com Copyright Information 2003 Delta Tau Data Systems Inc All rights reserved This document is furnished for the customers of Delta Tau Data Systems Inc Other uses are unauthorized without written permission of Delta Tau Data Systems Inc Information contained in this manual may be updated from time to time due to product improvements etc and may not conform in every respect to former issues To report errors or inconsistencies call or email Delta Tau Data Systems Inc Technical Support Phone 818 717 5656 Fax 818 998 7807 Email support deltatau com Website http www deltatau com Operating Conditions All Delta Tau Data Systems Inc motion controller products accessories and amplifiers contain static sensitive components that can be damaged by incorrect handling When installing or handling Delta Tau Data Systems Inc products avoid contact with highly insulated materials Only qualified personnel should be allowed to handle this equipment In the case of industrial applications we expect our products to be protected from hazardous or conductive materials and or environmen
97. PMC in the PMAC User Manual shows how this capability can be used for precision registration PmacEncoderCaptureExamp This example demonstrates how PMAC Panel Pro handles encoder capture operations This is important when determining the position of a motor when a trigger occurs in the system The panel shown below has Motor Encoder and Coord System knobs a Motor PVE indicator and a Jog cluster At the top right of the panel is an LED that turns Green when an externally triggered capture trigger occurs and a position indicator whose value is the position captured when the trigger occurs Encoder Capture and Compare Operation 117 PMAC PanelPRO User Manual Before running this VI home the motors to be used Do this with the example covered in a previous section or execute a HOME command from PmacTerminal P Emm Encoder Capture Example i O oo a O D0 3 r Pos Captured 0 00 2 j T i g Jog Relative O E 4 E f Y 7 o0 10 20 30 40 50 60 7 0 80 90 100 a Encoder Counts iD Coord System Rising Edge of Flag v Encoder Yariable 2 Home Flag Capture Position Capture Control C Limit Flag Encoder l Yariable 3 O Limit Flag Capture Flag Amp Fault Flag Oe As with homing position capture the trigger condition must be configured prior to use This is done using the already introduced PmacEncoderIVarCapture cluster The PmacHomelIVar cluster is not required because the motor has been homed and the
98. PmacGatherCollect to sequence operations and so that they can get the information that they require for their operation The actual setup can also be done using Pewin 32 Pro PmacTerminal or the motion PLC programs This is not recommended if intending to use PmacGatherCollect to retrieve the gathered data These methods require intimate knowledge of PMAC s internal architecture and are handled by this VI automatically Device Number 132 0 Input Gather Spec Cluster Output Gather Spec Cluster e PmacGatherStart Start a previously defined gather operation Start the desired motion immediately after this VI executes Eliminate this VI if gathering is started by using the DEFINE GATHER PMAC program command in the program Device Number 132 0 Input Gather Spec Cluster Output Gather Spec Cluster e PmacGatherStep This is only one of any possible motion or encapsulated motion program Device Number i32 0 Step Bool Cutout Device Number i22 0 Motor Number i32 1 8 1 ie umber i32 U Step To STEE Walt Time m5 e PmacGatherStop Stop an executing gather operation Eliminate this VI if gathering is stopped by using the END GATHER PMAC program command in the program Device Humber 132 0 Input Gather Spec Cluster Output Gather Spec Cluster e PmacGatherCollect Collect the gather buffer and scale the data using each items scale factor The data in Gather Data Array is a two dimensional array of doubles with Nu
99. Pro can easily be added to the tables PmacPlot A few generally useful plotting VIs for setting plot colors and legends An XY Chart buffer is available to make an XY plot into an XY strip chart Code Interface Nodes and Dual Ported RAM PMAC Dual Ported RAM DPR provides a high speed binary data transfer mechanism that speeds access to certain types of motion data To facilitate this capability PMAC Panel Pro utilizes LabVIEW Code Interface Nodes CINs This collection of VIs demonstrates how to use this capability PmacCIN A detailed description of the process required for configuring the environment to use CINs with PMAC Panel Pro PmacDPR A large collection of VIs for configuring and operating the many modes of DPR supported by PMAC There are numerous examples demonstrating the use of DPR and how to modify the supplied collection to suit specific purposes PmaciInc A directory of include files required to use CINs or modify PmacDPR This directory will be empty if the PComm 32 Pro package was not purchased Sample Applications This collection of VIs demonstrates a general PMAC Panel Pro application and a set of tutorials to illustrate the correct use of PMAC Panel Pro capabilities PmacTestPRO An all encompassing demonstration of program encapsulation and monitoring with four different motion programs their PQM configuration and real time strip chart monitoring PmacTutorial A sequence of exercises cover
100. Space Buffers m T WEI 00 RET pe N63DW ESS 41 1 WE FNN RET ase IN GO W Warning Following Error Fatal Following Error Amplifier Fault Error Motor 1 Basic Terminal 101 The black screen is a multi line string with a scrollbar configured for normal operation Typed commands are sent to PMAC when the lt RET gt key is pressed LabVIEW does not do this automatically To accomplish this there is a Boolean button named OK hidden behind the string control that has its Key Navigation set to capture the lt RET gt key Select Project Find and locate OK and it will display Setting the Key Navigation this way means that when lt RET gt is pressed anytime the cursor is in the window the OK button is activated There is a lot of spaghetti diagram to keep track of the current line character position and other book keeping that fetches the line just entered from the multi line string and sends it to PMAC using PmacCommRespStr The terminal indicates it is expecting a command with a gt prompt on the screen This process puts the Key Focus on the OK button thereby removing the cursor from the screen indicator Focus is returned to the screen indicator by creating an attribute node for the screen indicator selecting Key Focus and setting it true every time the OK case is executed Another issue that arises in a terminal like string co
101. The compare equals EQU outputs provide a signal edge when an encoder position reaches a pre loaded value PMAC PC PMAC PC does not have a dedicated connector for the EQU outputs Instead the signals may be accessed using a 26 pin IDC connector over E point pairs E53 E65 The outputs are TTL level with very low drive capability they must be buffered externally before they can drive any real devices Acc 27 normally used as an I O buffer for the thumbwheel multiplexer port can be used to drive several of these EQU lines The 26 pin cable provided with the Acc 27 fits over the 13 jumper pairs E53 E65 Contact Delta Tau Technical Support for details PMAC and NI DAQ Interfacing 127 PMAC PanelPRO User Manual PMAC VME On PMAC VME these signals are brought out on connector J7 JEQU referenced to digital ground GND As shipped from the factory they are open collector sinking outputs with a ULN2803A driver IC rated to 24V and 100mA each They may be changed to open emitter sourcing drivers by replacing this chip in U28 with a UDN2981A driver IC and changing jumpers E93 and E94 PMAC Lite On PMAC Lite these signals are brought out on connector J8 JEQU optically isolated from the digital circuitry and either referenced to analog ground AGND or an external flag supply ground As shipped from the factory they are open collector sinking outputs with a ULN2803A driver IC rated to 24V and 100mA each They may be changed to open emi
102. The diagram has a case structure to allow selection of positions velocities and following errors To plot a mix of these modify the diagram Pause is implemented with a case structure that prevents the update of the chart The VIs for querying position etc and the PmacMotorsPVE clusters can be moved into the pause case This way the indicator update will also pause Save and Clear use the chart attribute nodes to access the History data required to implement their operations These pieces of the diagram are useful in many other applications because their use is not obvious in the LabVIEW documentation eeaeee Has ESE pee a ae B Pmac Motors Chart Oper Eii Development Tools Plot Select i EE re rrr ee ee rae aioe aioe rror ror eae ae eee FOCAL D OAR I DUR Ra A AEN DNNE ENA DANAA Position a WE Deb al Face h F y NN z P cive Pll Ej Piot Color S 2 a rk Pa TF dere ra r Plot Select 7 2 Fea ae ofa hh dir True p aeee ee ee Pmac Motors Chart 3 gl E Selec 3 Pmac Motors Chart T ty eS is a k 3 OS i a Term Menu Enable Menu Track Ged EAE Active Plott Pmac Motors Chart Pmac Motors Chart ran a a a a ro a al el a a rt aaa a haar aaa a mayan 83 PMAC PanelPRO User Manual PmacTerminalMotorX Y This tool is based on PmacTerminalMotors Its purpose is to monitor and plot selected motor motions executing in a 2 Axi
103. The output enable bit M112 determines whether the compare equal flag will be output on the PMAC EQU line 1 enables This must be set to use the signal to interrupt the host or to trigger an external event The output invert bit M113 determines whether the EQU output is high true or low true one inverts low true For host interrupt purposes this must be configured high true Triggering External Action To trigger external actions from a PMAC PC put a connector on the E points E53 E65 that normally jumper these signals to the interrupt controller An IDC 26 pin connector works nicely These signals must be buffered the TTL drivers for these outputs on PMAC PC are very weak Obtain an application note on techniques for accessing these signals by contacting Delta Tau Technical Support On the PMAC Lite PMAC VME and PMAC STD a JEQU connector provides direct access to the Compare Equals signals The outputs are open collector sinking outputs rated to 24V and 100 mA Replace the existing driver IC with a sourcing driver IC UDN2981A To use these hardware signals and several others refer to the PMAC User Manual Their use as far as NI DAQ boards are concerned will be covered in the next section PLC Compare Handling The PLC programs PmacPosCompSetup pmc and PmacPosCompGen pmc located in PmacEncoder demonstrate the use of a PLC to generate a very rapid series of equals pulses at specified position intervals PLCs are an excellent way
104. Use them to query the coordinate system configuration so that motor motion can be specified in coordinate system units rather than encoder counts Generally these VIs will not be used at this level Their capabilities are integrated into other collections of VIs PmacTutor12 Using Coordinate System Definitions This exercise introduces ICVs for determining coordinate system definitions and parsing these definitions into LabVIEW data types that can be used to convert between encoder counts and coordinate system units and determining which motors if any are defined in a given coordinate system The architecture for the following PmacCoord ICVs is a little different from that used for status and other fundamental queries A few of these VIs make use of local state variables to keep track of queries for coordinate system definitions so that these queries are not placed every time the VI is executed within your VI This reduces communication traffic and relieves the developer from having to check for a new query The fundamental assumption in this approach is that after the application has been created it is not necessary to constantly redefine the specified coordinate system When a coordinate system definition has been requested from PMAC and changed the new definition will not be reflected in the application To refresh the definition temporarily request the definition for another coordinate number or close the VI and reopen it The architecture
105. VI supply an optional Capture Offset that will fetch and compute the proper offsets Once the offset 1s captured and computed it is maintained by the VI s internal state PmacEncoderToCoord has a companion that takes positions specified in CS units or motor position and converts them to encoder position This VI is most often used to take a motor position in encoder counts or CS units to encoder position for compare equal operations e PmacEncoderToEncoder This VI converts Input Value in either CS units or motor position in encoder counts to an absolute encoder position for compare equal operations Coord Specify Cluster specifies a motor within a CS and an attempt to convert Input Value from CS units to encoder position If the motor is not defined in the CS Input Value is assumed to be motor position in 116 Encoder Capture and Compare Operation PMAC PanelPRO User Manual encoder counts and Output Value is encoder position If the motor is defined and Convert is true Coord Defined is true and Output Value is scaled from CS units to encoder position Device Number 132 0 ___ Coord Defined Bool Coord Specify Cluster Capture Offset Bool F Input alue Double The diagram fetches and processes the encoder position two VIs that implement the position transformations just discussed PmacEncoderRegServo covered later fetches the encoder position not capture positions directly from the encoder
106. Variables The program is then started as long as there is no program executing in the associated CS When Program Running is true this or another program is executing in the associated CS DeviceNumber 132 0 prere Frogram Running Bool F Program Run Bool F ma Program YI State Cluster Panel Show Bool F i i Wew Output Bool F Input PAM Warant Arap eam Output PUM Warant Array PmacTerminalExecute This tool is an interactive motion program debugger that queries PMAC for the actual program and allows stepping through it in a variety of ways Querying PMAC for the program allows seeing whether the program is actually what itis If a program is donloaded without first clearing the program buffer the down load contents are appended to the existing buffer The indicators and their operation should be obvious Extensive on line help is available for the panel controls using LabVIEW s Help Show Help facility Program 32 v Listing E Ho Program Running Program Hold A Pre Jog Hove End Of Block Stop Continuous Motion Req Continuous Motion Mode Run Time Error Warming Following Error Fatal Following Error Amplifier Fault C 5 1 i i ii ii LECCCLEC Kotor Positions wW CS Units Pose ens Po te To operate the tool select a program using the menu ring and a coordinate system to execute the program in using the knob Only loaded programs
107. Y charting is similar to that used to implement the standard chart in PmacTerminalMotors and PmacTutor10 The main difference is that the chart has no history buffer Hence a hidden control for the data provided to the chart named XY Chart Data has been created Plot Select es _ i a E a ei gt FE PONE Bu EI beleo ET Eea EA pen Eo a seco CTF iad Plot Select sect a e C S Defs gt A Coord cones ca Do 84 Development Tools PMAC PanelPRO User Manual PmacPlotX Y ChartBuffer takes the two point X Y cluster terminal from PmacMotorsPlotSelect VI and buffers them to generate an array of clusters for the X Y Chart To update the plot legend create an attribute node for the chart select the two items shown and set them from the cluster provided by PmacMotorsPlotSelect PmacTerminalGather This tool is a general purpose tool for synchronously gathering and plotting PMAC data and outputting the data to TAB delimited spreadsheet files for use by Microsoft Excel LabVIEW Matlab or other analysis and plotting applications It executes a step or an encapsulated motion program Encapsulated motion programs created by PmacTerminalEdit can be installed easily in the tool by replacing the existing PmacProgSubVI with a custom one The LabVIEW chart controls enable panning and zooming of the plot Select File gt Print Window from the menu bar to print the panel or a file at any time As with the PmacTerminalMo
108. a se E E E 73 BEC TI OA sraa state ccm atte E aces ce oe E EN puedo A arlene aca pera aca E E A 13 ii Table of Contents PMAC PanelPRO User Manual Basic Command Editing wccdeissscsiss wo siciascediancsseuaadenendeaiiease aanaenaehastadan ana aaa eA RS 73 Buffer MIG CEILI ssrisircirmsiirieriesiinnie n ein eaaa a E AR i a n AE a Eai 74 Terminal IndicQiorS tisseasscsassas ioe scustsnmscaiatamenataoaionieyoiaceutanioeaadeacseaaasan sera aeaa druine adia 74 bg A ee OO 2 S crnisss a a aE iaa aiei 74 Implementation Diagram sseeeeeeessneennnssssseesnssssseeeesssssseeerosssssereresssssseereossssseeeeossssseseereossseeerossssseeeressssseeereo 75 Piac Termina U o ae E E E E E 71 Pac Lermon eee E EE E E E E 78 Encapsulating Motion ProgramS eeeeenssssnnnnnnssseeennsssssseerenssssseeerossssssereooresssserereosssssseressssssseeeeessssseereessssses 79 Pac Cmn CG O eeen E E E EE 80 Pma TerminalA OO ees E E E E E 82 Pmac Terminal Moor X Y sassari eE e EE eoa EA E EE EE eE edsr ETE E oiai 84 Piac NC ra HV Al Gathe sadenica eE A EEEE N EE E A EE a a n eai 85 Specie Gather OIC SSCS vinien a r OEE E ATEA EAEAN AAA OA 5S ENCAPSULATED MOTION PROGRAMS AND POMS ssssssssssssssssccccccccccccccccccccccccccccccccccccccccccccccccssssecs 91 Piac Pron SUV Leca a EEE a tone seaeaanaieancaaauencostanauss 91 Pac EO ME aN e E E E e E ce ee ameuetaamacsbeaqwateaneeesn 93 Fua OM CGO I iae EE EN EES EAEE E EAE AAi 95 PHNGEE OM CORVETSIONS Dates ei
109. aS 26 PMAC Fabel Pro Totoral Seicise a a a Ea o E aiia 26 PMAC Panel Pro Communication Tutorial ccccscecceccccccccecceeeesssseeeeeeceeecccceceeeessaaeegssssseeeeeeeeeeeeseseeaaagegagsssss ZF Fmacl nord A esine 2 COMMS 2 S VO riara a AAA A E A A 27 PmacTutor2 Sending Commands and Getting Responses cccccccccssseesecccceeeeeneeeeseeeeeeeaaeeeseeeeeeeeaaaaeseeeeeesaaaaaaes 28 PmacTutor2a Communication LOGON is sauccaiwtingiainanedsesntaricesdanesceiadaeasateinedsrintacadoidiresteindstisadstraedeinbatbiessiaddeas 31 PmacTutor3 Sending Commands Using Buttons cccccccccsssccccccccccccseescccceeeeneesseeseeeeeeeeaaeeeseeeeeeeaaasseeeeseeueaaaeeees 33 Pmacl utori Buton and Response VIS shncwtscsasscrsastcnugecinsetesdncebsisaudwevisenuasciasebiois atts E E 34 TUNG lulo Accessine PMAC SUUS esis ar eE as S T EE 36 PmacTutor6 Accessing PMAC I Variables 000n0nnnnnnnnnnnnennnnnsssssssssssseecereessssssssssessseecererssssssssssssseereeeeessssssss 38 Pmaclutorop Accessing PMAC Memory sisissiascsascvarasintansssicnbsesasascses dowossinsesisteesd TE E EE 4 PMAC UMN OE OIC Sareea prcetocss sores E E E sopra beau oe ts Gedcnab EA E E 43 OTe OV AINE S E oats ses oss Sessa ee cent ste pion sane veieadnataaneaoes asses mien tenans sitscau secu stnec aaseeemnesasaeameees 44 PA MOC Oh i teeter meet a eee nn ene a et ee ern eT ee eee ee et eer ter ere 45 PmacTutor7 Position Velocity Error and Jogging cccccccccccccc
110. abVIEW It is divided into four basic levels or categories At the very lowest level is VIs that provide an interface to PComm 32 Pro Above this are two levels that provide collections of indicators controls and VIs that can be used in the LabVIEW applications to control PMAC and monitor its status Finally a level provides program development utilities that can be used to encapsulate PMAC motion and PLC programs as VIs that are controlled by the application In general the top three levels are used for application development 12 PMACPanelPRO Basics PMAC PanelPRO User Manual Your Logic Development amp Encapsulation Indicators Your GUI amp Controls Command Generators PComm32 LabView Interface VIs PMACPanel Client Application PMAC Panel Pro Interface to PComm 32 Pro PMAC Panel Pro s lowest level provides a flexible set of capabilities through which all command interactions with PMAC is conducted To do this PMAC Panel Pro wraps selected PComm 32 Pro functions with appropriate logic to provide a transparent interface between the LabVIEW application and PMAC It provides three primary categories of access to PMAC 1 Device Management 2 Query Response ASCII and Binary Communication 3 Download Management Device Management Open Close Configure ASCII Commands Query Response and Responses Conversion To From LabView Datatypes Binary Variable Access Serial Bus Manage Programs Download Mana
111. access the same data using the ASCH PQM collection of VIs Each of the M Variables can be accessed using either method From the top down are M444 an integer M445 a double M446 a bit field in a Y address M447a single bit in an X address and M448 another bit in a Y address Access to the M Variable data using DPR requires an address bit number or field specifier These are also shown on the left portion of the panel DPR Dual Ported RAM 157 PMAC PanelPRO User Manual At the very bottom are a few controls to enable and monitor an encapsulated PLC that generates M Variable data that is available to the host and PMAC simultaneously because it exists in DPR Check the Enable box and then click the PLC Enable button and the PLC program will begin executing The indicators for each of the M Variables will begin updating immediately with the data being generated in PMAC s PLC If the PQM Disabled box on the right is checked these indicators will begin updating also with a noticeable increase in the interval timer This is because of the large overhead required to process the required ASCII commands M Variables and VI Address Specification Before getting into the example deeper look at the PLC M Variable definitions shown below These specify the addresses where PMAC will place the data during its writes to M Variables and fetch the data when it reads an M Variable The address modifier DP defines a 32 bit long integer in DPR handled as the
112. acneuesehanceataeeemedactes 19 APPLICATION BSS acc ws cars causes E E access ewe ae E A RE 21 BOS tora eaten pone E om nr E saa ste atlantis ieee sg cesta te elo acne neue A EEE AEA 21 LabVIEW Techniques for PMAC Panel Pro ccccceccceeccccsseccesssssessseeeeceeeecccesseecesscsseseseeeeeceeeceessececeaaeees pil Dataflow and Sequencing ssa satt acc cuiesdacaatnaaisa tata egasueites ostadd aaateaaieadnaausadsusstsctadainaete aise Sucenaauaddieeuedaincedaaouaeaes 21 Dataflow and Recurring Execution ooeoeennnnnnnnnnnnnssseennnnssssseennsssssseerosssssseeresossssserressssssrereossssseereessssseeeressssssees 21 OVE UP ONTO isi S EEE N 21 LC OPEN e a N T N N 22 E LA a CY EEEIEE E IE E E E orden SEE E E E E EN Ze PTS SCO VE SE AEE ance ance eted quotation TEE EN E E EE E E E E 22 Mechanical A CHON cersesc e e i Ea ERa ea AE aaae eaae NET 22 PMAC Panel Pro Indicator and Control ClustefS nnennnenssssssssesseerressssssssssssssseerrrersssssssssssssssseeeeessssssss 23 ACCESSING PMAC Panel Pro VIS oxczvscecasavastvasapaduswssiaeierevacucsaagueleretuaduswianntiemededdrassdgeenventuasnsesdsninentadinareaiaeoustoades 24 Clusters with an Associated FUNCTION VI cccccccccccccecceeeeecce cece eee e nese eeeeeeeeee eee EEE EEE EEA EAA A AAA EEEEEEEEEEEE EEE Edd aEE GSES aaa aaa ES 25 PMAC Panel Pro VI Terminal Conventions ccssseccesececeeeeceeeee cece eens eee eeeeeeeee eee eee cess eee GEA AAA AAA A EELS EEE EEE E EE EEE EE EEaEa
113. age Acquisition GPIB Instrument Control Industrial Communication Customer Furnished Software PMAC Panel Pro requires Microsoft Windows 95 or later version or Windows NT 4 0 to operate Delta Tau Software PMAC Panel Pro requires the existence of Delta Tau s PMAC device drivers Several possible options have already been installed or purchased with PMAC Panel Pro The following information will help determine the steps needed to successfully install and configure PMAC Panel Pro e Ifusing PMAC Executive for Windows make sure that Pewin 32 Pro is installed and tested Skip those installation steps involved with the installation of the PComm 32 Pro device driver e If PComm 32 Pro is installed and tested skip the steps for the installation of the PComm 32 Pro device driver Getting Started 3 PMAC PanelPRO User Manual e If Ptalk DT Pro has been purchased and installed skip the steps for the installation of the PComm 32 Pro device driver e If none of the above options has been purchased install a limited edition of the driver configure it and test it Certain PMAC Panel Pro capabilities may not be supported without PComm 32 Pro National Instruments Software PMAC Panel Pro was developed for LabVIEW 5 0 Previous versions of LabVIEW are not supported by Delta Tau s PMAC Panel Pro motion package LabVIEW must be installed prior to installing PMAC Panel Pro LabVIEW patch 5 0f1x2 available from National Instruments via FTP is r
114. agram Enabled Bool gi Enable Bool TF a i EET Device Number 132 0 F Enable Motor Numbers 132 1 8 1 eS a a fE Enabled Bool Servo Period i232 1 g 7 LabVIEW provides several routines that make working with G data types easier These routines support memory allocation file manipulation and data type conversion Detailed documentation on these topics can be found in the LabVIEW Code Interface Reference Manual Setting up a PMAC Panel Pro CIN Configuration There are two ways to create a project file for the CIN source code created by the LabVIEW The information presented next is of general importance and leads to a much easier way to develop CINs for PMAC Panel Pro Adding PComm 32 Pro Include Path To access PComm 32 Pro add the following directories to the Visual C development environment by selecting Tools Options to display a tab dialog Click the Directories tab and select Include files in the Select directories drop down menu Double click the outlined box in the directory and a list dialog box appears to select a directory for the include path The dialog shown below already includes the D LabView PMAC Panel Pro lib PmacInc directory PComm32 Code Interface Nodes 137 PMAC PanelPRO User Manual If PComm 32 Pro is installed use this directory The result should look something like the following Options Py xX Editor Tab Debug Compatibility Build Directories E Platform Show dir
115. ally a motor is assigned to a single coordinate axis as in the following definition amp 1 1 gt 1000X This specifies motor 1 as belonging to coordinate system amp 1 and that one X unit is 1000 encoder counts The scale factor would thus be 1000 oo Coordinate System Definitio Application Basics 61 PMAC PanelPRO User Manual The limitation arises when coordinate system axes are linear combinations of several motors as in this example that rotates the coordinate system 30 degrees from the mechanical axes of the motor amp 1 l gt 8 660 25X 5000Y t2 000X FOG 60 291 There is no easy way to parse this information when returned by PMAC and present it for use because there are so many possible ways of defining coupled motor systems Furthermore the individual items in the PmacMotors indicator clusters as defined would change the definition every time it is switched from encoder counts to CS units If the axes are coupled like this study the VIs presented here and modify them for custom use or hard code the scaling and motor state conversions into the application There are three VIs that use the scale factors provided by the previous VIs to convert numerical inputs from encoder counts to coordinate units and back This can be done for individual motors or all motors in a coordinate system e PmacCoordMotorToEncoder Coord Specify Cluster specifies a motor within a CS and an attempt to convert Input Value from CS units to en
116. ample that waits for the external trigger supplied by EQU1 to begin asynchronous acquisition at the specified sample rate In this version of the example channels 0 1 and 2 are sampled at 1 OKHz The waveform chart in the panel below shows a triangle signal the EQU trigger pulse and the servo clock Run this VI by selecting Simple DAQ in the menu ring and clicking the Run DAQ button on PmacDAQMove after the PLC is configured and enabled and the motor is jogging If the motor is not jogging the VI will wait five seconds for the trigger and then time out The default servo clock has a 442uS 2262 Hz update rate As can be seen in the chart the EQU signal is active low Check the PmacDAQMove panel shown above to see that indeed the operation is configured for EQU Low true Hence the initial trigger that started this acquisition started on the falling edge or leading edge of this pulse l For instructions select Show YI Info from the Windows device Jo transposed waveform graph s 10 0 channels O 0 1 2 i 3 S scan rate trigger edge a5 10000 00 s Falling ee buffer size time limit sec ni s4000 5 0000 i 5 0 scans to read 75 at a time 1000 scan backlog oe 100 E 10 0 1 FE 1 35 1 36 1 36 input limits a ares lets a Alt pia a E ee 2000 are a SeT Sita tit tonto Multi Trigger DAQ PmacDAQSync is a LabVIEW example that performs repeated acquisitions synchronized by the external trigger
117. amples e PMAC Panel Pro will cause PMAC to execute motion e PMAC Panel Pro may require some changes in PMAC s I Variable configuration An I Variable may inadvertently be changed during the execution of some of the examples If there is a system working currently use Pewin 32 Pro to save the configuration before making changes to the PMAC PMAC Panel Pro will download programs and PLCs when some of its components run If there are motion programs and PLCs on the system currently use Pewin 32 Pro to save them before executing those examples that utilize encapsulated motion programs and PLCs Otherwise they will be replaced Safety Summary The following are general safety precautions not related to any specific procedures and therefore may not appear elsewhere in this publication These are recommended precautions that all personnel using PMAC must understand and apply during different phases of operation and maintenance Motion Commands Caution Until proper hardware safeties have been installed configured and tested exercise extreme caution when moving motors to prevent damage and possible injury Keep Away from Live Circuits Do not replace components or make adjustments inside equipment with power applied Under certain conditions dangerous potentials may exist when power has been turned off due to charges retained by capacitors To avoid casualties always remove power and discharge and ground a circuit before touching it
118. and simplify the interface the PmacDPRVarBack collection of VIs provides three VIs One configures one or more Variable Background buffer one fetches its contents and one buffers the data into vectors To aid in specifying items the configuration VI uses the PmacGatherSpec cluster that forms the heart of the PmacAddress and PmacGather collections The gathering of Variable Background data is not controlled by the servo clock therefore the data items might be taken at slightly different servo times PMAC s Variable Background mechanism is very sophisticated and an integral part of PMAC Some specific issues will be covered in the next section PmacDPRVarBackExample The following example demonstrates the configuration of two Variable Background data buffers This allows building of buffers that support specific requirements For instance one buffer can be declared for each motor and coordinate system in the system Then another one can be declared for each I O device and one to monitor a collection of miscellaneous items Gather some of them as vectors some for indicator clusters and some for background computations The only limitation is that more than 128 items between all of them cannot be declared The panel for the example shown below allows the definition of two independent buffers The support clusters etc are collected into boxes in the bottom left quadrant Each buffer has a VBGB Status Cluster containing information about the
119. anel shows an Item Name as it appears in the menu and an Item Tag that is used by PmacTerminalMenu vi to decode the selection and execute the desired tool To add custom tools to the menu highlight an existing menu item entry and select Edit Insert User Item Give the new entry a name and a tag Save the modifications All existing PMAC Panel Pro tools using the menu capabilities will now reflect the changes If a new tool has been added some additions must be made for the new VI 70 Development Tools PMAC PanelPRO User Manual Modifying PmacTerminalMenu To actually implement the new selection add it to PmacTerminalMenu The diagram for the VI is shown here The instructions indicate to add a case for the Item Tag specified in the Edit Menu panel and to copy the VIs to execute the VI into the new case Once completed all tools can access each other without needing any new configuration TaT Te Ts Te T Te Te Te Te Te Ts Es Fe e Fe a Fe ee ee eee Foe a Foe Fe Toa e eee e Foe Fe ee ee Toe Fe Te Te Ta Fn Te Fe nd grn aTe Te Ee Te T Te Te e Te Ta Fe Fe Te Fe Te Fe Ta F Ta F Te F e Fe Te F a Te Te Fe e Fe Fa Te Te Te e Te Ts Fe e Fe Te Ta e Te Te Te T imer 5 ave TENANAN SA SSA Saa SSA Sia oaa aa SA eaa SSA SEA Saa Ssa an SAA eaa ak Sa aa mA Sa a Sa aa Sa tS Sa at oa a m3 To add new tool selections click the right mouse button on the case selector and select Add Case Enter the Item Tag used when adding the ttem to
120. at if a software limit is too close to zero the motor may not be able to stop and reverse before it hits the limit The motor will stop under position control with its commanded position equal to the home position If there is a following error the actual position will be different by the amount of the following error Home Complete If monitoring the motor from a PLC program or PMAC Panel Pro to see if it has finished the homing move it is best to look at the home complete and desired velocity zero motor status bits The home complete bit is set to false on power up and reset it is also set to false at the beginning of a homing search move even if a previous homing search move was completed successfully It is set to true as soon as the trigger is found in a homing search move before the motor has come to a stop The home search in progress bit is simply the inverse of the home complete bit during the move it is true until the trigger is found then false immediately after Therefore the monitoring should also look for the desired velocity zero status bit to become true which will indicate the end of the move Home Position OffsetPMAC stores the encoder position captured during the homing search move for the motor automatically This value is kept in the Motor Encoder Position Offset Register Y 0815 Motor 1 Y 08D5 Motor 2 etc which is set to zero on power up reset for motors without absolute power on positioning If Ix10 gt 0 to spe
121. ata is stored in an intermediate memory buffer after it is acquired from the DAQ board Data is retrieved from that buffer and displayed on the graph PMAC and NI DAQ Interfacing 133 PMAC PanelPRO User Manual e PmacDAQSync Acquire N Multi Digital Trig vi This VI retrieves the specified amount of data from one or more analog input channels each time a digital start trigger digital stop trigger or digital start and stop trigger occur It shows how to trigger an acquisition multiple times while avoiding the overhead of configuration and buffer allocation each time This is a timed acquisition meaning that a hardware clock is used to control the acquisition rate for fast and accurate timing It is a buffered acquisition meaning that the data is stored in an intermediate memory buffer after it 1s acquired from the DAQ board e PmacDAQSyncServo Cont Acq amp Graph ExtScanClk D Trig vi This VI retrieves the specified amount of data from one or more analog input channels when a digital start trigger digital stop trigger or digital start and stop trigger occur This VI uses an external scan clock to continually retrieve data from one or more analog input channels This VI will work only on devices where a scan clock signal can be connected externally It is a buffered acquisition meaning that the data is stored in an intermediate memory buffer after it is acquired from the DAQ board Single Trigger DAQ PmacDAQTrigger is a LabVIEW ex
122. ation by running the VI again Early versions of Windows 95 do not work well with LabVIEW and the PComm 32 Pro device driver If the problem persists contact Technical Support If the system continues to crash try to note any error messages in detail 10 Getting Started PMAC PanelPRO User Manual PMAC PANEL PRO BASICS PMAC Panel Pro and PMAC as Client and Server PMAC Panel Pro is a powerful LabVIEW tool kit that allows the development of GUI based clients requiring precision multi axis motion that integrate PMAC s unique capabilities with other LabVIEW devices PMAC Panel Pro is not intended to replace a thorough understanding of PMAC s powerful motion and PLC capabilities its architecture its command language or its programming language PMAC Panel Pro is not a Graphical Motion Language GML that allows the writing of PMAC programs by stringing together a set of motion description VIs The client server architecture illustrated below works exceedingly well with LabVIEW s G Code data flow execution model and matches the model used to communicate with GPIB Industrial Automation networks etc PMAC Panel Pro applications place requests to PMAC to set motion characteristics run motion programs and configure and monitor PMAC status PMAC executes these requests without the assistance of the client application as long as power is applied Using this model PMAC Panel Pro applications can use data from other LabVIEW devices to con
123. by one The range on the ring can be changed from 0 7 to 1 8 However this leaves item zero in the ring empty ieee and convert Unbundle al postions Pos Array Pmac Motors Chart Mes h see Fera ei gt os at Jelech i T ply 7 Get C5 Dets cel I pen for displa 5 P Motor Numb s zc otor Number ae Coord Plot Select ra Active Plot titra gt Jog Def ors gt H Flot Color Close ma C 5 Dets 5 E Close all a t z Rings start their indexing from 0 ap Ei vet plot attribu ased on selections Add 1 to get the motor number Use autoindexing to process array of and C S clusters When developing the applications create custom simple VIs to do common things PmacMotorsClose is an example of this The VI and its diagram are shown here If PMAC is being send simple commands repeatedly in the application begin creating a custom set of useful VIs e PmacMotorsClose Close all PMAC motor loops Device Number 132 0 Dis Device Number i32 0 The important thing to note about this VI is that eight commands are executed by PMAC A lt CR gt separates the individual commands in the command string Application Basics 57 PMAC PanelPRO User Manual Device Number 132 0 utput Device Number 132 0 PmacGlobal ICVs This series of exercises introduce the PmacGlobal collection of IC Vs These control monitor and configure PMAC s global characteristics PmacTutor11 Configuring P
124. cPQM clusters are provided for use on the applications panels Defining these clusters binds the P Q or M Variable s name with the actual numerical value to be used with the variable These are based on variations of the cluster definition for PmacPQMLong e PmacPQMLong Cluster for tying P Q or M Variable definition with an 132 control indicator After inserting on the panel specify a P Q or M Variable name for the Variable Item and make it the default using Right Mouse Button Data Operations Make Current Value Default Replace Control to reflect the requirements POH Long Cluster PQM Long Cluster Cluster for tying P Q or M Variable definition with an i32 control indicator After inserting on the panel specify a P Q or M Variable name for the Variable Item and make it the default using RightMouseButton Data Operations Make Current Value Default Replace Control to reflect the requirements Variable String defining P Q or M Variable name e g P34 Control Control for associated P Q or M Variable PQM Type e PmacPQMBool POH Bool Cluster e PmacPQMShort POM Short Cluster p34 3 o Encapsulated Motion Programs and POMs 95 PMAC PanelPRO User Manual e PmacPQMDbl POM Double Cluster When these are inserted on the panel feel free to move the items around replace the actual control change the format and range color Boolean text etc Remember to keep the cluster order as indicated When the name of the Va
125. ccscsececcesicccscevececesescuccasevecececessdccetevevesesescsccasecesssandesassvive 137 LabVIEW Code Interface Node Basics iccsaccsevadcsenenavecastsrentsesaxantvadexemeneboususvaseouvsatanepeaeicnenesetaxestavenrtataxanstadeneliess 137 NET CIN e E EE 137 Setting up a PMAC Panel Pro CIN Configuration cccccsseseeceeeececceeeeeeaaaesessesseeeeeeeceeeeeeeeeaaaaasessesssseeeeeeeeeess 137 Adding PComm 32 Pro Include PAthii cccccccccccccssecccccccccceeneeseeeceeeeennseseeeeeeeeeeeaeseeeeeeeeeeaaeeeeeeeeeeeaaaaaeseeeesseaaaaaneeeees Io Ardino T MaC FTO CC RRR eR rer ERA E EE ne AVEN E A ee Te ee eee ee ee 138 GET gy aes E D See ee ere A A A Re AA OE ae ER eC Bee eee one ee ee ee ee ee eee ee eee 138 The Lasy Way to Add New PIO COIS iniii a i a lest tes Suaed ia aeaiiai 138 Multiple CIN Projects ina WOVKSD ACE scccciigicisitieiiiananininn iniaiaiai ii aaa iai iaid 138 Creating a CIN C Stub for PComm 32 Pro ooooeeeeeeensssssssssssseerrressssssssssssseesssecerreessssssssssssseceerreesssssssssssseeeeeee 139 DPR DUA L PORTED RAM ase ces sc cest eves cncheneicatcececcechsccccateccarceesvcetcnceccneteaccsntpacsecentenedceteaceccucteaeveeteecsecuusetevcetoacs 141 Required Background Understanding cccccccssseeseeeeeeeeeeeeeeeeee eee een geet teed eeeeEE EEE EEE EEE E EAA A AAA EEEEEEEEEEEEEE ESSE EEE HEHEHE 14 General Architecture Notes ccccccccccccccccscssscensssseseeeseeeeseccccauauccesssssssssseeseeeeeecccceeuaucceassuseseeeeceseee
126. cessing DPR Update of a particular item is not synchronized with a specific servo cycle To minimize the work of a developer and simplify the interface the PmacDPRFixedBack collection of VIs has three VIs that collect the 28 most useful items and bundle them into LabVIEW clusters The gathering of Fixed Background data is not controlled by the servo clock therefore the data items might indeed be taken at slightly different servo times PmacDPRFixedBackExample The following example demonstrates all three PmacDPRFixedBack VIs One VI configures and enables the operation of Fixed Background data buffering one fetches the data for a specific Motor CS and one buffers a set of vectors PmacDPRFixedBack collects the data for a single motor operating in a CS PmacDPRFixedBackVectors buffers the data exactly as PmacDPRRealTimeVectors does The panel for the example is shown below The panel demonstrates the fetching of Fixed Background data for a single Motor CS on top and the fetching of vectors for charting on the bottom On the left are controls for selecting which motor and CS to use for the fetch and enabling the fetch from DPR The example is different from PmacDPRRealTimeExample in that because the Fixed Background data buffer handles motor CS and program information it has an encapsulated motion program that can be configured and run using the box of buttons in the middle 154 DPR Dual Ported RAM PMAC PanelPRO User Manual Pmac DPR Fixed
127. ched from PMAC and provided by Output Motor I Move Cluster with New Output true Set Get is not required and defaults to a Get operation 52 Application Basics PMAC PanelPRO User Manual Device Number 132 0 Bed ater fo Her Output B ool F Motor Number 132 1 4 7 o Set Get Bool F Output Motor Move Cluster Input Motor Move Cluster e PmacMotorIVarSafety Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the safety I Variables for the specified Motor Number are set Otherwise they are fetched from PMAC and provided by Output Motor I Safety Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 32 0 E St Her Output B ool F Motor Number i32 1 1r ee SethGet Bool F 1 Output Motor Satety Cluster Input Motor Safety Cluster e PmacMotorIVarFlag Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the encoder flag I Variable x25 for the specified Coord Number are set Otherwise they are fetched from PMAC and provided by Output Coord I Flag Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 132 0 MOCI IE MM tort He Output B ool F Motor Number 132 1 8 1 4r Set Get Bool F Output Motor l Flag Cluster Input Motor Flaq Cluster The panel for this exercise shows the three main PmacMotorIVa
128. cify an absolute power on position read from a resolver so no homing is necessary this register holds the negative of the power on resolver position In either case it contains the difference between the encoder counter zero position power on position and the motor zero home position scaled in counts Note Prior to V1 14 firmware this value could be obtained by using the PLC program HOMOFFST PMC shown in the Examples section of the PMAC User Manual Starting in V1 14 PMAC stores this value automatically There are two main uses for this register First it provides a reference for using the encoder position capture and position compare registers These registers are referenced to the encoder zero position which is the power up position not the home motor zero position This register holds the difference between the two positions This value should be subtracted from encoder position usually from position capture to get motor position or added to motor position to get encoder position usually for position compare To move an axis until a trigger is found then convert the captured encoder position to a motor position use the following M variable definitions MILO 3 gt xX eeC003 24 5 2 ENCL Posie ion caclure register Mi LJ gt xX2sCo00 17 ENCI position capture flag MI2Z25 gt Y 50815 24 S 1 encoder pos offset register Zero Move Homing To declare the current position the home position without commanding any movem
129. ck to actually fetch the data The configuration VI requires a Gather Spec Cluster and produces a VBGB Specification Cluster for the handler The VBGB Status Cluster is not required by other VIs but serves a useful diagnostic purpose e PmacDPRVarBackConfig This VI creates a set of Address Items specified by Gather Spec Cluster using the DPR Variable Background when Enable is true The VI produces a VBGB Status Cluster with relevant information about this buffer and a VBGB Specification Cluster containing information required to actually fetch the data using PmacDPRVarBack and PmacDPRVarBackVectors Operation is disabled when Enable is false Output Enable is true when operation is enabled The VI maintains the state This VI can be used multiple times to create sets of VBGB Address Items See the documentation for limitations on how many sets can be created and their size Device Number 132 0 Enable Bool T Diable All Bool F Gather Spec Cluster Variable Background buffers allow the gathering of the contents of any memory location X Y DP etc To handle all data types the data fetched from DPR is all treated as a double This allows PmacDPRVarBack to treat the fetched items as an array rather than have VIs to handle each type or implement a complex typing mechanism To access bits from a particular item index the array convert it to an integer and use it The Input Array and R W inputs are not supported yet e PmacDPRVarBack
130. co Hierarchical Encapsulation PMAC Panel Pro attempts to break panel clusters and function VIs into manageable chunks that group functionality Using this approach piece together those items needed to build an application Each VI builds on top of the capabilities provided by still lower levels until almost everything funnels through PmacCommSendStr and PmacCommRespStr In using proper program design the result is easier to maintain and modify for individual purposes The VI Hierarchy for this exercise is shown here to illustrate this point File Edit View Project Windows Help A ais men 50 Application Basics PMAC PanelPRO User Manual Accessing Status Bits To illustrate how PMAC Panel Pro handles status information the diagram for PmacMotorStatJog is shown here The VI calls the PmacMotorStat VI covered in PmacTutor5 and the Boolean array for each status word is indexed to get the desired bit The individual bits are assembled into a cluster for use by the indicator Notice that a string is created indicating the associated motor in the status cluster It updates the indicator cluster automatically To remove this simply eliminate it from the cluster and modify the panel cluster a Device Number 132 0 EM Hy EA 2e Motor Status Jog Clust TF olor abate Jog LIWSter Motor FAI Stat m t a a TF Motor Number i32 1 8 1 o aaa Al mt EM on m t E m t Motor 4d ke FEJA Motor Sta
131. coder bits The remaining controls are divided into three groups One for each method demonstrated in the example 1 On the bottom left are LEDs indicating the Execution State of the two PLCs used to service the encoder and a button to disable the PLC handler 2 To the right is a numeric control used to specify a compare position and a button to configure the encoder for one time compare operation 3 To the right of this is a checkbox that enables encoder servicing directly from PMAC Panel Pro not the PLC The LED indicates when a new compare position is being loaded into the encoder after a compare equal trigger occurs On the very bottom is a slider that specifies the interval between generated triggers This interval is used by the PLCs and by the software interval generation Before this VI is run home the motors to be used Do this with the example covered in a previous section or execute a home command from PmacTerminal Encoder Compare Example Compare E qual Ho Output on EQU Line EQU Low TRUE Configure Compare Com Puls 01t Comp Setup off Disable Comp Pulse PLC 4 5 4 5 3 6 3 E P EEE v a f E 1 5 5 7 al Encoder Motor Encoder Coord System Jog Relative gt oes RES 4d ly l l l l 00 10 20 30 40 50 60 70 80 90 100 Encoder Counts EE 4600000 00 j SW Update Enable Reset l sw Compare Increments a all 50 K gt P101 PLCZ5S Compare Interval 0 0000 40000
132. coder counts If the motor is not defined in the CS no conversions is applied If the motor is defined and Convert is true Coord Defined is true and Output Value is scaled from CS units to encoder counts Device Number 132 0 Coord Specify Cluster Input Yalue Double e PmacCoordMotorToCoord Coord Specify Cluster specifies a motor within a CS and an attempt to convert Input Value from encoder counts to CS units If the motor is not defined in the CS no conversion is applied If the motor is defined and Convert is true Coord Defined is true and Output Value is scaled from encoder counts to CS units Coord Definition is a string specifying Output Value units as Encoder or the CS definition of the motor Device Number 132 0 Coord Specify Cluster Input Yalue Double e PmacCoordMotorsToCoord Generate an indicator cluster for PmacMotorsPVE ctl Input Value Double is an array of positions velocities or following errors from VIs in the PmacMotors collection If Convert to Coord is true fetch the CS definitions for the motors specified in Coord Number and scale them to CS units Motors not defined in Coord Number are not scaled Device Number 32 0 Input Yalue Double Array Coord Number 132 1 8 1 Convert To Coord Bool The panel shows two indicator clusters The CS Scale Cluster contains the definition of all motors in the specified coordinate system as a displayable string a numeric scale factor and a Boolean indicating
133. ct an appropriate PMAC Panel Pro VI to send that command and or data to PMAC LabVIEW and PMAC Numeric Data LabVIEW supports a wide range of native data types that need to be communicated to PMAC This data must be formatted for transmission to PMAC and converted from PMAC responses into LabVIEW types PMAC returns numeric data as decimal or hexadecimal ASCII strings The query response VIs convert this ASCII data into native LabVIEW numbers for manipulation and display PMAC uses the Motorola 56K series of Digital Signal Processors for its computational engine The memory architecture is based on a 48 bit long word comprised of two 24 bit words This organization allows one to access the entire 48 bit long word or either of its two 24 bit words using the same address The long word at memory location 23F8 is accessed using D 23F8 or L 23F8 The upper word is designated X 23F8 and the lower word is designated Y 23F8 PMAC s firmware uses several data types depending on the quantity being represented 1 bit booleans 8 16 24 32 and 48 bit integers and 24 32 and 48 bit floating point numbers Of these most integers are 24 or 48 bits This presents an immediate issue that must be understood when developing a PMAC Panel Pro application LabVIEW s short integers are 16 bits too short for PMAC s 24 bit integers Its long integers are 32 bits too short for PMAC s 48 bit integers and too long for PMAC s 24 bit integers Furthe
134. d Response defaults to Input Value The variable address is calculated as Var Set Number 100 I Variable Number Var Set Number 0 addresses global I Variables IVar Set Numbers from 1 8 address motors and coordinate system I Variables Device Number 132 0 Set Get Bool F Mar Set Number 132 0 9 0 Variable Number 132 0 99 Input Yalue 132 0 The first two I Variable operations are obvious The Get Set VIs exists because when developing GUIs to configure I Variables they are retrieved for display and set for modification Grouping these operations together in a single VI simplifies the diagrams Note that the Set Get terminal is not required If it is not wired the default operation for the VI is to get the I Variable This type of Set Get VI architecture is common in PMAC Panel Pro Response Available Bool F Response 32 0 Identical sets of VIs are provided for e PmaclIVarDbl PmacIVarGetDbl PmacIVarSetDbl e PmaclIVarBool PmacIVarGetBool PmacIVarSetBool e PmaclIVarShort PmacIlVarGetShort PmaclVarSetShort There are no string I Variables Many of the I Variables are bit mapped CVs for collecting I Variables into functional groups and manipulating the bit mapped I Variables are introduced as required later To access an I Variable the I Variable Set Number and I Variable Number are used to compute the number of the requested I Variable as shown War Set Number i32 0 9 0 Varable Number i32
135. d by PMAC Panel Pro VIs are listed here Global Commands Addressing Mode Commands amp Buffer Control Commands CLOSE DELETE GATHER LIST PLC LIST PROG SIZE Control Character Commands lt CONTROL A gt lt CONTROL D gt lt CONTROL F gt lt CONTROL K gt lt CONTROL P gt lt CONTROL Q gt lt CONTROL R gt lt CONTROL S gt lt CONTROL V gt General Global Commands S kkk 22 SAVE Global Variable Commands I P Q and M PLC Control Commands DISABLE PLC ENABLE PLC Register Access Commands R H address W address 44 Report currently addressed CS Close an open program buffer Return gather buffer space List a PLC in memory List a program in memory Return available buffer space Abort all programs and moves Disable all PLC programs Report following errors for all motors Kill all motors Report position of all motors Quit all executing motion programs Begin execution of motion programs in all coordinate systems Step working motion programs in all coordinate systems Report velocity of all motors Full card reset Reinitialize PMAC to factory default Report global status words Save current configuration to NOVRAM Variable access in numerous ways Disable a PLC program Enable a PLC program Read data from memory Write data to memory Application Basics PMAC PanelPRO User Manual Coordinate System Commands Axis Definition Commands constant gt Query PMAC for m
136. de the execution loop When the motor positions are fetched array is indexed the position is unbundled converted to CS units multiplied by 0 1 used to update the panel indicators and bundled into and X Y point for the X Y Chart buffer Remember that PmacDPRRealTimeMotors does not perform CS conversions In addition the PmacDPRFixedBack VIs can be used to obtain the motor position in CS units To handle target position generation for the move retrieve the position of Cursor 0 from a chart attribute node and update the values in the DPR Numeric Slave Cluster These values will be written by PmacDPRNumericSlaveCluster as long as Enable Track is true PmacDPRVarBack PMAC s Variable Background data buffer mechanism allows the specification of 128 memory addresses to copy from the PMAC locations to DPR locations when requested Whereas the Fixed Background data buffer allows access to predefined registers and locations the Variable Background mechanism allows access to anything PComm 32 Pro supplies a set of routines to read the copied data from DPR and convert them into legitimate Intel formats This process hides the required handshaking between PMAC and the host to avoid collisions when accessing DPR PComm 32 Pro supports a limited ability to write to DPR from the host and copy this data to its native location PmacDPRVarBack provides hooks for this interface but does not currently implement this capability To minimize work as a developer
137. dinate Specify type G eliminates two terminals EE A Coordinate Specify Cluster is assembled from three controls on the panel Each of the individual Position Velocity and Error VIs receives the cluster The P V and E VI outputs are used to drive three individual numeric indicators In this example the indicators have an attribute node to set their color The color for the text is provided by PmacCoordColor The indicator color is orange 1f the reported value is in CS units and blue 1f it is in encoder counts The panel for this exercise shows the indicators and the Boolean used to specify the units for P V and E displays This decoration contains individual indicators for the display of common motion states Each component is requested individually These controls have 4 5 Motion N Motion bounded ranges and 3 6 EE Position rey which motor to 2 7 oo Velocity C S Units 1 g BE Following Error If the motor is defined in a coordinate system Coord System the motor definition can 4 5 Motor N PYE be used to convert 3 E commands and measurements between 2 z C S units and ba encoder counts 1 8 Motor Number Motor N Jog PmacVIEW displays motion R states in two colors T eee SENS Blue gt Encoder Counts __JogTo _ MakePre Joc Orange gt C S Units 4 b oo 10 20 30 40 50 60 70 80 90 100 Encoder Counts MA This cluster groups the most common motor Jog commands into an easy to use control Yo
138. ds for developing the PMAC Panel Pro applications The following figure shows the three primary components available from Delta Tau for the system development Developer User av Sse LabView GUI Visual C Visual Basic Data Analysis Graphical Tools ese Custom drivers Data Acquisition PMAC Application packages Industrial Communication Executive PTalk wa ze PMAC Custom devices PMACPanel Pewin 32 Pro PMAC Executive PMAC system setup and configuration operations such as motion program development motor tuning limit and safety configuration etc are best accomplished using the executive Once a set of sample motion programs is available a PMAC Panel Pro application can be developed PMAC can still operate as a Standalone controller To interact with PMAC the PMAC Panel Pro applications are available to change the operation of PMAC PtalkDTPRO ActiveX Controls for Visual C and Visual Basic Applications with demanding computational needs can written in C and their needs can be communicated to PMAC using PtalkDTPRO As an ActiveX control Ptalk DT Pro can be used from within PMAC Panel Pro It is also possible to compile this code into a dynamic link library or as a LabVIEW Code Interface Node and use it from custom VIs in a PMAC Panel Pro application PMAC Panel Pro PMAC for LabVIEW 5 0 PMAC Panel Pro provides a complete suite of VIs to simplify and standardize the application s access to PMAC from L
139. e Extended Interpolated Count User Integer Count 1 Ix08 32 ct Units Count 1 32 ct fixed point floating point gt PMATCH 24 bits Encoder 24 bits 7 Conversion e g 1 T 0 32 e 1x08 Axis Coefficients Done Always Done for Done for Activated Motor Defined Axis Set to Zero on Set to Zero on Set to Zero on Can be Offset Power up Reset Power up Reset Power up Reset Axis offset PSET and Home axis COMMAND ACTUAL POSITION POSITION Position SPS Axis 48 DS Decoder L Extension _ Scaling Counter Done Always Homing Encoders and Position Capture 103 PMAC PanelPRO User Manual Motor position is always kept in terms of encoder counts When a motor is assigned to an axis through a Coordinate Definition statement as in amp 1 1 gt 1000X for use in a motion program the scale factor in the statement determines the units of the axis usually inches millimeters degrees etc As introduced in Chapter 4 programmed moves for an axis are converted to motor positions using the scale factors from the Coordinate Definition statements It 1s important to realize that this conversion is for commanded positions only and that the conversion normally goes only one way from axis to motor PMAC never computes actual axis positions Position Capture PMAC s position capture function latches the current encoder position into a special register at the time of an
140. e PMAC VIs using concurrent execution loops use a wait timer to give the user interface and other VIs a fair shot at executing Otherwise the user interface may lockup while the PMAC Panel Pro program is waiting for a motion program to finish Worse yet other VIs that use double buffering to acquire data can overflow with nasty results Application Basics 21 PMAC PanelPRO User Manual Execution Speed LabVIEW is fast at doing certain types of things and slower at others Writing complex VIs such as the terminal is tough on LabVIEW execution and the developer Do not expect the response time of visual C or Pewin 32 Pro Realize that applications that repeatedly poll PMAC can slow the application This is true especially of systems that use serial communication at low baud rates On the other extreme there are busy applications that use the DPR capabilities of PMAC Panel Pro for high speed data transfers VI Reentrancy In general most VIs are reentrant In LabVIEW terminology this means that a VI can be used simultaneously in multiple PMAC Panel Pro and application VIs with its own separate copy of data This has some benefits and some drawbacks It allows independent simultaneous execution of the reentrant VI The drawback is that it prevents each use of the VI from having a user accessible copy of the panel In the case of low level PMAC Panel Pro VIs this is not really an issue because the VIs have no user interface value It becomes more
141. e Servo Clusters A successful query of PMAC s DPR depends on whether PMAC is accessing the memory If Wait for Valid is true the VI places queries to PMAC until a successful read at which time New Output is true indicating valid output data If Wait for Valid is false the query may or may not succeed If the query fails New Output is false and the output clusters contain the data fetched during the last read Device Number 132 0 Dee New Output Bool Enabled Bool T DFR Real Time Motor Cluster Wait For Walid Bool T DPA Real Time Servo Cluster Motor Number Array 132 1 8 e PmacDPRRealTimePVE Extract position velocity and following error from DPR Real Time Motor Cluster assuming Motor Number operating in Coord Number Assemble the measurements into Motor PVE Cluster If Convert is true convert the measurements to CS units Otherwise leave them in encoder counts Device Number 132 0 Coord Specify Cluster DPR Real Time Motor Cluster Motor PYE Cluster 144 DPR Dual Ported RAM PMAC PanelPRO User Manual PmacDPRRealTimeConfig CIN The simple diagram for PmacDPRRealTimeConfig is shown below Note that the Device Number Enable Motor Numbers and Servo Period are all passed to the CIN Even the Enable is passed The CIN returns an Output Enable signal that indicates whether the configuration and enable operation succeeded The only unique characteristic of this VI 1s the compare operation betwe
142. e and homing were discussed Homing is a firmware operation that uses the encoder hardware position capture capabilities to establish the relationship between a motor s zero position and the encoder s zero position To perform a homing operation three things are required 1 One of PMAC s four hardware trigger flags HOME LIM LIM or FAULT must be selected 2 A trigger condition specifying the rising or falling edge of the flag possibly combined with the encoder index channel C must be selected Homing Encoders and Position Capture 107 PMAC PanelPRO User Manual 3 Ifa FAULT or LIM flag is used the limit or amplifier disable capabilities must be disabled If using these PMAC Panel Pro can perform the necessary steps but the PMAC User Manual must be consulted for details The PmacHomelIVar cluster on the example panel handles the configuration of x25 and encoder l Variables 2 and 3 PmacMotorIVarFlag controlling x25 is detailed in in a previous section The PmacEncoderI VarCapture cluster and its two sub controls are documented here e PmacEncoderlVarCapture Encoder Capture Cluster Software Control Encoder Variable 2 8 Home Flag Position Capture Control gt Limit Flag Encoder l Yariable 3 Limit Flag O Amp Fault Flag Capture Flag Encoder I Variable 2 Position Capture Control This parameter determines which signal or combination of signals and which polarity triggers a position capt
143. e baseboard has 24 I O individually selectable in software as inputs or outputs The rest of this discussion does not pertain to the PMAC STD port unless specifically mentioned Refer to the PMAC STD Hardware Reference manual for details on its JOPT port 128 PMAC and NI DAQ Interfacing PMAC PanelPRO User Manual Standard Sinking Outputs Caution Having Jumpers El and E2 set wrong can damage the IC Do not connect these outputs directly to the supply voltage or damage to the PMAC will result from excessive current draw PMAC is shipped standard with a ULN2803A sinking open collector output IC for the eight outputs These outputs can sink up to 100 mA but must have a pull up resistor to go high The user can provide a high side voltage 5 to 24V into Pin 33 of the JOPTO connector and allow this to pull up the outputs by connecting pins 1 and 2 of Jumper E1 Also jumper E2 must connect pins 1 and 2 for a ULN2803A sinking output Option for Sourcing Outputs Caution Having Jumpers El and E2 set wrong can damage the IC It is possible for these outputs to be sourcing drivers by substituting a UDN2981A IC for the ULN2803A This IC U3 on the PMAC PC U26 on the PMAC Lite U33 on the PMAC VME is socketed and so may be replaced easily For this driver pull down resistors should be used With a UDN2981A driver IC Jumper E1 must connect pins 2 and 3 and Jumper E2 must connect pins 2 and 3 Input Source Sink Control Jumper E7
144. e is opened and closed on every transaction After an operation New Datalog Display is true and Output Datalog Display Cluster contains updated operation status for the application s cluster Append operations writes Input PQM Variant Array to the end of the file specified in Input Datalog Display Cluster and updates Current Record and Num Records in the output cluster The contents of the Note window are appended with the record Read operations reads the record specified by Current Record in Input Datalog Display Cluster from the specified file and generates a new Output PQM Variant Array The availability of new data is indicated by New PQM Variant Array true Output Datalog Display Cluster increments Current Record and displays the Note if any attached to the record Read operations cannot read past the end of the file and simply reads the last record in the file To change the data logged by this VI simply change Input and Output PQM Variant Array to another data type Similar modifications to PmacFileDatalogAppend Create and Read are also required Datalog Control Cluster 0 peere New Datalog Display Bool F Input Datalog Display Cluster wee Output Catalog Display Cluster Append Head Bool F p E ee Mew POM Variant Array Bool F Input POM Yanant Aray oO s Output PUM Variant Array e PmacFileDatalogAppend When Append Record is true append Input PQM Variant Array to the file specified in Input Da
145. e must be between 8 388 608 and 8 388 607 This value cannot be read back reading from the same address gives the position capture register The command can be given from a PMAC motion program a PMAC PLC program from the host or using the PMAC Panel Pro VIs introduced in the following example This is the encoder position to reference it to motor zero position the homing offset must be known This translation is handled transparently by the PMAC Panel Pro ICVs in the PmacEncoder collection Encoder Control Bits Three control bits configure the format of operation of the compare feature These are software status bits and if enabled external hardware signals available on various PMAC cables The flag latch control bit M111 controls whether the compare equal signal is e Transparent true only when the positions are actually equal e Latched true until actively reset by a handler The signal is transparent if this control bit is zero and latched 1f the control bit is one To clear a latched flag take the control bit to zero then back to one The compare equal signal is always copied into the compare equal flag M116 If monitoring this flag from a PLC or PMAC Panel Pro application make sure that the signal is latched M111 1 or it will be missed To interrupt the host edge triggered the signal should be transparent PMAC Panel Pro does not currently support an interrupt driven interface Look for this in a future release
146. e of a datalog file Select an existing file created using this example or provide the name for a new file There are two example files named datalog dat and datalog dat New File closes an existing log file and allows the selection of a new one This must be done prior to actually logging PQM data The Read Append Ignore radio buttons define what to do with the PQM data when the Cycle Read Write button is clicked e Read It is assumed that an existing data log file created earlier was opened Use the record specified by the Current Record to read a PQM record set the P Q or M Variables in PMAC using the retrieved record then execute the encapsulated motion program The values on the cluster controls will change to those read from the record when the Cycle Read Write button is clicked Using this replay previously executed tests and configurations The state of the panel illustrates that a Read operation was performed during the last cycle using record 1 after the cycle Current Record was incremented to 2 The note indicates that X1 12 and indeed P2 has a value of 12 e Append Read the PQM cluster controls append them to the datalog file send them to PMAC and start the execution of the encapsulated motion program Add a note to the record prior to clicking the Cycle Read Write button e Ignore Keep the datalog file but do not read or write anything Simply pass the PmacPQM clusters to PMAC PmacPQM Clusters Four standard Pma
147. ecccccccusnnennssssusseceeeeseccecccuauacceesssuseeeeeeseeseeeeeaas 45 PmacTutor amp Motor Control with Status Monitoring cccccccccsccccccccccccnsessccccceeecaeesesecceeeeaaaeeeeeeeeesaaasaaseeseessaaaaees 49 PmacTutor9 Motor l Variable Configuration cccccccccccccseeeecccceceeneeeeeeeeeeeeeneeeeeeeeeeeeeaaeeeeeeeeeeeeeaaaaeeeeeseaaaaaseees 32 Piac Motors I V Saec S ES 55 PmacTutor10 Requesting and Plotting Motor Motion o eesssssssssnnsennnnsesssssssssssssssssererresssssssssssssseerreesersssssss 55 PmiaCGlO Dal IC V Secer a nN E N 58 Pm clutori I Conjigurins PMAC Global State rriorse o EEEE EE E 58 HMAC COOL ICY S E E A A A A E A N E E AI E E A E E 61 PmacTutor1l2 Using Coordinate System Definitions cccccccccccccccccsesnssseeccceeeeaeeesseeceeeeeaaeeeeeeeeeeeaaaaseeeeeeseaaanens 61 PmacTutor13 Configuring and Monitoring Coordinate Systems ccccccccccccsssessseccceeecaesseeeceeeeaaseseeeseeeeaaaaaes 64 BAC PG AC G ace tc saison E E E E E T E E E 66 Pmaclutorl4 Machine Input and Output a ssrsasesiseieiivecieieeeiists creiere nsss TENE eot ENEE EEE AEE EEEE 66 Pmaclutori sS ACCLOD Control Panel earoiiaciin ai R NE EE AE Oii 67 DEVELOPMENT TOORE o E a E E E 69 TOLNA E E E A NE E A ee ee E 69 Mod NUE e M U ear r a E OEE NE AEAEE NE AEETI EO E 70 Modifi yne T mac I erm naM TU esr aE E E NEI E E AE A AE NE 71 DSe TOOL Vi ROGUE MENTS sena ea E E T N st 71 Basie TOO VI COn EUAN ON isea ETE EE AE EEE E E E 12 Pina Lorn
148. eck to see if the item specified by Address Item Cluster already exists in Input Address Item Array If it already exists do not add it If it does not exist add the cluster to Output Address Item Array Address Item Cluster Input Address Item Array Output Address ltem Array e PmacAddressDelete Locate and remove the Address Item Cluster specified by Selection Index to Delete from the Input Address Item Array Selection Index to Delete 132 Input Address Item Array Output Address ltem Array The PmacAddressMotors panel contains an array of clusters that define a translation table Manually add items to this table and set them as the defaults for the control transparently adding them to the menu ring in the PmacGatherSelect control A portion of the table provided with PMAC Panel Pro is shown here 88 Development Tools PMAC PanelPRO User Manual Translation Table Private 16 tai velocty lt s pos Each cluster item in the array consists of five items In order from left to right these are Name Textual description of the item to be gathered Used in conjunction with a motor or CS number to build a unique description for plot legends and spreadsheet files Address A string defining the size and interpretation of the data to be gathered Legitimate designators are X Y and DP Address Offset A hexadecimal string defining the offset address of the data to be gathered Address Stride A hexadecimal numerical value that d
149. ecommended There may be other software from National Instruments or Third Party sources such as NI DAQ There are no known conflicts with PMAC Panel Pro when using these packages Microsoft Software Certain PMAC Panel Pro capabilities are implemented with compiled C code These operate perfectly as is To modify them to suit different requirements or add other CINs for specific reasons use Microsoft Visual C 5 0 or Microsoft Visual C 6 0 PMAC Panel Pro does not support other compilers directly PMAC Options for PMAC Panel Pro PMAC Panel Pro supports a wide range of PMAC s capabilities Some of these require the purchase of additional Delta Tau hardware and software accessories These options include e PMAC s dual ported RAM This is required to utilize the PmacDPR collection of VIs e PComm 32 Pro Complete PMAC device driver PMAC Panel Pro provides a version of the complete driver with reduced capabilities Tailoring of some PMAC Panel Pro capabilities may require the complete PComm 32 Pro release e Various PMAC I O and accessory options PMAC Panel Pro and the Computer s Display PMAC Panel Pro s indicators and controls are configured for display on a computer with 1024x768 resolution or greater Set the display s resolution to at least this size to use them PMAC Panel Pro VIs work at smaller display sizes but the panels will not fit within the display area Either resize the panel controls or change the size of t
150. ection PMACPanelPRO Basics 17 PMAC PanelPRO User Manual PmacProgram This collection provides tools at a variety of levels to edit download debug monitor and encapsulate motion programs Encapsulated programs P Q and M variant Load themselves when executed Know their coordinate system and program number Can be executed by the click of a button Indicate the state of their execution Can be modified monitored and debugged from a powerful front panel Accept data types from the PmacPQM tools PmacSubVI This directory contains the actual encapsulated program and PLC wrapper template VIs Data Gathering and Graphical Tools One of PMAC s most intriguing capabilities 1s its ability to synchronously gather a variety of motion data during the execution of a program or move An example is the gathering of actual and desired position in response to step inputs This data can be used to analyze the performance of a specific move or machine configuration using LabVIEW s powerful analysis suite PmacGather This collection of VPs allow the user to select motion variables to control the collection and conversion of data into standard LabVIEW analysis formats Collected data can be output to files in tab delimited format for export to programs such as Matlab or Excel PmacAddress A collection of tools for specifying addresses scale factors and descriptions for gathering Variables not already accessible from PMAC Panel
151. ectories for wing K Include files K Directories o an C Program Files DevStudios CSINCLUDE C Program Files DevStudio CSMFCvinclude C Program Files DevS tudio C44T LAinclude D LabYiew PMACPanel ibs P macine gree eee we M M M M N M a 7 DTP CeerrreCrrie rere rererrrrer errr rer Trier errr ttre a Adding Pmac lib to Project To link the CIN to produce the Isb code resource include Pmac lib located in PMAC Panel Pro lib PmaclInc or the PComm 32 Pro installation directory Select Project gt gt Add To Project gt gt Files and Pmac lib in the locations noted Also add the file and the path to the Library files selection in the Tool options the same way that the include path was added Configuring the IDE Detailed instructions on the steps required to configure a project so that it will successfully compile a C file into a loadable code resource for the CIN are available This is a bothersome process if it is done a number of times It may be necessary to do this the first time a CIN is created and compiled After that use the techniques detailed next to duplicate the project file The Easy Way to Add New Projects The easy way to create new CIN projects is to create a copy of the PmacCIN dsp project file and workspace PmacCIN dsw located in PmacCIN and modify them using notepad or Microsoft Word Microsoft does not recommend this but it saves a lot of configuring when creating a new CIN The project file has the key
152. ecute for details on interactive execution The panel is closed by clicking the Stop button on the panel When the latched input Program Run is true Input PQM Variant Array is sent to PMAC to initialize a program s P Q or M Variables The program is then started as long as there is no program executing in the associated CS When Program Running is true this or another program is executing in the associated CS DeviceNumber 132 0 O prere Frogram Running Bool F Program Run Bool F piesa TD Frogram W State Cluster Panel Show Bool F p7 e Wew Output Bool F Input POM Warant Aray oo Output PUM Yarant Array When PmacTerminalEdit saves the motion program to a file and makes a copy of PmacProgSubVI with the same name as the motion program the program has been encapsulated within a VI Edit the icon of the new encapsulation or wrapper VI to represent the motion program Use the terms encapsulation and wrapper interchangeably Before looking at how to use the encapsulation VI look at the new VIs panel and diagram If the new encapsulation VI is opened note that the panel is a combination of PmacTerminalEdit and PmacTerminalExecute with most of their capabilities The purpose of this panel is to allow the editing of the associated motion program and monitoring of its execution There is no need for buffer control or for selecting a motion program or coordinate system because these are already known by the encapsulation VI Refe
153. ed in the Application Basics section of this manual These exercises show the basic architecture and proper use of PMAC Panel Pro in individual applications All first time users of PMAC Panel Pro should read this section and examine the tutorial VIs PmacDAQ This collection of VIs utilize standard LabVIEW analog input DAQ example VIs and a PMAC Panel Pro motion VI to demonstrate a few of the techniques thatcan be used to integrate PMAC and NI DAQ boards to develop precision motion based data acquisition applications 18 PMACPanelPRO Basics PMAC PanelPRO User Manual Miscellaneous Utilities This collection provides many VIs used to implement PMAC Panel Pro without regard to a specific category PmacSetup True maintenance of a deployable PMAC application requires Pewin 32 Pro This collection of VIs is the start of a set of VIs to download and maintain the configuration of PMAC s numerous P Q M and I Variables For the purpose of speed the VIs are implemented using CINs PmacUtility This collection provides controls and VIs to modify file paths handle radio buttons etc Documentation PMAC Panel Pro has an extensive suite of documentation and help that can answer most questions This manual along with the various PMAC User and Reference manuals contains thousands of pages of information on every aspect of PMAC and PMAC Panel Pro There are numerous help files available and more being written all the time Check the Delta Tau
154. ed only when the program is not running Within this case there are two major operations The top case structure checks the Program VI State Cluster down loads the motion program the first time the VI is executed and parses the program for a program number and coordinate system This is why it is not necessary to keep track of the program number of its CS 4 The large case structure below executes only when the panel is Open and Active and enables status monitoring editing and interactive execution from the panel FALSE case executes when the rogram is NOT runnin STIR AR IATA RAR NORAD a 3 eee eee ee eee ne eee CN Default Program 0 F5 Program Vi State Custer 5 There is a bug in LY 5 0 regarding ERE EA ERAN i P Program YI State Cluster 8 local variables and persistence i Cees Fe Make this TRUE to disable raana P Et Program VI State Cluster Program File Path False hi re a os j LE Path File Bes H File DeviceNumber i32 0 gt Sting Check for errors het Pr Program Window hen Program State Cluster indicates the program is not loaded down load the program rogram Run Bool F me e A Convert To Coordinate eee passassi i Coord Defs Coord F m i rogram Window P fa m j i fi jg im E 2 i i a ie s 2 Determine i Coord Prog pg Program VI State Cl
155. ed to drive indicators Depending on needs the extraction of individual status bits is a tedious task Later exercises introduce PMAC Panel Pro CVs that extract and display the most common status bits thereby eliminating the tedium The diagram for the example is shown here Application Basics 37 PMAC PanelPRO User Manual E it 23 Motor Activated CFF Bit 22 Neg End Limit Set EF Bit 21 Pos End Limit Set C Bit 18 Open Loop JOA Bit 17 Running Definite Time Move GE Bit 15 Dwell In Progress First Word Binary Status i32 Request Motor 1 Motor Status Stat Second Word 24 Element Bool Arra Second Word Binary Status 32 EFT Bit 23 Assigned to CS EF Bit 14 Anp Enabled CE Bit 11 Stopped on Fos Limit FE Bit 10 Home Complete z Bit 3 Amp Fault Error E Bit 2 Fatal Following Error Bit 1 Warning Following Error Bit O In Position i Extract bits of interest for display PoE PmacTutor6 Accessing PMAC l Variables On PMAC I Variables Initialization or Set up Variables determine the personality of the controller for a given application In general this is a supervisory task They are at fixed locations in memory and have pre defined meanings Most are integer values and their range varies depending on the particular variable There are 1024 I Variables from IO to 11023 and they are organized as follows Reserved for future use To support this o
156. ed to it to check for selections Because there are time critical operations that should not check for selections set Enable Menu Track false using a switch to disable the testing This is done in the PmacTerminalMotors tool because the delay causes a noticeable blip in plotted position data Current YI menu Enable Menu Track Bool T Development Tools 71 Basic Tool VI Configuration PMAC PanelPRO User Manual When a tool is spawned the Execution and Window options defined for the VI Setup are important The following panel shows the Execution Options used for a PMAC Panel Pro tool The panel should be shown when loaded otherwise selecting the tool runs it without a panel If the VI is called instead of spawned then use the Show Front Panel When Called and then close it afterward The problem with calling the VI rather than spawning it is that it must complete before the caller s panel becomes active again Execution Options i Show Front Panel hen Loaded J Show Front Panel When Called IY Close Afterwards if Originally Closed PT Run hen Opened Suspend When Called Reentrant Execution Priority Print Panel When Vl Completes Execution D Print Header name date page Jv Scale to Fit When Printing M Surround Panel with Border When Printing Page Margins fs alr ve Prefered Execution System normal priority game ag caller Cancel Generally the panel window should prevent us
157. eeseuuaneeaasseeees 142 Poa DPRP aI TAS eee E E E E E E R EE etasenteeeccny 142 PmacDPRRealTimeExample sccccccccccccce sn eeeceeeecee eae eeeeeeeeee eee eeeeeeeeeeeaaeeeeeeeeeeeeaaaeeseeeeeeeeaaaaseeeeeeeeaeaaaaeeeeeeeeeeaas 142 PmadcDPRRealTime Vector EXQmMp le u ccccccccscccccccccceeeeeeesseceee eee aneeeeeeeeeeeeee ee eeeeeeeeeeeaaeeeeeeeeeeeeaaaaseeeeeeeesaaaaaaeeeeeeeeaas 148 Pma EI Is CCC orron E E tanatanndoueapenceeeusdeaisarsatutahesaeatensroniet band onitomtanarnbeceactes 154 Fmac DOFRI ked Backi anple airius EAA ATE a Gadd attache TAG esd whales 154 Poa DERN UTG O e EEE EE E 157 DPR Addresses and Ddata OF GIT zati OM isnt scssiasasssiacnlebasseeirsisdnsedsiigesiss eh iaaxlisasieOeeasdinseRangesuasveSinusibase Sestebsekangesweeee 157 PmacDFRN umer CLAMI lE raa arii i stead AEE AENA EEA AAAA 157 PmaceDPRNumerie C luster E xamMPlE sassacassieicnidesaaviassncehbisaedieeudicn ETE T T A TT 161 PmacDPRNumericCINClusterEXOmple aa site esa chb et nE a R AA aT a 162 FPmacDFPRNumericS lave LOMPE isossa T T TEET EE SA AT 164 PODER aD A E a E E E G E E N EA E E E E ERA 166 P DT V GDA QI eaa E S 166 PmacDPRVarBack Vector EXample Renee MTCC OO R ar a RaT aNG 169 INTERRUPT o 171 IHC a E en A EO OE 171 iv Table of Contents PMAC PanelPRO User Manual INTRODUCTION When PMAC is selected for the motion control portion of a DAQ application an integrated precision motion programming system with incredible capabilities is available With PMAC Panel
158. efines a stride to be used in computing the final gather address The actual address is computed as Motor Number 1 Address Stride Address Offset Scale Factor A scale factor to apply to the collected data Some entries in this table compute this value depending on the item being gathered Refer to the PMAC I O and Memory Map in the PMAC Software Reference Manual prior to modifying this table Note that in the table the Encoder Time Between Counts has an Address Stride of 4 and an Address Offset of C000 whereas most Address Strides are 3C Using the values the address for Motor 3 Encoder Time Between Counts is computed to be Y C000 Motor Number 1 4 Y2eC00s As another example the DAC Commanded Output for motor 2 is X 0045 Motor Number 1 3C X S0072 Scale Factors are a little more complex Many Address Items in memory are scaled by one and already have the proper scaling The most interesting ones are scaled by some combination of factors and I Variables from internal units to encoder or coordinate system units For example Present Actual Position DP 002B is reported in units of 1 f f 1x08 32 counts To make life easier PmacAddressMotors computes this scale factor when building the Address Item Cluster If items are added to the table remember to make them the default for the table and save the VI When an item is added add a little wiring to the diagram for PmacAddressMotors shown here Develo
159. election of three different DAQ VIs Clicking the Run DAQ button starts the selected VI as a separate application thread These VIs are slightly modified versions of standard LabView examples located in the Examples Daq Anlogin library supplied with LabVIEW The diagram uses the expected pieces from previous examples The encapsulated PLC that generates the pulses is enabled by the setup PLC and can be disabled by the Disable button The Run DAQ button uses the Server VI to start the selected PmacDAQ VI as a separate thread Change I Yar EH LAE Vituallnstrument 7 a a es i 2PmacDAG Syncs ervo vile Run vi Motor PYE Cluster amp 3 E T Md obor Motor ore Motor Encoder Jog h PVE E I C L l oo naa onn PLE PLE Hoa Control n Te Sa Enable Compare a EEREN Disable Comode Jee ETa BE AGL RR E BE RAS SR RK RAC Configure Compare i Encoder Compare E gual Control Cluster EE The three VIs as named in PmacDAQ are described below The name of the original VI in the LabVIEW example library is included in parentheses e PmacDAQTrigger Cont Acq amp Graph buffered D Trig vi This VI continuously acquires data from one or more analog input channels when a digital start trigger occurs This is a timed acquisition meaning that a hardware clock is used to control the acquisition rate for fast and accurate timing It is a buffered acquisition meaning that the d
160. en Enable is false Output Enable is true when operation is enabled The VI maintains the state Operation of DPR Fixed Background buffers overlaps with DPR Real Time operation in that the number of motors enabled must be the same Device Number 132 0 Enable Boal T r 7 femiabeetetsewecs Output Enable Bool Enable Motor Numbers 132 1 Note that the PmacDPRFixedBack vector VI is wrapped in a CASE structure that is executed only when the configuration VI is enabled the program is executing and the proper Enable button on the panel is checked Hence when the program is started the gathering of the vectors can begin The samples are accumulated as fast as possible because the actual Vector VI is buried in a WHILE structure that executes until the entire vector is accumulated and then the rest of the system gets a chance to run This structure is not required but demonstrates another way to organize a gather Dev Open E o DPR Fixed eS Motor Number nen Coord System Coordinate Axis Pro ram Runnin P M1 i aaa aaa OO ey E aaa aa aa aaa E E E aa at ae ata eae Sa Sa Sat at at eae ae eae ea ea LPG i aiai o True a Run PAMITE pp CEEE i u H S a Buff Len aa Valid Output EA A AL SEERE AE ASAE er J gt Show PQM1 _T 7 E Extract a few of the returne 3 PaM vectors for displa EEJ Panells Motor Number wr f am a tuys Show PQM1 Panel 2fed ii Target Pos Dbl 132 E Velocit
161. en the Output Enable and Input Enable When these values are not equal the true case executes enabling or disabling the operation as defined by the input Enable Output Enable Bool Enable Bool T Device Number 132 0 Enable Motor Numbers 132 1 8 f1 Servo Penod 132 1 Many things can be done with a CIN Have a copy of the LabVIEW CIN Reference Manual when working with these until familiar with how LabVIEW passes parameters This is true especially for clusters and arrays The actual C code that implements this CIN is shown below CIN Source File include extcode h include lt pmacu h gt include lt dprrealt h gt Stubs for Advanced CIN Functions UseDefaultCINInit UseDefaultCINDispose UseDefaultCINAbort UseDefaultCINLoad UseDefaultCINUnload UseDefaultCINSave J This a GCLOBAL variable BOOLEAN Enabled FALSE Sa CIN MgErr CINRun int32 Device_Number_1i32_0_ LVBoolean Enable Bool _T_ ints2 Enable Motor Numbers 132 1 6 1 int32 Servo Period 132 _ 1 CIN MgErr CINRun int32 Device_Number_i32_0_ LVBoolean Enable Bool T int32 Enable Motor Numbers i32 1 8 1 int32 Servo Period i32 1 When not currently enabled and Enable_Bool_T_ LVTRUE enable the Fixed buffer for the specified number of motors if Enabled amp amp Enable Bool _T LVTRUE PmacDPRSetMotors Device_ Number _132_0_ Enable Motor Numbers i232 1 8 _1_ PmacDPRRealTime Device_Number_132 0_ Se
162. enced to the motor s home position Present Actual Motor Position 0x002B Dbl This is the motor s present actual position in units of 1 32 Ix08 encoder counts referenced to the motor s home position Encoder Home Position Offset 0x0815 132 This is the encoder s home offset position in encoder counts It represents the difference between the encoder s power up reset zero position and the position when a home operation completes Motor Pos Bias 0x0813 132 This is the position bias of the motor and represents the coordinate system translation in motor position encoder counts Position Scaling Factor x08 132 This parameter controls how the position encoder counter is extended into the full length register For most purposes this is transparent and does not need to be changed from the default There are two reasons to change this from the default value First because it is involved in the gear ratio of the position following function the ratio is Ix07 Ix08 this might be changed usually raised to get a more precise ratio The second reason to change this parameter usually lowering it is to prevent internal saturation at very high gains or count rates velocity PMAC s filter will saturate when the velocity in counts sec multiplied by x08 exceeds 256M 268 435 456 This happens only in rare applications the count rate must exceed 2 8 million counts per second before the default value of Ix08 is a problem When chan
163. ent use the HOMEZ on line or HOMEZn motion program command These are like the HOME command except that they immediately take the current commanded position as the home position The Ix26 offset is not used with the HOMEZ command This is not a reliable home and the PMAC Panel Pro VIs introduced in this section and the next do not handle this phantom home offset Fake this by modifying PmacEncoderOffset Homing Encoders and Position Capture 105 PMAC PanelPRO User Manual Note If there is a following error when the HOMEZ command is given the reported actual position after the HOMEZ command will not be exactly zero it will be equal to the negative of the following error Homing into a Limit Switchit is possible to use a limit switch as a home switch However first disable the limit function of the limit switch to have the move to finish normally if this is not done the limit function will abort the homing search move Even so the home position has been set a J 0 command can then be used to move the motor to the home position Note The polarity of the limit switches is the opposite of what is expected The LIMn input should be connected to the limit switch at the positive end of travel the LIMn input should be connected to the limit switch at the negative end of travel To disable the limit function of the switch set bit 17 of variable x25 for the motor to 1 For example if 1125 is normally C000 the default specifying
164. er Command Executed Bool is true when any button is clicked in Motor Limit Cluster Device Number 132 0 Motor Motor Number i32 1 3 1 re 7 Command Executed Bool F Motor Limit Cluster e PmacMotorStatJog Create a status indicator cluster for the PmacMotorStatJog indicator containing the status for Motor Number Device Number 132 0 Motor Motor Number 132 1 8 1 Jagstl Motor Status Jog Cluster e PmacMotorStatLimit Create a status indicator cluster for the PmacMotorStatLimit indicator containing the status for Motor Number Device Number 132 0 Kotor Motor Number 132 1 9 1 LimSt Motor Move Example ena OE SSE Motor Limit Status Cluster Status Indicators can be modified to meet your needs using the Edits gt EditContral option Pracview controls are nat typedefs Resize and move them around as you wish Negative Limit Exceeded Running Running Hove Dwell Fatal Following Error Amplifier Fault Error Motor 1 Ce 1 Stop Jog Relative E JogTo Make Pre Jog 3 G F I I I I 2 JX 00 10 20 30 40 50 60 70 80 30 100 Coordinate Units ME Motor Number ts tom one Zao os a Indicator and Control clusters are often clusters of clusters This hierarchy sub divides capability into smaller functional groups For example you may not want your users to have the ability to home the motor so don t use it Application Basics 49 PMAC PanelPRO U
165. eric controls this will no longer be a problem for PmacTerminal However it will not be possible to have the indicators track the commands PmacTerminal sends to PMAC automatically Development Tools 77 PMAC PanelPRO User Manual PmacTerminalEdit If all the fancy stuff is stripped from PmacTerminal and only edit control program menu ring and a window are left it is now a program editor tool The terminal like interface is different in that there is no OK button to capture and process the line just entered Instead hitting lt RET gt in the screen puts a lt CR gt in the buffer The lt TAB gt command will still rotate through the controls This tool should be used to develop programs rather than PmacTerminal Program development is detailed in the PMAC User Manual and PMAC Software Reference Manual There are some added features to PMAC Panel Pro s processing of motion and PLC programs developed using this tool PMAC Panel Pro parses the motion program buffer for the PLC or motion program number and coordinate system prior to down loading This allows the writing a PLC or motion program and having PMAC Panel Pro keep track of this information It simplifies the PMAC Panel Pro diagrams The program shown in the panel demonstrates what is required to do this USE CS 3 3 510 H e4 gt 1 Oy open prog 10 clear F000 dwell 100 fg Create Prog I ae Buffers Buffer Space Create PLC I The motion program coordinate sys
166. errupt Status Configuration _ Enabled oh Interrupt Occured Enable _ 0 Interrupt Count Interrupt Mask 50 o o Interrupt Source Always disable interrupts when the application halts e PmaclInterruptConfig When Enable is true enable interrupts Indicate the availability of a handler by the output Enabled When false disable interrupts Always disable interrupts when you application is not executing Interrupt Occurred is true whenever this VI checks the handler and determines an interrupt has occurred Interrupt Count indicates the number of interrupts since the last service Interrupt Source specifies which source See the PMAC User Manuals for details Device Number 132 0 11 Enabled Bool Enable Bool 477 Interrupt Occurred Interrupt Mask Interrupt Count Interrupt Source Interrupts 171
167. ers from doing too many things PMAC Panel Pro tools have a title bar and auto center When in edit mode the menu bar run button and abort button are shown When running these disappear and the menubar of the window just installed must be used ibe YI Setup Dialog Box Iv Window has Tithe Bar Allow User to Close Window T Allow User to Resize Window T Allow Run Time Pop up Menu Hilite lt Returm Boolean Size to Screen fv Auto Center Window Title ie Eper 72 Window Options PT Show Scroll Bars Jw Show Menu Bar Show Toolbar I Show Aun Button M Show Continuous Aun Button J Show Abort Button Allow Debugging Compile in debugging code P Enable Log Print at Completion Auto handling of menue at launch Cancel Development Tools PMAC PanelPRO User Manual PmacTerminal PmacTerminal is a command line terminal tool like Pewin 32 Pro The panel says a lot about its operation As the tool is explained many tricks can be used to build better PMAC Panel Pro applications gCALV95 User ib PMAC PRG Demogatl prg SSS Negative gt list prog 10 Limit Exceeded ier i No Program Running Program Single Step Pre Jog mea End Of Block Stop CS Defs Continuous Continuous Motion Mode Run Time Girl Amplifier Fault Warning Fotoing Enor Fatal mA Motor Positions C S 1 v C S Units Program 1 v PLC 01 Enabled w mee Bee re Clear Down Show No E Window Load Log Open Buffs Buff
168. ert them into legitimate Intel formats This process requires some handshaking between PMAC and the host to avoid collisions when accessing DPR from the host To minimize the work and simplify the interface the PmacDPRRealTime collection bundles the 23 most useful items them into clusters This ensures that all data items are gathered during the same servo cycle It also prevents having to wire 27 VIs PmacDPRRealTimeExample The following example demonstrates three PmacDPRRealTime VIs One VI configures and enables the operation of Real Time data buffering and two fetch the data PmacDPRRealTimeMotor collects the data for a single motor PmacDPRRealTimeMotors collects the data for a set of motors Grouping the fetch of data for multiple motors into a single VI ensures that the data for each motor will be from the same servo cycle The panel for the example is shown below The panel demonstrates the operation for a single motor on the top and multiple motors on the bottom On the right are two clusters for displaying the data fetched from DPR On the right are controls for selecting which motor or motors and controlling the fetch from DPR On the left in between the two is a small block of controls to enable DPR Real Time data buffering PmacRealTimeExample P i DPR Real Time Motor Cluster EE z T J Ss ServoTimer i32 eal Time Servo Cluster ME Comm d Pos Dbi HE Position Dbi He Velocity Dbi HE Follow Error Dbi HE Haster Pos Dbi
169. ese 34 Application Basics PMAC PanelPRO User Manual When using these VIs refer to the PMAC Software Reference Manual determine the size of the response whether it will be signed or unsigned and whether it will be manipulating the bits of the response PmacRespGetDbI is used to introduce the collection e PmacRespGetDbl If Command String is not the empty string send it to PMAC and wait for a response If Response Available is true Response contains a valid response Otherwise Response is 0 0 Device Number 132 0 Command String Response Available Bool F Response Double 0 0 The remaining VIs operate the same and simply provide responses of the appropriate type e PmacRespGetBool e PmacRespGetShort e PmacRespGetUShort e PmacRespGetLong e PmacRespGetULong PmacButton PmacButton consists of six additional VIs beyond PmacButtGetStr and PmacButtSendStr and introduced in PmacTutor3 These additional VIs provide numerical responses PmacButtGetDbl is used to introduce the collection e PmacButtGetDbl Send Command String to PMAC and wait for a response when Button State is true When Response Available is true Response Double contains the response If Response Available is false Response Double defaults to 0 0 Device Number 132 0 Command String Button State Bool The remaining VIs operate the same and simply provide responses of the appropriate type e PmacButtGetBool e PmacButtGetShort e PmacButtG
170. ese compile ASCII PMAC programs and download them to PMAC for execution DPR Binary Data Buffers PR represents a unique PMAC capability that rapidly transfers binary numerical data between the host and PMAC This communication mode eliminates the string formatting and parsing required with ASCII communication It is however not the best solution for all problems The DPR Dual Ported RAM section covers the use of these mechanisms fully PMAC Panel Pro Organization This brief explanation of PMAC Panel Pro s organization will help get the information needed to quickly and painlessly as well as help plan the application s architecture The PMAC Panel Pro library contained in the directory PMAC Panel Pro lib is divided into five basic categories as illustrated in the following figure These categories provide an increasing level of capability when progressing from the lower levels to the higher levels PMACPanel Directory Organization DPRand nace macDPR Sample Applications PmacTest Other Tools Pmacinterrupt PmacTutor PmacSetup PmacDAQ PmacSubVI Program Development PmacProgram Data Gathering PmacGather Encapsulation Tools PmacPLC Graphical Tools PmacAddress PmacPQM PmacPlot PmacFile PmacTerminal GlobalICVs PmacGlobal Motor ICVs_ PmacMotor PmacMotors Accessory PmacAcc Position Capture PmacEncoder Coordinate PmacCoord f System ICVs Triggering ICVs PmacHome Miscellaneous Query PmacResponse U
171. etUShort e PmacButtGetLong e PmacButtGetULong Step 1 of the exercise demonstrates that some response data is a little more than a numerical value Step 2 demonstrates how a single PmacResponse VI can be used to provide a useful piece of data for the panel When coupled with the button concept PMAC data can be requested and converted using a single VI This step demonstrates the use of Proacview Button and Response Wla 1 Some commands return more complex responses Thiz operation requests the status for motor 1 ee Response String 1 Hi gt gt 5000000000 Tine ast Response 4vallable Bool F Response Double 0 00 2 The polled query of motor position is very common on panels This easily done with the transparent conversion of responses into numeric data Hip 1139 40 Motor 1 Realtime Position 3 ltiz easy to fetch numeric data in response to a button Send Latched Hy gt gt 400 Motor H Velocity Application Basics 35 PMAC PanelPRO User Manual Although the operations are more complex the diagram is simpler Status responses are not simple numeric values Dey Open 7 Resp Motor 1 Realtime Positron iiph Db This configuration places a request for Motor 1 s position 1 p every iteration of the loop No button iz used No case statement is required to limit the update of the indicator because a response ts fetched every iteration PmacHespDbl does the con
172. etting limits Modify this behavior using the PmacMotorI VarFlag cluster covered in a previous section e PmacMotorlVarFlag Motor Flag I Flag Cluster Kill All Motors O Kill CS Motors 1 Kill This Motor l Fault True Low O x25 Flags Hex By disabling the Position Limits and or Amp Enable home into a LIM or FAULT flag Make certain to read the PMAC User Manual section on these topics and understand what must be done As an example of potential problems consider this When homing into a Limit switch the move must be started on the proper side of the switch and moved toward it Otherwise it will move away from the switch and might hit a mechanical stop Generally it is assumed that the PMAC is configured so that Motor N uses Encoder N and Flag N If this is not the case create custom VIs using the pieces provided with PMAC Panel Pro In either situation the architecture and examples presented here will make life a lot easier When the capture trigger conditions and move direction velocity acceleration etc have been configured set these in PMAC using the Configure I Vars button on the example panel Monitoring the Home Position Capture Homing is a firmware operation that uses the position capture and homing move characteristics just configured By clicking the Home button in the PmacMotorLimitControl cluster the movement and monitoring of the encoder status bits can be started When the movement sta
173. five groups in this category provide prepackaged indicators and controls to manipulate PMAC s I Variable setup monitor execution status and send commands to PMAC using appealing clusters of LabVIEW controls Capabilities not implemented by these VIs can be added easily by modifying the provided VIs Numerous examples are provided to demonstrate the capabilities of the collection and can used as Is Motor ICVs Interaction with individual and sets of motors is provided by these collections of VIs The collections contain VIs to request PMAC status and motor states and display their data on pre defined cluster indicators In addition controls to jog and control motors are provided to simplify testing and development of programs PmacMotor Monitor and control individual motors There are numerous ICVs to obtain motor position velocity and following error modify motor I Variables process motor status and jog motors PmacMotors Monitor and plot the motion of collections of motors in defined coordinate systems Plotting tools for selecting which motors and motion variables to plot are available Samples of real time strip charts and XY charts are provided Coordinate System ICVs PmacCoord Monitor the execution of programs and definition of motor coordinate systems This information is required for the development of user interfaces in which information is entered and displayed in coordinate system units rather than encoder units
174. for all motors They are not based on their counterparts in PmacMotor e PmacMotorsPositions Query PMAC for the positions for all motors PMAC reports the value of the actual position register plus the position bias register plus the compensation correction register and if bit 16 of Ix05 is 1 handwheel offset mode minus the master position register Assemble the measurements into PmacMotorsPVE Cluster If Convert to Coord is true convert the measurements to CS units for those motors defined in the CS Otherwise leave them in encoder counts Device Number 132 0 Coord Number 132 1 4 1 Convert To Coord Bool e PmacMotorsVelocities Query PMAC for all motor s present actual motor velocity scaled in counts servo cycle rounded to the nearest tenth The raw response reports the contents of the motor actual velocity register divided by Ix09 32 This is converted to counts msec by multiplying by 8 388 608 and dividing by the I10 default 3 713 707 If 110 is changed modify this value in the diagram Motors Position Cluster Device Number 132 0 Coord Number 132 1 4 1 Convert To Coord Bool e PmacMotorsErrors Query PMAC for the following errors for all motors Following error is the difference between a motor s desired and measured position at any instant When a motor is open loop killed or enabled following error does not exist and PMAC reports a value of 0 Device Number 132 0 Coord Number 132 1 4
175. for determining coordinate system definitions relies on the following three VIs They perform similar operations but return coordinate system definitions for different purposes e PmacCoordMotorDef Query PMAC for the definition of Motor Number in Coord Number If the motor is not defined in the specified CS Coord Definition is Encoder Coord Scale 1 0 and Coord Definition is false If the motor is defined in the specified CS Coord Definition is true Coord Scale is the encoder to CS unit scale factor and Coord Definition is the definition e g 1 gt 16000X Device Number 132 0 Coord Number 132 1 8 1 Coord Scale Dbl 1 0 Motor Number 132 1 81 1 Coord Defined Bool F e PmacCoordScale Query PMAC for the motors defined in Coord Number The Coordinate System Scale Cluster PmacCoordScale ctl contains three arrays with the motor definition scale factor and whether or not the motor is defined in Coord Number The actual query is only placed if Coord Number changes from a previous call Coord Definition String Device Number 132 0 Coord Coord Number 132 1 4 1 Scale e PmacCoordDef Fetch the motor scaling definitions for the specified coordinate system and provide a cluster for the PmacCoordDef indicator o Coordinate System Scale Clu Device Number 132 0 Coord Coord Number 132 1 8 1 Det There are a few limitations to be aware of when querying coordinate system definitions from PMAC Panel Pro Gener
176. g Form O i56 DPRAM ASCII Comm Interrupt Enable Global Move l Yars _ i58 DPRAM ASCII Comm Enable Change L i62 Internal Message lt CR gt Suppressed l Global Communication l Yars The diagram for this exercise should begin looking familiar Most of the work is contained in the provided PMAC Panel Pro ICVs The control cluster provides the input for PmacGlobalControl Status VIs process requests for PMAC global status and create appropriate clusters The architecture for configuring the I Variables is slightly different from that used to configure motors Motor Number equivalent cannot be changed Instead a shift register is initially set to true to force an I Variable read and set false for every other iteration TF Ip C Close Buffers Globel Buffers Open gt ka Butter Available Buffer Space Open Global Control ibe E Chl Buffer Status Globe Gather Status Globe Gah EET j EAER TEA Iy E Gl Com Po Global Communication Vars 7 E Force Initial Global Communication ars Lees ell Mov P Global Move lars Global Move ars Chanae Van gponnanncnaneeee rT piennnnnnnnannanesannantsy Application Basics 59 PMAC PanelPRO User Manual PmacGlobalBufferSize provides two capabilities The VI queries PMAC for available buffer size and parses the state of the buffers and their size When Close Buffers is true PMAC executes a command to close the open buffers and delete the gather buffer Genera
177. g the servo time the sample was taken If four motors are enabled use the Motor Number knob in the Single Motor box to fetch and display the data for the corresponding motor Note the familiar PmacMotorPVE cluster on the top left displays the PVE as a subset of the data contained in the DPR Real Time Motor Cluster Check the Convert to CS box and the same conversion to coordinate system units covered in several earlier sections are applied to the PVE data gathered from DPR Below this collection of controls is an indicator labeled Iteration Timer that displays the time in mS for each loop iteration On average the fetch and display update of DPR Real Time data for a single motor takes 1 2mS Notice the green LED in the Single Motor box flickering on and off When PMAC copies data to DPR it sets a Busy Bit indicating that it is accessing DPR During this time the host running this VI cannot access DPR To avoid possible problems the VI simply indicates that it did not perform a successful fetch If the Wait For Valid box is checked the VI will continue placing calls to the associated CIN until it performs a successful read The demonstration on the bottom of the panel is for multiple motors To fetch the data for multiple motors supply an array of motor numbers and enable the fetch The VI then fetches the data for the specified motors and returns an array of clusters The time required for this multiple motor fetch is on the order of 1 2 mS I
178. gement Highspeed Binary DPR Binary Buffer Status Data Data Buffers MS Visual C Code Interface Nodes Device Management Access to the device driver is handled with the PmacDevOpen VI configured earlier It defines whether Query Response communication uses the Serial Port Bus or DPR PComm 32 Pro hides all details associated with a given mode If the PMAC is inserted into the host computer Bus communication is a sure bet DPR while slightly faster 1s not required If the PMAC is located remotely then use the serial port to communicate with it If the application does a lot of polling for status data there will be a marked decrease in application execution performance PMACPanelPRO Basics 13 PMAC PanelPRO User Manual Note DPR is primarily intended to pass real time data gathering buffers and binary data for operations like inverse kinematics between PMAC and the client It is not required for general Query Response interaction Query Response Communication Query Response communication is the most basic form of communication with PMAC This mechanism allows the application to use the entire set of PMAC s on line Commands to interact with PMAC The quickest way to build a PMAC Panel Pro application to control and monitor PMAC is to locate the functionality needed in the PMAC User Manual and PMAC Software Reference Manual Test it with Pewin 32 Pro or the PmacTerminal contained in PMAC Panel Pro Then build a LabVIEW VI and sele
179. generate the necessary data internally to PMAC The following VI fetches this data and computes an offset to transform between encoder position and motor position e PmacEncoderOffset Query PMAC for the encoder to motor offset captured during a home operation for Encoder Motor Number This assumes that encoder one is defined for motor 1 etc Encoder Motor Offset provides a reference for using the encoder position capture and position compare registers These registers are referenced to the encoder zero position which is the power up position not the home motor zero position This value is the difference between the two positions and the home offset x26 This value should be subtracted from encoder position usually from position capture to get motor position or added to motor position to get encoder position usually for position compare Device Number 132 0 Bic Motor Encoder Number i32 1 Offset Encoder Motor Offset Double Capture Offset Bool F The trick in using this VI is to know when to query PMAC for the Home offset information Do this after the motor has been homed If the Capture Home Offset button in the panel is clicked the offsets and biases for the specified motor encoder number are retrieved The indicator labeled Xformed Encoder Pos now displays motor position as computed directly from encoder position There will be a very slight difference between the position in the PVE cluster and the Xformed Encoder Po
180. gered the signal should be transparent Position Captured MLOS gt x 2SC00S 0 245 Encoder 1 24 bit position capture register MIL7 gt Xi C000 17 Encoder 1 position capture flag This bit goes true when the trigger condition has gone true it goes false when the capture register 1s read when M103 is used in an expression As long as the bit is true the capture function is disabled read the capture register to re enable the capture function Count Error M118 gt X C000 18 1 Count error flag for encoder 1 If an illegal encoder transition both channels changing on the same SCLK cycle does get through or around if bypassed the delay filter and to the decoder a count error flag M118 here is set noting a loss of position information 110 Homing Encoders and Position Capture PMAC PanelPRO User Manual C Channel Status Quadrature encoders provide an index channel to indicate revolutions of the encoder This flag is true when the channel is true Home Flag A home switch may be normally open or normally closed open is high 1 true and closed is low 0 false The polarity of the edge that causes the home position capture is programmable with Encoder I Variables 2 and 3 1902 and 1903 for HMEFL1 Limit Flags When assigned for the dedicated uses these signals provide important safety and accuracy functions LIMn and LIMn are direction sensitive over travel limits that must be actively held low
181. ging this parameter make sure the motor is killed disabled Otherwise a sudden jump will occur because the internal position registers will have changed This means that this parameter should not be changed in the middle of an application If a real time change in the position following gear ratio is desired Ix07 should be changed In most practical cases x08 should not be set above 1000 because higher values can make the servo filter saturate too easily If Ix08 is changed x30 should be changed inversely to keep the same servo performance e g if Ix08 is doubled x30 should be halved Motor Home Offset 1x26 132 This is the relative position of the end of the homing cycle to the position at which the home trigger was made That is the motor will command a stop at this distance from where it found the home flags and call this commanded location as motor position zero 112 Homing Encoders and Position Capture PMAC PanelPRO User Manual This register permits the motor zero position to be different from the home trigger position It is useful particularly when using over travel limits for a home flag offsetting out of the limit before re enabling the flag as a limit If large enough greater than 1 2 times home speed times accel time it permits a homing move without any reversal of direction The units of this parameter are 1 16 of a count so the value should be 16 times the number of counts between the trigger position and the h
182. h data can be passed between the host and PMAC By avoiding the translation involved in standard ACSII communication data can be moved between the host and PMAC more quickly and it does not utilize precious P or Q Variables The process requires no explicit handshaking between PMAC and the host to avoid collisions when accessing DPR The PmacDPRNumeric collection consists of a number of VIs that uses Call Library Function VIs to access DPR The simplicity of the interface does not require CINs We show how to access individual memory locations as doubles long 132 and short 116 integers bit fields and booleans The example uses encapsulated PLCs and motion programs to generate and process the data transferred between the example PMAC Panel Pro applications and PMAC If DPR is used for this purpose the examples are useful DPR Addresses and Data Organization The mapping of memory addresses between the host computer on one side and PMAC s address space on the other side is simple To PMAC DPRAM appears as standard memory in the range D000 DFFF which can be thought of as 4K of long 48 bit words or 8K of single 24 bit X Y words This memory is accessed using M Variables mapped to this address range Depending on the DPR mechanisms used Real Time Fixed Background Variable Background etc the lower portions of this memory space are automatically allocated Hence anything above the end of this space up to DFFF can be used for any pur
183. hart update The Clear butoon will clear the chart and restart the chart history buffer The Save button will prompt for a file to save the chart data as a tab delimited spreadsheet file Select File gt Print Window from the menu bar to print the panel or a file at any time Servicing PmacTerminalMenu may cause noticeable glitches in the plot data It can be disabled by clicking the Disable Menu Track button 82 Development Tools PMAC PanelPRO User Manual 22000 0 20000 0 18000 0 T6000 0 14000 0 12000 0 10000 0 8000 0 000 0 4000 0 2000 0 0 0 Motor 1 Motor Motor 3 Motor 4 Motor 5 Motor 6 Motor Motor 6 Depending on requirements alter chart operation using the attributes available with the right mouse button These include the length of the history axis auto scaling of the Y axis P V or E plot style and many Motor 3 Motor 4 ah 4245 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 14 Clear Position Velocity Following Error CS Dets Plot Select c d Hotor 1 D wl BS Hotor 2 J g g Motor 3 J g g Motor 4 a c 5 Motor 5 a a on Motor G a z Motor 7 E g a Motor amp Disable Menu Track Position v Coord Sys 3 v M CS Units other items To change the range on the Y Axis click the minimum or maximum value on the axis enter a new value and disable the auto scaling Do not forget to save these changes to make them permanent
184. has fi Secossnensossnssossnssccsnsncccsnsnscconces anything at all This is not usually required Using these three basic VIs an entire albeit complex PMAC Panel Pro application can be generated The purpose of most of PMAC Panel Pro is to prevent doing this PMAC and PComm 32 Pro limit basic responses to 256 characters PmacCommRespStr and PmacCommGetStr handle this internally using the VI PmacCommGetBuffer to retrieve longer responses Generally the applications will not make use of this VI e PmacCommGetBuffer Check if PMAC has data available When Response Available is true Response String contains all available data When Response Available is false Response String is the empty string Responses are not parsed for PMAC ERR codes Get Response Available Bool F Device Number 132 0 Buffer Response String Exercise PmacTutor3 shows how PMAC Panel Pro simplifies the sending of commands in response to panel buttons and Boolean conditions PmacTutor2a Communication Logging This is a rather advanced topic but one that was included here for completeness PMAC Panel Pro has the ability to log all communication between the application and PMAC This might be used to monitor what users are doing or to log interesting sessions for later play back PMAC Panel Pro maintains all communication using the following VIs Future versions of PMAC Panel Pro may use this capability to implement a Graphical Motion Language e PmacComm
185. have a native two dimensional C organization As compiled a Motor Number larger than MOTOR_MAX cannot be used or more samples than indicated in BUFFER_MAX cannot be gathered The CIN does not check this condition DPR Dual Ported RAM 153 PMAC PanelPRO User Manual To resize these because of memory limitations or to get larger buffers change these values recompile the CIN and reload it into the CIN in PmacDPRRealTimeVectors It is possible to allocate these buffers dynamically using various CIN utilities However this introduces more complexity to the process such as allocating the buffers in the function CINLoad and deleting the buffers in CINUnLoad For this release of PMAC Panel Pro this approach was not utilized A Note About Vector CINs To avoid unnecessary complication bullet proof PmacDPR VIs with error diagnosis etc have not been provided Be aware of the fact PComm 32 Pro handles many bookkeeping issues associated with DPR As an example the order in which DPR operations is configured and enabled is important If a Variable Background buffer is enabled after a Fixed Background buffer then the Fixed Background buffer is disabled the Variable Background buffer may move Hence those VIs accessing it will not return the correct data A similar issue arises when using the Vector VIs Once a particular Vector buffer has been enabled for a specific number of samples do not change the length If this is done unload the VIs that u
186. he display Installing PMAC Panel Pro Because of the number of software drivers and steps in the communication process it 1s important that each step be done carefully and tested before proceeding to the next The following steps must be taken before installing PMAC Panel Pro Install configure and test LabVIEW 5 0 or greater and any patches Install configure and test any National Instruments boards Install configure and test the system s PMAC hardware Install configure and test PComm 32 Pro Pewin 32 Pro and or Ptalk DT Pro if purchased If these options were not purchased install a limited edition of the PComm 32 Pro device driver included with PMAC Panel Pro PMAC Panel Pro Software Before installing PMAC Panel Pro read the license agreement included in this manual behind title page Check the release notes included with the manual and located in the Documentation directory on the CD for last minute changes Installation of PMAC Panel Pro is done in two steps First the drivers must be installed Next the PMAC Panel Pro software must be installed 4 Getting Started PMAC PanelPRO User Manual Installation of the Driver Skip this step if Pewin 32 Pro PComm 32 Pro or Ptalk DT Pro has been installed and tested If one of these tools has not been purchased locate the PMAC Panel Pro Drivers directory on the CD and run Setup The installation program will suggest a directory path where the program files should be cop
187. he previous section to monitor and update the compare equal operation The value 500 in the numeric control specifies the pulse generation interval This can be changed and then click Enable Reset Compare The green LED indicates that the PLC is running When the motor is jogged using the jog controls the PVE display update and a pulse train on the scope will display Use level triggering on the scope The pulse train will have stable intervals with jitter in the actual pulse widths This is because a background PLC services the encoder If a more stable pulse width is needed change PLC 19 to PLC 0 in PmacPosCompGen pmc and the reference to PLC 19 in PmacPosCompSetup pmc to PLC 0 The foreground PLC will be serviced more regularly thereby resetting the output in a more deterministic manner 132 PMAC and NI DAQ Interfacing PMAC PanelPRO User Manual ee Pmac DAQ Move VI Positive Limit Exceeded Jog Relative lt t JogTo __ Make Pre Joc 4 Home In l l l l l l l l l l l Progress 00 10 20 30 40 50 60 70 80 90 10 0 eo Encoder Counts Rising Edge of CHEn amp Flag Low T High T v Encoder l Yarable 2 Home Flag Position Capture Control Limit Flag Encoder l Yariable 3 Limit Flag Capture Flag C Amp Fault Flag shan Nome Home Zer Reset e If not using an oscilloscope use the DAQ card to do the same thing On the far right below the two selector knobs on the panel is a menu ring that allows the s
188. heck the Enable box for the top or bottom chart The PmacDPRRealTimeVectors VI that actually processes the request for a fetch does a little more book keeping and buffers the data in arrays prior to passing it back to the caller It returns a PmacDPRRealTimeVectors cluster from which the desired items can be selected and plotted as shown here This cluster differs from PmacDPRRealTimeMotor and PmacDPRRealTimeServo Generally many of the items in the clusters would not be of interest in a time vector To use these modify PmacDPRRealTimeVectors to support them The demonstration on the bottom panel is different from that on top in that it has a longer buffer 256 samples vs 128 samples and a CS transformation can be applied e PmacDPRRealTimeVectors Query PMAC DPR for the Real Time Fixed buffer Motor and Servo data When Enabled is true the Default state the data for Motor Number is fetched and used to build DPR Real Time Motor Cluster and DPR Real Time Servo Cluster Motor PVE Cluster contains data in encoder counts or coordinate system units depending on the state of Coord Specify Cluster See PmacMotorPVE for details on how this is done A successful query of PMAC s DPR depends on whether PMAC is accessing the memory If Wait for Valid is true the VI places queries to PMAC until a successful read at which time New Output is true indicating valid output data If Wait for Valid is false the query may or may not succeed If the query fails
189. his exercise demonstrate the use of these three communication VIs Execute the operations specified in step 1 through 4 on the panel Application Basics 29 PMAC PanelPRO User Manual When step 1 of this exercise is executed the following error dialog will appear indicating a problem with the command If the dialog does not appear see the PMAC Communication I Variables section in this manual to modify PMAC s communication configuration as specified Prac Error Last Command 1 ERROUS Data error or unrecognized command Solutio Corect syntax of command Caution Until the proper hardware safeties have been installed configured and tested extreme caution must be exercised when moving motors to prevent damage and possible injury Do not send a Jog command unless certain the actions will not damage someone or the system The error dialog appears because the command string 1j is unrecognizable to PMAC The correct syntax for the command is 1j When error dialogs appear choice whether to abort the application or continue Commands that generate errors are not executed by PMAC and cause no harm However if the application logic continually attempts to send a bad command to PMAC there is no choice but to abort the application Otherwise this dialog may be received repeatedly The chances of halting the program using the standard LabVIEW STOP button before the application attempts to send the offending command again is un
190. ied The suggested directory location is c Program Files Delta Tau PMAC Panel Pro This will install the drivers and the test application PMAC Test Pro Installation of PMAC Panel Pro To install PMAC Panel Pro locate the PMAC Panel Pro directory on the CD and run Setup If LabVIEW has been installed properly the installation program will add several components to the LabVIEW installation If it cannot locate LabVIEW specify its location or exit the installation and install LabVIEW The primary PMAC Panel Pro component is the PMAC Panel Pro lib directory in the LabVIEW installation directory The library directory contains numerous sub directories to organize the VIs utilities and documentation Configuring the Device Driver Refer to PComm 32 Pro_Install pdf for Device driver installation and configuration for all supported operating systems and modes of communication Testing the Device Driver Initial testing of PMAC and the device driver is accomplished with the program PMAC Test Pro included with PMAC Panel Pro or the PComm 32 Pro drivers When PMACTestPRO executes the following dialog appears requesting the preferred operational mode OF Cancel ai Help Click OK and a terminal window will appear te PmacTest PHAC 0 1 15G 01 12 95 File Edit View Configure Terminal DPR Features Window Help Dejk e Se re BE PHAC 0 1 15G 01 12 95 For Help press F1 Caution Until the proper hardware safeties ha
191. iew capabilites Structuring your Yl with Prach ariet and ProaclWariet Vile requires a few more local variables and cases 4 5 3 10000 ix30 Prop Gain 2 7 2630 _ ix31 Deriv Gain iv g T p ix33 Integ Gain Motor Number Using PmaclVar Vis requires one case but a little more lanning to implement 420355 ix30 Prop Gain Eas nA Set Easy 2 2630 _ ix31 Deriv Gain Eas 0 x33 Integ Gain Easy Wher creating controls for Varnables check tts documentation in the PMAC Software Reference and set the Data Range attributes for the control to avoid problems with incorect data entries fou can also set the action desired for out of range values Feel free to use the numeric or boolean control of your choice The diagram for this VI demonstrates two ways of implementing I Variable access As a general principle I Variables should be read when the application begins and at anytime a different group is accessed In this example when the Motor Number is changed the application logic generates a Boolean condition indicating this and re initializes the panel controls When an update button is clicked the values contained in the controls are sent to PMAC Initialize the I Yars when Hotor Number changes Generate an intialization condition when changing Motor Number Initial value of 1 guarantees generation when starting Yl Jw sie i GetfGet TRUE when Pmacl ar passes input value
192. ign patterns The tutorial exercises that follow and the examples contained in the release reflect different ways to architect the applications to maximize the utility of PMAC Panel Pro These techniques are used throughout PMAC Panel Pro and can be applied in individual applications For an excellent reference on LabVIEW techniques and application design issues see LabVIEW Graphical Programming by Gary Johnson McGraw Hill ISBN 0 07 032915 X Dataflow and Sequencing In LabVIEW the order of VI execution is not guaranteed Some PMAC operations require sequenced command execution For example a command to start a motion program should be sent before waiting for it to complete In other situations M Variables must be defined before they can be used Some PMAC Panel Pro VIs anticipate the need for sequencing and provide an output to enable this without using a LabVIEW sequence structure In some instances a sequence structure must be used Dataflow and Recurring Execution LabVIEW loves to use while loops to execute VIs To continually send a JOG command to PMAC use the following example It will send the command repeatedly This wastes PMAC s time and slows the PMAC Panel Pro application To prevent this develop program logic so that the commands are not repeatedly sent to PMAC Most of PMAC Panel Pro s architecture is designed to simplify this by encapsulating this logic at the lowest levels possible Giving up Control Make sure that th
193. imarily with PMAC Panel Pro VIs and PMAC PLC motion programs Tightly coupled systems with fast clock rates or tightly synchronized motion and data acquisition requirements are handled easily using a few terminal blocks and wires to couple the hardware systems In this section a set of VIs for converting between encoder position and motor position is introduced This is followed by an example extending the position capture capabilities introduced in a previous section demonstrating how to capture positions in response to NI DAQ signals mechanical HARDWARE triggers and clocks and use the captured positions in the application Finally PMAC s compare equal capabilities will be introduced and several approaches for generating software and hardware triggers at specific positions while PMAC is in motion will be demonstrated Then PMAC generated position triggers and clocks can be used by the NI DAQ boards to control and synchronize acquisition In all cases PMAC Panel Pro simplifies the required tasks by working in CS units motor position or raw encoder units The next section outlines how to couple standard NI DAQ boards to PMAC to synchronously trigger data acquisition at specified positions and even use PMAC s servo clock as the DAQ sampling clock PmacEncoderPositionExamp This example demonstrates how PMAC Panel Pro handles encoder positions This is important for transforming captured positions into motor position and translating compare pos
194. implify the specification of PMAC addresses for gathering When these tools are understood they can be modified to suit particular needs The purpose of the PmacAddress collection is to build arrays of Address Item Clusters as shown here to define an Address Item s text description address scale factor and type Address Item Cluster Specify a description address and scale factor for a Address Item Address Item Description Text description of Address Item Address Item Address Address of Address Item Address Item Scale Scale factor for Address Item Address Item Type Enumerated type defining type of raw data The PmacAddress collection contains three Vis e PmacAddressMotors This VI maintains a table defining 29 of the most common Address Items If Input Select String is the empty string the VI produces Menu String Array describing the defined Address Items This should be used to set the items in a Menu or Text ring control Selection Index and Motor Number are provided by rings and define the desired item and the motor number used to compute an address for the specified item The computed item is contained in Address Item Cluster For a description of this computation see the reference section and the memory map contained in the PMAC Software Reference Manual Device Number 32 0 Input Select String Se lection Indes 2 Motor Number 132 Selection Found Bool Address Item Cluster seo Menu String Array e PmacAddressAdd Ch
195. indicators will not reflect the new eo from the terminal Step File Path E ie HO ices aE f Fie Pahl The general framework should look familiar There is an execution loop a PmacDevOpen a Stop button and the PmacTerminalMenu items Several bookkeeping local variables are initialized outside the loop Most of the status indicator VIs are located in the lower left The currently addressed motor and coordinate system are fetched by the VIs e PmacMotorCurrent Query PMAC for the currently addressed motor Generally it is used in interactive development environments rather than a custom VI to address a specific motor Device Number 132 0 dg Motor Number i32 1 8 1 e PmacCoordCurrent Query PMAC for the currently addressed coordinate system Generally it is used in interactive development environments rather than a custom VI to address a specific CS Device Number i3 0 ag Coord Number i32 1 81 11 Development Tools 75 PMAC PanelPRO User Manual The VIs and spaghetti diagrams on the lower right implement the PmacProgEdit PmacProgSelect PmacPLCSelect and PmacPLCExecute operations These utilize the update architecture used in many of the earlier exercises The VIs accept control clusters containing Booleans and generate new output data for the controls when an output Boolean indicates it has new data Several of the clusters function as both controls and indicators using their color and Boolean text This manual
196. individual buffer its location in DPR and the entire pool of buffers To the right of this are an Input Array and an Output Array The Output Array contains the data for the specified buffer The Input Array is provided but as noted not supported Below these items is a Write check box not supported an Enabled check box and two indicators On the far right are a few collections of buttons to control the associated PLC and motion program 166 DPR Dual Ported RAM PMAC PanelPRO User Manual DPR Variable Background Example 1 Actual Yelocit Motor CS 1 v gt 1 Present Actual Position Present Actual Position v 1 DAC Command Value P ariable 45 o Q ariable To gt Custom Gather Specification 70000 ESR Si Remove nooo g at Servo E YBGB Status Cluster Input Array Output Array 87 YBGDB u32 ry A al 53720 52 128 56 Iteration Timer mS VBGB Last Buffer Enum 20000 000 3 Num entries i32 oo i PLC Enabled 5 Total entries H T3560 Data Offset u32 1110 _ L_JPtc Enable 3594 Add Offset u32 Write g Valid Output DD63 Start Address u32 E Enabled Enabled Y BGB Status Cluster Input Array Output Array YBGDB u32 53720 52 132 00 7320 E Program show EE VBGB Last Buffer Enum wy _ 2222200 94400 2 Num entries i32 In Pos Total entries H 11111 00 i i Dizatie An motes Disable All 3580 Data
197. ingle page The diagram below demonstrates the two different techniques for accessing the individual items of a cluster Application Basics 23 PMAC PanelPRO User Manual Standard Unbundle Tab Order determines which item i connected to which terminal you ve got to provide access to all of the tems even those ou don t want Motor N State Malar A Unbundle by name Open Loop Loop ou can select which item In Position Position Is accessed by which terminal This i useful if you want only a few tems Using the mouse on function VI terminals cluster constants can be created easily 1f required These can then be filled with the appropriate data Clusters Contain Controls or Indicators but not both Clusters are wonderful for grouping commonly used items together to make it easier A major limitation should be understood In general a cluster should not contain both indicators and controls This does not work well with LabVIEW s data flow execution model what happens if it sets an indicator item before it reads it as a control value This is true especially of PMAC Panel Pro clusters that use Booleans configured with latched mechanical action LabVIEW will not let this possible race condition go and will generate an error PMAC Panel Pro has made some concessions for this The PmacMotorJogControl control cluster shown below can be used to jog a motor A separate position cluster has been created Motor
198. ingle word 24 bit data PmacMemoryReadDbl and PmacMemory WriteDbI provide two representations of the data native LabVIEW double and two 132 integers one for the Hi X word and one for the Lo Y word Do not attempt to access bits using logical bitwise operations such as Value and 32 on the double representation Test them using logical comparison operations such as Value 32 Bitwise operations on the Lo and Hi word are all right Specifying addresses for double words must be done using the following notation be 00 2b Specifying the address as D 002b is not recognized by PMAC e PmacMemoryReadDbl Read a 48 bit quantity from the memory location specified by Address Spec String For example L 002B The result is output as both a double and a hi word and lo word Device Number i32 0 Kem Output Value 132 Output Hi ord rt Address Spec String AdDb Cutout Lo Word i32 e PmacMemoryWriteDbl Write a 48 bit quantity Input Value to the memory location specified by Address Spec String For example L 002B Input Value is copied to Output Value Device Number 132 0 Address Spec String Mem Output Value Obl Input Value Dbl Ob Output Hi word idz Input Hi Word 12 Output Lo word i32 Input Lo Word 32 The panel for the exercise demonstrates the reading of a memory location containing the standard Machine Input at Y FFC2 to the standard Machine Output at Y FFC2 It also demonstrates accessing the 48 bit long word L 002B that is the Presen
199. interest Open call lal conver to cluster ara PEE ESS ro rori cee Seir rorirori rororo rors R Enable ara p Serwo Timer i32 DPR h Fosition Dbl oe pbs Velocity bar HE Laj Ailvec Paine Ene DO Ho aD Dacie Sample Period eRe ata g Cre Enabled Enabled Motor Numbers Walid Output Tama Tapa TE amp Position Obl Poe PR bon Teecw bE Hl nae eg AP ER Following Error Dbl Buff Length r Mae nel coe ext or geeneen Assemble a Coord Specify Cluster ca gt 132 lteration Timer mS l Stop ETP iE Ee 150 DPR Dual Ported RAM PMAC PanelPRO User Manual The vector fetch in the bottom half of the diagram unbundles the returned cluster of vectors and performs a CS conversion on the elements of the selected vectors using PmacDPRMotorVecToCoord This is a vector version of the standard PmacCoord VIs e PmacDPRMotorVecToCoord Coord Specify Cluster specifies a motor within a CS and an attempt to convert Input Array from encoder counts to CS units If the motor is not defined in the CS no conversion is applied If the motor is defined and Convert is true Coord Defined is true and Output Array is scaled from encoder counts to CS units Coord Definition is a string specifying Output Value units as Encoder or the CS definition of the motor Device Number 32 0 Coord Specify Cluster Input Array Double PmacDPRRealTimeVectors CIN The diagram for PmacDPRRealTimeVectors
200. ion Programs and POMs 97 PMAC PanelPRO User Manual Using Encapsulated Motion Programs PmacPQM ICVs can be combined with the custom PmacProgSubVI created by PmacTerminalEdit to build great applications The diagram for the example is shown here Dey Open C S Defs hd brs Coord TSS Close Det Handle Datalog of POM array Motrs Ea i Pos Datalog Control Ss 5 m Datalog Display EHF a an T EE Ir Progress ee ile al TF of gt Read Write Cycle paaa Dlog seseeen a Sui i 7 O ae EH E HM achineODutput onyert POM controls to ara nee i i TF Acceleration in m Bhow Prog gH moue TEL E i F i LE A d a i Update POM controls b 7 ee ae P SSE SPP PPP PPP PPP PPP PP access pa mas Acceleration in ms 5 u False p 2o g i 3 ee sae Move 1 incmil 3 Fetch POM data on startup 7 a heer i M e F e t C h new P g H d at a EERE CC CC CC The application has the standard execution loop with menu processing and a Stop button In the middle is the PmacProgSubVI VI created for the motion program PmacPQMTest pmce already introduced When the Cycle Read Write button is clicked a sequence of operations begins The PmacPQM clusters on the panel are translated into PmacPQM Variant clusters and bundled into an array The array is passed to PmacFileDatalog which appends the array to the datalog file ignores data logging or ignores the current inpu
201. irmware function that automatically performs a number of operations to establish a motor s zero position The homing search move can be executed with the on line HOME command from a PLC program using COMMAND HOME or a motion program HOME statement However the HOME command is issued x23 specifies the move s speed and direction If x23 is greater than zero the homing search move will be positive If itis less than zero the move is negative The acceleration for a homing search move is controlled by the same parameters Ix19 Ix20 and Ix21 as jogging moves Action on Trigger During the homing search move PMAC firmware waits for the hardware trigger When the trigger occurs PMAC reads the position at the time of capture usually the hardware capture register and uses it and the x26 home offset parameter to compute the associated motor s new encoder zero position Motor positions will now be referenced to a new encoder zero position plus or minus any axis offset in the axis definition statement If the axis definition is 1 gt 10000X 3000 the home position will be reported as 3000 counts 104 Homing Encoders and Position Capture PMAC PanelPRO User Manual If software over travel limits are used 1x13 x14 not equal to zero they are re enabled at this time after having been disabled during the search for the trigger The trajectory to the new zero position is calculated using deceleration and reversal if necessary Note th
202. is the C source file created by LabVIEW for the CIN node and contains the actual code to accomplish the desired task 138 PComm32 Code Interface Nodes PMAC PanelPRO User Manual Workspace fl Workspace PmacDIPR 12 project s 24 PracDPAFixedBack files i Eel ee PracDPAFixedB ackConfig files a el ee PracDPRFixedBack ectors files Z cin obj Z labview lib 2 lwebmain det E Milter ake files aes PracD PRR ealT imeMotor tiles ea PracDPARealT imebotors files Ee PriaclPRRealTime ectors files G2 PmacDPR arBack files E eel ee PmacDPRAYarBackContig files E q l ee PracDPRYarbackYectors files w Infoview Creating a CIN C Stub for PComm 32 Pro After placing the CIN VI in the diagram wiring the inputs and creating the C source file to edit the source The following code was created for the Code Interface Node in the VI PmacCIN CIN Source File Include NexT_ code hn CIN MgErr CINRun int32 Device_Number_1i32_0_ LVBoolean Enable Bool intos Eneble Motor Numbers 1327 138 1l Iints2 Servo Period 132 1_ 3 CIN MgErr CINRun int32 Device Number 132 0 LVBoolean Enable Bool int32 Enable Motor Numbers 132 1 8 1 int34 Servo Period i32 1 4 ENTER YOUR CODE HERE return nokrr To access PComm 32 Pro capabilities add the line include lt pmacu h gt Then all of PComm 32 Pro s capabilities can be utilized PComm32 Code Interface Nodes 139 PMAC PanelPRO User Man
203. itions specified in motor or CS units into encoder position The panel shows Motor Encoder and Coord System knobs Motor PVE and a Jog cluster At the top nght of the panel are two indicators that display the encoder position as the raw encoder position and the encoder position converted into motor position or CS units using VIs in the PmacEncoder collection Before running this VI home the motors to be used Do this with the example covered in a previous section or execute a home command from PmacTerminal Encoder Servo Position Example TOE 26132 Raw Encoder Pos P 4 5 7 E v E 11 00 formed Encoder Pos j am 05 2 T Capture w a Encoder Home Offset Jog Relative Pe 4 5 JogTo Make Pre Joc J J 4 l l l l l l l l l l l 1 g 00 10 20 30 40 50 60 7 0 80 90 10 0 Motor Encoder Encoder Counts i a Encoder Position Transformations When executing this example the position indicator in the PVE cluster will display the current motor position The current encoder position is displayed in the indicator labeled Raw Encoder Pos Expect these two values to be different as they are in the panel Encoder Capture and Compare Operation 115 PMAC PanelPRO User Manual The most basic requirement for converting between encoder position and motor position and or CS units is the determination of the offset between a motor s zero position and the encoder s zero position The homing operation will
204. le path e Load Load a file into Output Buffer e Save Save input buffer to Input File Path e Save As Query the user for a new file to save Input Buffer e Clear Window Put an empty string in Output Buffer e Down Load Compile and down load Input Buffer to PMAC e Show Log Display the contents of the compile log Development Tools PMAC PanelPRO User Manual Device Number 132 0 prag boon New Buffer Boal F Input Buffer String J esus Qutput Buffer String Input File Path pes i Mew Path Bool F Program Edit Control Output File Path Using these descriptions it is straightforward to use these VI s powerful capabilities Place the appropriate control or controls on the panel Where required create a writeable local variable copy of the control or the required items attribute node If the menu ring requires an attribute node to display the programs or the button requires an attribute node to change its Boolean text create the node and select the proper attribute For the PLC Select cluster go to the panel and create the attribute node for each item in the cluster not the cluster itself PmacTerminalJog This tool is a modified version of PmacMotorMoveExamp and PmacTutor7 Its details will not be covered here Instead it is an excellent example to demonstrate the behavior of multiple executing tools and application VIs One note of importance is the limits on the numeric slider in the PmacM
205. likely A complete listing of PMAC error codes can be found in the PMAC User Manual and PMAC Software Reference Manual The diagram for this tutorial demonstrates two basic things to consider when designing the application If commands are sent to PMAC in response to an interface button click the mechanical action of the button should be latched and the PMAC Panel Pro VI that sends the command should be in a Case structure Otherwise the command will be sent every iteration of the loop PmacCommRespStr and PmacCommGetStr indicate whether they received a response using Response Available Response String will be the empty string if nothing was received Generally Response Available should be tested before using Response String 30 Application Basics PMAC PanelPRO User Manual Send the command ONCE when the button 1s hit Almost all PmacView Vis Pal Tue ps require the Device Number LTE f j Send the string No response expected WF there is a response and it is not fetched pen a by you the next time a command lis sent any waiting response is o dumped BEFORE executing the Comm and Ctrin 7 1 ARR ra ry ha ra haa a ahaha r yr ahahaha new comm and Send 2 fel Command String 2 If there is a response display it in the indicator a ou can use PmacCommGetStr to Get pE 2 retrieve unsolicted data or simply check String amp 2 for more data in a response This I 5 2 first checks with PMAC to see if it
206. lly an open gather buffer prevents the download of any new program or modification of any existing program Device Number 132 0 Buffers Open Bool delete gather Close Buffers Bool F Global Status ICVs In typical fashion the PMAC Panel Pro global collection of CVs provides a pair of indicator clusters and associated VIs to monitor all global status bits The icons for the VIs and the indicator clusters are shown below Unlike the PmacMotor status word clusters these clusters have many status bits that are reserved and for internal use e PmacGlobalStatWord1 Create a status indicator cluster for the PmacGlobalStat1 indicator containing PMAC s global status Device Number i22 0 on Global Status Word 1 Cluster e PmacGlobalStatWord2 Create a status indicator cluster for the PmacGlobalStat2 indicator containing PMAC s global status Device Number i22 0 oe Global Status Word 2 Cluster 60 Application Basics PMAC PanelPRO User Manual PmacCoord ICVs This series of exercises introduce the PmacCoord collection of ICVs Coordinate systems organize motors into familiar engineering measurement systems in which motion programs execute They define the scaling between motor encoder counts and engineering units such as inches centimeters degrees or radians They can also define coupling between multiple motors and a single coordinate axis Do not use these ICVs to configure the coordinate systems
207. lopment Tools PMAC PanelPRO User Manual ENCAPSULATED MOTION PROGRAMS AND PQMS This chapter introduces a variety of VIs and tools to seamlessly integrate PMAC motion programs into the PMAC Panel Pro application Earlier the PmacTerminalEdit was introduced This tool allows the development of new motion or PLC programs or the modification of existing programs and with the click of a button creation of a VI wrapper for the program In this chapter the details of the wrapper are covered and the PmacPQM collection of VIs are introduced These provide an interface to directly tie controls and indicators in the application panels to motion program variables PmacProgSubVl e PmacProgSubVI PmacProgSubVICreate makes a copy of this VI with a new name that matches the name of a motion program Because the motion program has the same name with a different extension this VI knows how to open parse load and run a motion program without intervention or extra inputs It allows the editing of the associated program and interactively executes the program Details of its implementation are contained in the manual The VI downloads the associated program when first loaded unless this option is disabled in the diagram and defaults for Program Number and Coord Number are provided for the Program VI State Cluster The interactive panel can be opened and used by setting Panel Show latched true See the documentation for PmacTerminalEdit and PmacTerminalEx
208. lower 16 bits of both X and Y addresses The F modifier defines a 32 bit floating point value in DPR also handled as the lower 16 bits of both X and Y addresses PMAC firmware and PComm 32 Pro handle the required bit and byte manipulations to convert the raw representation into Intel and Motorola formats M447 and M448 are single bits defined in simple 24 bit X Y words M444 gt DP SDEO00 M445 gt F SDE01 M446 gt DP DE02 M447 gt X SDE03 8 1 M448 gt Y SDE04 8 1 To access these variables with the PmacDPRNumeric collection of Vis a truncated version of the memory address is required A PMAC M Variable defined at DE45 become 0xE45 to PMAC Panel Pro PComm 32 Pro handles the absolute memory mapping while the PmacDPRNumeric VIs compute the address offset required by PComm 32 Pro For M Variables defined as F and DP nothing more is required For M Variables defined as X Y or specific bit fields a cluster defining the base address modifier and field or bit number is required 158 DPR Dual Ported RAM PMAC PanelPRO User Manual When looking at the panel only the address is required for M444 and M445 M446 M447 and M448 require the cluster These are covered in detail later The diagram for the example has a section at the bottom for handling the PQM controls and a case statement at the top for handling the encapsulated PLC The PLC encapsulation VI is wrapped inside the case statement so that it can be disabled and the impact of it
209. m and global commands e Define common indicator and control clusters for use on the panels e Implement function VIs for the indicators and controls Using these as is and modifying others allows the creation of great looking panels for applications quickly PMAC Panel Pro s ICV collections are organized into five categories 1 PmacAcc 2 PmacMotor 3 PmacMotors 4 PmacCoord 5 PmacGlobal Each of these categories has several exercises to introduce its capabilities There are similar examples in their respective sub directories Each tutorial introduces an example and then selectively drills its way into supporting VIs In doing so the developer will get a deeper understanding of PMAC Panel Pro internals so that potential limitations in the design can be addressed and its capabilities can be enhanced to suit specific requirements Application Basics 43 On line Commands PMAC PanelPRO User Manual PMAC provides a large selection of on line commands for monitoring and control Any of these commands can be sent to PMAC using the VIs already introduced Not every command is supported or used by the ICVs introduced here Some are rarely used Some should really be used from Pewn32 Others are potentially dangerous O100 turns a motor on 100 Many would and some should never be used in a user application A complete listing of available commands and their use can be found in the PMAC Software Reference Manual The PMAC on line commands use
210. mber of Items columns and Number of Samples rows In this format the data can be written to a spreadsheet or processed by many different LabVIEW data analysis VIs Device Number i32 0 Number OF Items i32 l ii a a ia I a Number OF Samples r32 d a a eee 2 ag i Servo Cycles 2 Gather Data Array Double The sequence frame in the middle of the case executes the step or an encapsulated motion program Replace the motion program with a custom one or modify the entire sequence to suit individual needs There are two other operations performed within the main case structure The Gather Spec cluster is unbundled and used with PmacPlotColor to setup the legend Finally after the data is collected it can be written to a spreadsheet if the operation was enabled prior to the gather This is done using e PmacGatherSpreadsheet Output a tab delimited spread sheet file for import into other plotting and analysis applications If Input Spreadsheet File Path is empty of Not a Path a dialog prompts for a file name The file name used is provided to Output Spreadsheet File Path Input Spreadsheet File Path Gather Data Array Double Gather Spec Cluster Output Spreadsheet File Path Development Tools 87 PMAC PanelPRO User Manual Specifying Gather Addresses With PMAC data can be gathered from any address This requires an address to gather from and a scale factor to apply to the data The PmacGather tools use a small collection of PmacAddress VIs to s
211. mentation is needed e The PmacDPR collection of VIs for accessing dual ported RAM must be modified e PMAC s interrupt capabilities will be used PMAC Panel Pro primarily interfaces to PComm 32 Pro using LabVIEW Call Library VIs to access specific PComm 32 Pro functions In some instances the need for increased speed sophisticated manipulation of PMAC or the number of calls to PComm 32 Pro begins to create a nasty mess of Call Library VIs that becomes unmanageable In this section a basic PmacCIN VI is introduced which is comprised of a VI C C source file Microsoft Visual C workspace and project file The instructions show how to create the C file modify the existing workspace and project file compile the source file and load the object file into the VI s Code Interface Node LabVIEW 5 0 makes the process easy if some simple procedures are followed LabVIEW Code Interface Node Basics What is a CIN Code Interface Nodes are VIs that call code written in C directly from a block diagram Many LabVIEW aficionados dislike CINs However there are instances where the logic required to implement an operation is much simpler to specify in C than LabVIEW s G Furthermore there are instances where the need for efficiency and speed suggest the use of CINs Accessing PMAC DPR has both requirements CINs can accept any LabVIEW data type including clusters and arrays as an input or output The following illustration shows a CIN in a simple di
212. moves being executed are not homing moves After selecting the capture trigger condition the Configure Capture button sets the configuration in PMAC Once this is done the encoder is armed and waiting for the specified capture trigger The simplicity of the diagram demonstrates how the application is organized At the top are the VIs to handle the jog and PVE clusters At the bottom is the logic to handle the configuration of the capture condition The encoder capture trigger condition is configured whenever the motor number changes or the Configure Capture button is clicked Conhigure the Capture Condition A bee A gt a Once the capture condition is configured PmacEncoderTrigger is used to monitor the encoder flags When a trigger occurs the VI reads the capture register and transforms the captured position into motor position or CS units The VI does a lot of bookkeeping to make the job easier To use it for capture operations leave the Enable Compare and Input Compare Position terminals unwired The next section of this manual will show how this VI also handles compare triggers 118 Encoder Capture and Compare Operation PMAC PanelPRO User Manual e PmacEncoderTrigger This VI maintains Encoder Number s compare equal and capture operations and monitors the encoder s status register Home offsets are removed or added during the processing of compare equal and capture register data Limitations associated with 24
213. munication mode When using this VI provide the inputs and use the outputs exactly as PmacDevOpen would be used Multi threading and PmacDevOpen PMAC Panel Pro and PComm 32 Pro readily make use of LabVIEW s multi threaded programming model There can be multiple PMAC Panel Pro application VIs open to PMAC and execute simultaneously without problems PmacTutor2 Sending Commands and Getting Responses The most basic interaction with PMAC is done using one of three PmacComm Vis e PmacCommGetStr Check if PMAC has data available When Response Available is true Response String contains all available data When Response Available is false Response String is the empty string Responses are parsed for PMAC ERR codes and flagged with a modal dialog Response 4yvallable Bool F Device Number 132 0 Resmana S iina e PmacCommSendStr Send Command String to PMAC If command string is the empty string nothing is sent The output device number is a copy of input device number to allow sequencing of commands to PMAC Device Number 132 0 Send Command String String Device Number 132 0 28 Application Basics PMAC PanelPRO User Manual e PmacCommRespStr Send Command String to PMAC and wait for a response If Command String is the empty string nothing is sent Response Available is true when Response String contains response data When Response Available is false Response String is the empty string Responses are parsed for PMA
214. n Index as a state from execution to execution Translation of menu ring selections in PLC Select Cluster into PLC Selected Cluster occurs when First Time Strings 1s true or either control in PLC Select Cluster changes New Output true indicates that PLC Selected Cluster Menu String Array and Button String Array contain new data Device Number 32 0 PLC Select Cluster First Time Bool F New Output Bool F 1 PLE Selected Cluster taa Menu String Array Button String Array PmacPLCExec This VI controls the execution of foreground and background PLC programs by modifying 15 using a PmacPLCExec control as both an indicator and a control When First Time is true New Output is true and Output PLC Exec Cluster indicates the state of foreground and background PLC program execution When the buttons in Input PLC Exec Cluster do not match the last Output PLC Exec Cluster contains the execution state of the foreground or the background PLC programs are toggled Device Number 132 0 Input PLC Exec Cluster First Time Bool F Hew Output Bool F Output PLC Exec Cluster PmacProgEdit Manage common editing operations on Input Buffer String as specified by Program Edit Cluster Input File Path is the default file path to use for Load Save or Save As operations New Output Buffer is true when a Load or Clear Window operation puts new data in Output Buffer New Path is true when a Load Save or Save as operation modifies the fi
215. n on the packing list is missing contact Delta Tau immediately Carefully inspect all components for signs of physical damage PMAC Panel Pro consists of e PMAC Panel Pro CD containing Vis and on line documentation e PMAC Panel Pro technical documentation package PMAC Compatibility PMAC Panel Pro works with the following motion control boards PMAC ISA PCI up to eight axis PMAC LITE ISA PCI four axis PMAC2 ISA PCI four or eight axis Mini PMAC ISA PCI Turbo PMAC PMAC2 up to eight 8 axis UMAC QMAC up to eight axis e PC104 Turbo PC104 four or eight axis A system integrator or other person may have performed installation and configuration of PMAC amplifiers and motors Refer to the documentation provided by the integrator or with the purchase for details PMAC Panel Pro supports PMAC2 with the exception of certain encoder specific capabilities such as encoder capture and compare Customer Furnished Hardware In order for the PMAC Panel Pro to operate the following customer furnished hardware is required IBM or 100 compatible 486 66 MHz personal computer PC Pentium or equivalent recommended Minimum of 16MBof RAM 32MB recommended A minimum of 100MB of free hard disk space SVGA color monitor with minimum 1024x768 resolution In addition the following optional National Instruments or third party data acquisition equipment may exist Multi function data acquisition I O cards Signal conditioning equipment Im
216. n this example select a Motor Index for display As shown a Motor Index of 1 displays the data for Motor 2 a alid Output pen nssnannnssnan DPF Enabled ranee eee recece Sine Ramana tsa ees aie r r ARRANA e OSUPA aa A 3 Sample Period RE seusnusstorsivinnncavas DFF DPR a Time Servo Cluster a J p T US gee DPR Real Time Motor Cluster mana Waits E Enable Motor Numbers ait For alid oan ie Motor PYE Cluster re saat a RoC TT aanas paaa poses BPR be Enable Motors Motors Enable Motors E ji B pe Ei U Wait For Valid Wat For vaida Cees ae et DPR Real Time Motor raat Motor Index l Z gt EEA Iteration Timer mS ry G Stop E ba Ja The diagram for the example requires three VIs One VI configures the operation one fetches the data for a single motor and one fetches the data for multiple motors CASE statements are used to control the update of the display clusters The architecture of the PmacDPR VIs is different from most of those introduced already Whereas almost all other collections operate in a query response mode that is always enabled these VIs require the enabling of specific capabilities by a configuration VI Hence most PmacDPR VIs have an enable input that prevents them from querying DPR until it is enabled On the top left the PmacDPRRealTimeConfig VI requires a Sample Period Enable Boolean and an integer indicating how many motors to copy The enable input is not
217. nG MAG Reterenee nothing is sent The output Device Ne Online Tutorial Number to allow sequencing of comme search Examples Search Examples Technical Support Form About LabvieW Configuring PMAC Panel Pro Communication PMAC Panel Pro communicates with PMAC using the PComm 32 Pro device driver configured previously To access the driver from PMAC Panel Pro define the device number and communication mode for the driver for PMAC Panel Pro PMAC Panel Pro s primary device driver PmacDevOpen is configured using the following procedure 1 Run LabVIEW 2 Open the PmacDevOpen VI Select File Open and navigate to PMAC Panel Pro lib PmacDevice PmacDevOpen vi The following panel should appear I gt PmacDevOpen vi Fille Edit Operate Project Windows Help Ha a ap Application Font p EF E Communication Hode Device Number a D Bus y qo o Device Number 32 0 Pmac Type Rom Date Rom Yersion DESE 4 ees e 8 Getting Started PMAC PanelPRO User Manual Set the Device Number control not the indicator in the white box on the front panel to the device number specified for the PMAC during the configuration of the driver The default Device Number in a new PMAC Panel Pro package is 0 If this is the device no change is required Otherwise modify the control and make the value permanent using the right mouse button and clicking the Data Operations Make Current Value Default option and then saving
218. nable Compare is true This value is interpreted as being in CS units if Covert is true and Motor Number is defined in Coord Number Otherwise this value is interpreted as being motor position in encoder counts Home offsets are removed prior to setting the encoders actual register value Limitations associated with 24 bit rollover are not handled by this VI Output Compare Position is a persistent copy of Input Compare Position when Enable Compare was true Device Number 132 0 Encoder Number 132 1 16 1 7 ee New Output Bool F Coord Specify Cluster Enable Compare Bool F Input Compare Position Dbl Output Compare Position Dbl If the application uses PLCs to handle the capture or compare triggers do not service them with the PMAC Panel Pro application This might create two sets of handlers for a capture or compare operation This does not prevent the configuration of the operations using PMAC Panel Pro and servicing them with a PLC Be aware of who is responsible for handling the encoder Encoder Capture and Compare Operation 123 PMAC PanelPRO User Manual Method 1 PLC Operation The P101 slider specifies the interval the PLCs will use to generate compare equal triggers Changing this value sets P101 in PMAC and enables PmacPosCompSetup discussed earlier This PLC captures the current encoder position adds the interval to the position sets the compare equal register and resets the compare
219. ncoder or the CS definition of the motor Device Number 132 0 Coord Specify Cluster Input Yalue Double oord Definition String Coord Defined Bool Output Value Double Coord Definition String 46 Application Basics PMAC PanelPRO User Manual PmacMotorPVE is an extension of the position velocity and following error VIs that combine them into a single VI that can be used to drive the PmacMotorPVE indicator The use of these VIs is shown in the diagram below e PmacMotorPVE Query PMAC for the position velocity and following error for the Motor Number operating in Coord Number Assemble the measurements into Motor PVE Cluster If Convert is true convert the measurements to CS units Otherwise leave them in encoder counts See the documentation for PmacMotorPosition PmacMotorVelocity and PmacMotorError for details on how these individual values are produced Device Number 132 0 Coord Specify Cluster Motor PYE Cluster The indicator color is set using an attribute node created from the terminal Coord i 4 a CEET Position d Color Motor PYE bundles all C ree is on the right into is ae alam Pao motor Following Error Error ou can fetch any on line motor state ou wish with these three is PmacCoordColor outputs a color constant of orange or blue depending on whether the response state is in C S or encoder units Clustering C5 Motor and Conyerison together into Coor
220. ndicates synchronous assignment is encountered at the beginning of the move to X10 but the action is actually not performed until the start of blending into the next move X20 Note With synchronous assignment the actual assignment is performed where the blending to the new move begins generally which is ahead of the programmed point In LINEAR and CIRCLE mode moves this blending occurs V TA 2 distance ahead of the specified intermediate point where V is the commanded velocity of the axis and TA 1s the acceleration blending time Also notice that the assignment is synchronous with the commanded position not necessarily the actual position Itis the responsibility of the servo loop to make the commanded and actual positions match closely In applications where PMAC is executing segmented moves I13 gt 0 the synchronous M Variables are executed at the start of the first 113 spline segment after the start of blending into the programmed move Note Synchronous M Variables after the last move or DWELL in the program do not execute when the program ends or temporarily stops Use a DWELL as the last statement of the program to execute these statements syntax There are four forms of synchronous M Variable assignment statements M constant expr Straight equals assignment M constant amp expr AND egquals assignment M constant expr OR equals assignment M constant expr XOR equals assignment In all of these fo
221. ne in Coord Number and output the response in Current Command Determine the scroll position and characters that delimit this line in List Buffer and create Debug Location Cluster for setting selection attributes in a multi line string control for real time display of Program Number s execution This information is obtained from PMAC using the LIST PE command Device Number 132 0 Program List Cluster Debug Location Cluster Current Command String The specification of the currently executing line in the program listing buffer is given by Debug Location Cluster Cluster of information for string control attributes The items define the Scroll Position of the string in the buffer and the Start and End Character of the line currently executing Selection Start and End character in List Buffer for currently executing program line Character Start Character End Scroll Position Number of the line executing currently in List Buffer The information in this cluster is used in the diagram to set the selection and scroll position attributes for the string control used to display the listing This can be seen at the top of the diagram TL E Tem o EL LO E Er Prog PHs ES Menu Program Dbug lia Scroll Position Open Coo tasty CS Defs String Mtra Coord ees StatPr Mots Pas bose Pos T Terg Froo oy Listing HE EE Coord System g 3 Development Tools 81 PMAC PanelPRO User Manual
222. nel Pro This should be located in c Windows System If the file is not in this directory try to locate it and determine where the file was placed The file can be copied into the correct directory and reattempt the compilation On Line Help PMAC Panel Pro has extensive on line help in two forms Extensive documentation of every VI and its terminals is available using the standard LabVIEW Help Show Help option There are standard Windows on line help files located in the LabVIEW Help sub directory These include help versions of the printed manuals and several PMAC manuals This is useful when examining the examples and tutorials When LabVIEW starts the contents of this directory are parsed and any help files located in the directory are added to LabVIEW s pull down help menu The figure below shows both forms of help Note the entry in the pull down menu for On Line PMAC Reference Other on line help files are added as needed Many of these can be down loaded from Delta Tau s web site and copied into the LabVIEW Help directory ibe PmacCommS endStr vi Fille Edit Operate Project windows Se 13pt Dialog Font f Show Help Cirl H ae ie Lock Help Ctrl Shift L Ee a Simple Help i Device Number i32 0 o o Online Reference Cirit a rline Help tor EmacEommaendstnei Pi Device Number 132 0 Sel Command String Sti DAD Example Navigator Explain Error PmacComm ntermet Links Send Command Sting to PMAC IF Co Of EI
223. nel Pro in PMAC Panel Pro lib have not been installed or there is already a custom view to accommodate other LabVIEW packages refer to the LabVIEW manuals or Online Reference under the topic Palettes Editor to add PMAC Panel Pro to the palettes Use the Edit Edit Control and Function Palettes option 1 Create anew view 2 Insert a Submenu and link it to a directory PMAC Panel Pro lib or a custom name The icon PmacDocument PMAC Panel Prolcon bmp can be added during the palette editing process Mass Compilation This step compiles the entire PMAC Panel Pro release so that there are fewer searches when loading VIs and confirms that everything can be found Select Edit gt Mass Compile to display the file selection dialog while there is a VI open Browse to the PMAC Panel Pro lib directory and click Select Cur Dir LabVIEW will then begin loading and compiling the entire PMAC Panel Pro release When this is complete click Cancel Note If the PComm 32 Pro package has been purchased the ability to develop LabVIEW Code Interface Nodes is available that may require re compilation See the PComm 32 Pro Code Interface Nodes section for details Getting Started PMAC PanelPRO User Manual If the compilation process encounters problems note the error message The most common problem encountered will be its inability to locate the PComm 32 Pro driver extension Pmac dll installed by the Pewin 32 Pro PComm 32 Pro PTalk DT Pro or PMAC Pa
224. nelPRO User Manual PmacTutor13 Configuring and Monitoring Coordinate Systems This exercise introduces CVs for monitoring and configuring coordinate systems and program execution within coordinate systems These VIs follow the same I Variable and status architectures already introduced The VIs are e PmacCoordIVar Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the I Variables for the specified Coord Number are set Otherwise they are fetched from PMAC and provided by Output Coord I Var Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 132 0 Coord Number 132 1 Set Get Bool F 4 Input Coord ar Cluster e PmacCoordStat Query PMAC for the status of the CS specified by Coord Number Report the two status words as arrays of Booleans and unsigned 32 bit integers Device Number i32 0 First Word 24 Element Bool Stat First Word Binary Status uaz Coord Number 132 1 8 1 Second Word 4 Element Bool Second Word Binary Status wie e PmacCoordStatProg Create a status indicator cluster for the PmacCoordStatProg indicator containing the status for Coord Number Device Number i32 0 Coord Coord Number i32 1 Chath Coordinate System Status Pr Monitoring the coordinate system status is a very common operation because programs run in coordinate systems If the coordinate system has Cartesian
225. ntaining command sequences I Variable configuration information and motion PLC programs To simplify this PMAC Panel Pro has a VI and associated cluster control to handle ASCII text buffers The control is located below the screen It is a copy of the PmacProgram PmacProgEdit control shown below The actual control on the PmacTerminal panel does not look like the raw control Be careful when moving items in a cluster Do not pull them out of the cluster boundaries by mistake This causes the remaining controls in the cluster to reorder their Panel Order The associated VI will not work as expected because what was control 4 is now control 5 etc Program Edit Control Leal else Clear Down Show Window Load Log The cluster and VI implement six operations using the screen buffer e Load Load an ASCII file into the screen buffer e Save Save the contents of the screen buffer to the file specified in the path control above the screen e Save As Save the buffer by selecting a new file e Clear Window Dump the buffer and reset the display bookkeeping e Down Load Save the screen to a temporary file compile the file and down load it to PMAC This means that the entire buffer must contain legitimate on line commands and or a program Buffers with previous PMAC responses are not downloadable e Show Log When compiling the buffer PComm 32 Pro generates a log file with standard compiler messages If the download generate
226. nted for the same reasons ae 1 Actual Velocity 7 Iterati 5 Present Actual Position v 1 DAC Command Value 173 eration Timer m Motor CS 1 v 1 Present Actual Position Background Stop P Variable 0 meoo Q Variable 0 _ PLC Enable Y Program Custom Gather Specification Se 4 YBGDB u32 VBGE Last Buffer Enum 3 Num entries i32 5 Total entries 3570 Data Offset u32 3554 Add Offset u32 D053 Start Address u32 Enabled x Enabled Buffer Length 32 Velocity DAG Position hes es OF Pesala Valid Output __ 2 YBGDB u32 YBGE Last Buffer Enum 2 Num entries i32 5 Total entries 3570 Data Offset u32 3555 Add Offset u32 DD53 Start Address u32 iE AF urs slo Valid Output Enabled Enabled Buffer Length 32 DPR Dual Ported RAM 169 PMAC PanelPRO User Manual 170 DPR Dual Ported RAM PMAC PanelPRO User Manual INTERRUPTS This section documents an emerging interface to PMAC s interrupt system The information presented here is preliminary and not supported yet PmaclinterruptExamp To run this example check the Enable box Interrupt Mask defines which sources are enabled The default value of zero enables all sources The In Position flag generates an interrupt and is a good test When an interrupt occurs the Interrupt Occurred LED is on and the count and source update PMAC Interrupts Int
227. ntrol is LabVIEW s use of lt TAB gt to give Key Focus to other panel controls according to the Panel Order This cannot be disabled so understand that hitting lt TAB gt throws the cursor out of the screen and onto the OK button then the Stop button etc as defined by the Panel Order Control character sequences work but do not display as expected If lt Ctrl A gt is typed only an a appears on the screen Hitting return does indeed send the a command to PMAC and all program motion will abort as expected Basic Command Editing Use the standard cut copy and paste control sequences to manipulate text in the screen buffer Copy a previous command paste it at the end of the buffer and execute the command with a lt RET gt In addition copy PMAC responses to other applications or other LabVIEW string controls Text cannot be inserted into the middle of previously executed commands The spaghetti diagram does not know where the insert took place and will require a lot of work to track this type of operation Development Tools 73 PMAC PanelPRO User Manual If entering lines that wrap to the next line on the screen list the programs with lines that wrap or list the gather buffer guaranteed to wrap the screen may start to act a little strange Solve this by clearing the window using the button below the screen Buffer Management PMAC Panel Pro applications especially their development require the management of ASCII buffers co
228. o_Cluster gt Home_In_Progress ServoStatus home_search 0 LVFALSE LVTRUE jig a ValidData LVTRUE New data for caller else ValidData LVFALSE Sorry no new data PmacDPRSetHostBusyBit DevNum 0 PMAC can do its thing return nokErr Check the PComm 32 Pro Reference Manual and see that the checking and setting of the DPR Busy Bit is required by PMAC When the unfilled CIN node stub was created LabVIEW generously declared the CINRun parameter order names and data types CINRun s job is to fetch DPR data from PMAC using the PComm 32 Pro functions and fill the LabVIEW data types passed by the caller with the data It is actually simple The parameters DPR_Real_Time_Servo_Cluster and DPR_Real_Time_Motor_Cluster are pointers to the data types provided by LabVIEW Calls are placed to PComm 32 Pro and data of the proper type is assigned to the members of the data types There is one catch here Note that Booleans returned by PComm 32 Pro are converted to LVTRUE and LVFALSE before being assigned to the members of the clusters This precaution avoids possible mismatches in data types PmacDPRRealTimeVectorExample The following example demonstrates a very powerful PmacDPR technique that takes multiple samples over time This is accomplished by placing repeated CIN that build vectors for the desired items This creates a simpler and faster VI diagram because building the vector is completed by the CIN and the data is
229. of an issue with the ICV VIs Issues can also arise when sending commands to PMAC If multiple VIs are busy sending commands it is not only possible but also probable that expected responses will not line up with the commands This is covered later in this section Persistent VI State LabVIEW VIs maintain their state from execution to execution within a loop as long as they are loaded in memory Sometimes this is desirable and in many instances is used by PMAC Panel Pro Vis particularly those that are used to build configuration tables or attempt to minimize repetitive queries for data that will not change often The following diagram demonstrates the use of this technique Initialization State fee i ie miian State Do your initializatian Once loaded into memory When executed the first time Initialization State is set to true and will remain that way until it is reset by an operation in this VI or the calling VI is closed thereby unloading this from memory Be aware that LabVIEW 5 0 has a bug handling this National Instruments plans to release a fix for this problem with 5 0 1 Until then PMAC Panel Pro 1 0 has added a few wires and local variables to fix this Mechanical Action Most PMAC Panel Pro VIs requiring Boolean inputs or buttons have their mechanical action set to Latch When Pressed Configure the buttons as shown in the following window Using this configuration the button is read once when clicked and reset to false
230. ollowing methods By Telephone For immediate service contact the Delta Tau Technical Support Staff by telephone Monday through Friday The support line hours and telephone numbers are listed in the table at the end of this section By Fax and E Mail Fax or E Mail a request or problem overnight and it will be dealt with the following business day Fax numbers and E Mail addresses are listed below Supply all pertinent equipment set up information World Wide Web WWW Delta Tau maintains a complete website containing many manuals product updates help files application notes and programming examples Go to www deltatau com Bulletin Board Service BBS Messages may be left on one of the Bulletin Board Services BBS The BBS is provided for customers distributors representatives and integrators et al The service may be downloaded and files uploaded and posted bulletins and Delta Tau newsletters read Messages may be left for anyone who is a member user of the Bulletin Board Systems A modem and ProComm Plus or similar communications program is required to use this system Many Download Upload Protocols such as Z Modem are supported Refer to the website at www deltatau com for specific information 2 Overview PMAC PanelPRO User Manual GETTING STARTED Unpacking and Inspection After receiving and opening the PMAC Panel Pro package compare the contents to the packing list to ensure everything has been received If anything show
231. ome zero position Example To make the motor zero position at 500 counts in the negative direction from the home trigger position set x26 to 500 16 8000 Encapsulated PLC Programs In a previous section VI wrappers that encapsulated motion programs and their operation into a single VI were introduced PMAC Panel Pro also encapsulates PLC programs The discussion of this topic was deferred because there was not a good example of their use homing from a PLC program The following PLC program PmacHomePLC1 pmc taken from the PMAC User Manual and uses the LIM flag to establish a home position for motor 1 PLC Set up Variables to be saved CLOSE MiLs3 gt xX 2S003D 13 1 Desired Velocity Zero bit M145 gt Y 9 90814 10 1 Home complete bit PLC Program to Execute Routine OPEN PLC 10 CLEAR Il23 10 Home speed 10 cts msec negative I1125 C000 Use Flagsl for Motor 1 limits enabled IT126 32000 Home offset of 2000 counts enough to take you out of the limit I902 3 Capture on rising flag and rising index T903 2 Use LIM1 as flag negative end switch T125 S2C000 Disable LIM as limits CMD 1HM Home 1 into limit and offset out of it WHILE M145 1 gt Waits for Home Search to start ENDWHILE WHILE M133 0 Waits for Home motion to complete ENDWHILE T125 SC000 Re enable LIM as limits DIS PLCLG gt Disables PLC once Home is found CLOSE gt End orf PLCE Using PmacTerminalEdit this prog
232. on the VIs panel Clusters with an Associated Function VI PMAC Panel Pro controls exist on VI Panels To get the data for indicators or generate commands from controls they need a PMAC Panel Pro function VI To make it easier to link the two together the name of the associated function VI is the same as that of the control Details on this are outlined in the next section The screen shown below shows the terminal for PmacMotorJogControl ctl and the function VI PmacMotorJogControl vi The similar names indicate that they are paired together and the panel cluster is wired somewhere on the function VI icon Application Basics 25 PMAC PanelPRO User Manual gt Untitled 1 Diagram File Edit Operate Project Windows Help d a 13pt Application Font Bo te i gt PmacView Functions X PmacMotor Trig b b b Fal y gt gt pees b b b War H PmacMotor rc Pa p PmacMotorog vi E maaa A Curr Flags Esm Flags H E E XM gMov lsMoyv gPID Ed e Motor Motor Motor Motor ee ePID aS afe sS afe igLimit Motor Motor Motor Motor MvEx Limits MvCtr Mvind Motor Mtr P Motor hatrSt PVE Exmp Stat Limits Motor Motor Motor Motor Stat Stat2 StaEx Error chests I Mov I PID I Safel Jog aAA Pos Mot n Vel PMAC Panel Pro VI Terminal Conventions PMAC Panel Pro has carefully chosen terminal names that are used consistently throughout the library Exten
233. ord function in PComm 32 Pro The false case Get operation uses the PmacDPRGetDWord function The offset supplied by the diagram is multiplied by 4 to get the actual memory offset of the M Variable in DPR as seen from the host Set Get Bool F 1 i Response Available Bool F Output Yalue 132 DPR Bits and Bit Fields The three VIs presented above require only the offset to determine the address of the desired data When accessing bits and bit fields the information contained in the PmacDPRNumericSpec cluster is required DPR Numeric Spec Cluster A cluster of items required to describe a DPR mapped PMAC M Variable for bit and field access Address i32 Hexadecimal integer specifying DPR address offset For example PMAC Addresses such as M445 gt F SDE01 M446 gt DP SDE02 M447 gt X SDE03 8 1 Become E01 E02 and E03 respectively M446 gt DP DE02 X Y String A single character string X or Y defining the type of data Not for L or DP Mask Bit i32 A hexadecimal value used to define a bit number for single bit operations or a multi digit hexadecimal number defining a mask for multi bit operations The VI PmacDPRNumericSpec is embedded in the bit and bit field VIs covered next and converts the address specification into an actual DPR memory offset Look at the actual diagram for this VI to understand how this is done Generally although these are named as DWord operators the individual bits are defined in a 24 bit X Y word
234. ors In the examples the DAQ triggers are driven by ENC1 There is no reason other encoders or combinations of signals from multiple motors cannot be used with simple modifications PMAC Signals JRS232 10 pin connector Pin 8 Servo clock SERVO Pin 9 Common JEQU 10 pin connector Pin 1 ENC1 Compare Equal Output EQU1 Pin 10 Common JMACHI1 60 pin connector Pin 55 ENC1 Home Flag Input HMFL1 Connected to External TTL Clock Pin 58 Common ATMIO Signals OUT2 Scan clock Wired to PMAC SERVO EXT TRIG Start trigger Wired to PMAC EQUI CHO Wired to signal generator CH1 Wired to PMAC EQU1 CH2 Wired to PMAC SERVO Commons Grounds ATMIO DGND ATMIO AGND JEQU and JRS232 commons all wired together The panel for PmacDAQMove is shown below This VI is comprised of pieces from several of the previous examples Use this VI to home motors Jog them configure capture and compare operations and initiate three different DAQ operations If the system has been connected in the manner described above or something similar begin testing the system by connecting EQUI to an oscilloscope or by running the VI and using the DAQ board When the VI is started select the capture flag configuration and click Configure Capture Then home the motor When this has been completed set Compare configuration cluster booleans as shown below and click Configure Compare This VI uses the encapsulated PLC covered in t
235. otor sError for details on how these individual values are produced DBL Motor Value Array Array of numerics for positions velocities or following errors for each motor See the documentation for PmacMotors Position PmacMotorsVelocity and PmacMotorsError for details on how these individual values are produced TF C S Defined Array of Booleans indicating which motors are displayed in CS Units C S Applied Caption indicating the currently addressed coordinate system or that the displayed values are in Encode Counts The conversion of motor states from encoder counts to CS Units operates similar to PmacCoordMotorTo Coord introduced in PmacTutor7 e PmacCoordMotorsToCoord Generate an indicator cluster for PmacMotorsPVE Input Value Double is an array of positions velocities or following errors from VIs in the PmacMotors collection If Convert To Coord is true fetch the CS definitions for the motors specified in Coord Number and scale them to CS units Motors not defined in Coord Number are not scaled Device Number 32 0 Input Yalue Double Array Coord Number 132 1 8 1 Convert To Coord Bool The panel for the exercise uses the familiar jog control with LabVIEW menu rings for selecting the motor number and coordinate system number The PmacMotorsPVE cluster and a CS definition cluster display the motor positions and motor definitions in the addressed CS The plot is a standard strip chart with Auto Scaling on
236. otor definition in CS Buffer Control Commands LIST PC PE List program at Program Execution General CS Commands Report coordinate system status words Program Control Commands A Abort program B Begin program H Hold program Q Quit program R Run program S Step program Motor Commands General Motor Commands Reset motor HOME Home HOME Z Zero move home K Kill output Jogging Commands J Jog positive J constant Jog relative to actual position J Jog stop J Jog negative J constant Jog to position J Return to pre jog Reporting Commands P Report addressed motor position V Report addressed motor velocity F Report addressed motor following error Report addressed motor status PmacMotor ICVs This series of exercises introduce the contents of the PmacMotor collection of ICVs These allow the applications to add configuration control and monitoring for individual motors PmacTutor7 Position Velocity Error and Jogging The most basic motion operations involve controlling or jogging motors under manual control and monitoring the position velocity and following error during the move Requesting and Formatting P V and E PmacMotor has three VIs that request and format motor position velocity and following error These require a Coordinate Specify Cluster input This cluster is more of a data type than a cluster associated with a specific control Itis often assembled from controls in the applica
237. otor motions on the top left Motor Position C S Defs C Append Datalog Control New File O Ignore D LabView PmacYiew _lib PmacPQM Current Record 2 Num Records 9 Vv C S Units uacineoueat P2 412 x BI I 10 25 5060 Ps 320 J a 1 1 1 I 20 25 30 35 40 x Move 2 in cm Z 1000 5000 x Move 1 in cm a Delay in mS Acceleration in mS Cycle Readwrit In Progress Below this are four PmacPQM Cluster controls associated with the four P Variables used by the program P1 Acceleration in mS P2 X Move 1 in cm etc Each cluster contains a control for the value of the variable and a string control specifying which P Q or M Variable At the bottom of the panel is a Cycle Read Write button to begin execution of the encapsulated program and an In Progress indicator to monitor the execution of the program The Show Program button will open the encapsulated program s interactive panel thereby allowing interactive modification of the program and stepping through its execution PmacPQM provides the ability to log P Q or M Variables to standard LabVIEW datalog files The logging process is controlled by the Datalog Control Cluster and Datalog Display Cluster in the upper right and is sequenced with the Cycle Read Write button 94 Encapsulated Motion Programs and POMs PMAC PanelPRO User Manual Click the Create Open button and the system prompts for the nam
238. otorJogControl cluster Change the limits to reflect the limits of the mechanical setup 49 4 5 Assigned 4 B 4 B to CS a a i 2 E j 1 Boo i 9 Hotor Number Coord Number priate oats Warming Fatal Following Error Following Error Amplifier Fault Error P Y E Stop pi Jog Relative i ea JogTo Make Pre Joc F 00 10 20 20 40 50 60 70 80 30 100 Encoder Counts ay Hegaltive Not St Positive Limit Exceeded Limit Exceeded Home In Home reat Progress aji hal iE tone ows zeo Rest Start by opening and executing PmacTerminal As motors and coordinate systems are addressed the captions in the terminal tool indicators change If PmacTerminalJog is executed by opening and running it or by selecting PMAC Panel Pro Jog from the VI menu things start to behave strangely If the last few PmacTerminal commands addressed motor 3 and coordinate system amp 2 everything looks fine on the indicator bars When PmacTerminalJog is run the indicator bars suddenly reflect the status of motor 1 and coordinate system amp 1 A terminal command was not sent to do this The truth is that there was a command sent There is only one PMAC and any commands that require a motor or coordinate system address change the addressed item Because PmacTerminal queries PMAC for the currently addressed motor and coordinate system it will use these values for its status queries If these VIs are replaced with num
239. perations A list can be built in four ways Select an item and Motor CS number P Variable Q Variable or define a Custom Gather Specification Click the associated gt button to add the item to the list on the right The gather sample rate is defined as a number of Servo Cycles All items are gathered at the same sample rate Items selected in the list can be deleted using the Remove button e New Output is true when an item is added to the list with a gt button or removed from the list with the Remove button New selection identifies the selected item in the gather list Gather Selection Items String Array define the contents of the gather list Gather Spec Cluster is an internal data type used by other PmacGather VIs to setup PMAC and collect the gathered data Device Number 13 0 New Output Bool F Mew Selection 12 nae eee Ene j Sees Gather Selection Items Stri Gather Spec Cluster Development Tools 85 PMAC PanelPRO User Manual There are several methods for specifying Address Items provided by this VI and its control indicator cluster e The top group of two Menu rings allows the selection of one of 29 standard motor or CS variables and a motor or CS Using the gt button in this group add the selection to the Text ring on the right e Ifa P Variable or Q Variable number is specified and the appropriate gt button is clicked the specified variable is added to the selection list e On the bottom is a Cus
240. pment Tools 89 PMAC PanelPRO User Manual ST Selection Found Bool Create gather description EGE Selection Index 1327 Device Number 132 0 Compute scale factors for each table e entry At the bottom of the diagram is a labeled case structure sda Compute Scale Factors for w table sain It is reproduced here for clarity Compute scale factors for each table entr Select the last case in the structure using the mouse and add another case The default last case is 29 so add case 30 or whatever is needed If the scale factor is fixed and specified in the table wire the orange scale factor input tunnel from the unbundled cluster to the output select tunnel on the right This will copy the scale factor in the translation table into the scale factor item for the Address Item Cluster being built The case shown here depicts the scale factor computation for item 16 Actual Velocity at Address Offset X 0033 with stride 3C The units of the gathered data as documented in the PMAC Software Reference Manual Chapter 8 are lof 1x09 32 counts 7 1x60 1 servo interrupts The scale factor in the translation table is 1 32 Hence this portion of the diagram computes ScaleFactor 1 Ix09 Ix60 1 When modifying the tables make sure that to keep an original copy of the PmacAddressMotors VI Ifa control is pulled out of the cluster or the cluster is pulled out of the array the table clears all entries 90 Deve
241. pose There is no easy way to allocate addresses for DPR Numeric access automatically until all other automatic features have been allocated In the next section on DPR Variable Background buffers it is outlined how to determine the end of this allocated space For now use DPR memory between amp DEOO and amp DFFF To the host computer DPR appears as 8K 16 bit words of memory Each 24 bit PMAC X or Y word thus takes two 16 bit memory addresses A PMAC long or float 48 bits takes four memory addresses Fortunately PComm 32 Pro handles the host computer memory mapping and PMAC handles the required bit and byte manipulations to map Motorola 56K data formats to Intel data formats PmacDPRNumericExample The following example demonstrates the use of DPR for communicating numeric data between the host and PMAC PMAC executes a PLC that generates and responds to the register data accessed using M Variables that are mapped to DPR The data is also accessed using the PQM collection of VIs to demonstrate the differences in access speed and bypass the mechanisms that field access introduces Unlike the previous PmacDPR examples that required a configuration step prior to accessing the data PmacDPRNumeric requires no configuration other than assignment of memory addresses The panel for the example is shown below On the left is a box containing controls indicators that access M444 M448 using PmacDPRNumeric VIs On the right are several controls that
242. pplication Basics PMAC PanelPRO User Manual Tutorial VIs are located in the PmacTutor directory In this directory there are two base VIs that are used as a starting place for developing all the examples and PMAC Panel Pro VIs These are e PmacTutorApp Opens PMAC has an execution While loop and a Stop button e PmacTutorSub Has a predefined Device Number terminal The tutorial VIs are named PmacTutorl PmacTutor2 etc These should be opened examined and executed while working through the exercises Save new copies of these and modify them as desired Depending on the exercise goals various panels diagrams and sub VI descriptions are used to illustrate PMAC Panel Pro concepts Numerous descriptions are provided on the panels and in the diagrams PMAC Panel Pro Communication Tutorial The following exercises introduce those VIs used to send commands to PMAC and access its data This includes special collections of VIs for PComm 32 Pro access Sending commands Querying PMAC and processing responses Accessing PMAC memory mapped data and variables Querying and Setting I Variables PmacTutor1 Accessing PComm 32 Pro PmacTutorl covers the basic requirements for accessing PComm 32 Pro All PMAC Panel Pro applications must open access to PComm 32 Pro using PmacDevOpen This exercise demonstrates three steps for all PMAC Panel Pro applications Open the device do something close the device These VIs are e PmacDevOpen
243. previous section the PmacMotor and PmacCoord collection of ICVs were introduced that allows the conversion between motor position in encoder counts and motor position in coordinate system units In this section the PmacEncoder and PmacHome collection of ICVs are introduced that give the ability to move freely between coordinate system motor position and encoder position specifications These are important to relate precise position information to actions in a system Using the encoder gate array PMAC can be configured to e Capture positions in response to external or internal triggers e Generate triggers at pre specified compare equal encoder positions The first operation required for precision position measurement of any sort is the establishment of a zero or home position On PMAC this is done using an encoder capture operation that is triggered by a home position sensor Homing details are covered in detail in the PMAC User Manual Some of this information is repeated in this section In this section homing and position capture operations are outlined In the next section it is demonstrated how this same capability can be used to capture motor positions in response to external events generated by another National Instruments DAQ system or instrument Compare operations will also be covered in the next chapter and allow data acquisition to be precisely synchronized with motion Position Basics As shown below PMAC takes position informa
244. quire an I Var Set Number It allows them to be grouped by motor and or coordinate system To accomplish this it is only necessary to extend the concept to a slightly higher level The diagram for PmacMotorI VarSafety is shown here Note that when one I Variable is set they are all set whether or not they have changed Therefore the contents of the cluster should be refreshed by a Get operation prior to changing individual items and performing a Set operation Controls and indicators for the panels should have the appropriate type and range defined to prevent inadvertent user inputs Device Number 132 0 New Output Bool F Input Motor l 5afety CO 4 EH Input Motor Safety Cluster E O Motor Number 132 1 54 Application Basics PMAC PanelPRO User Manual PmacMotors ICVs This series of exercises introduce the PmacMotors collection of ICVs These allow the applications to monitor and plot the motion of multiple motors PmacTutor10 Requesting and Plotting Motor Motion This exercise introduces a number of indicators controls and VIs for requesting the motion of all motors The data can be displayed on a PMAC Panel Pro cluster indicator plotted in a strip chart or analyzed using LabVIEW s extensive analysis capabilities VIs for setting plot legends and selecting which motors to plot can be used to create flexible interfaces The primary query VIs in the collection request PMAC position velocity and following errors
245. r clusters PmacMotorI VarFlag is actually a sub cluster in PmacMotorI VarSafety To change the I Variables click the Change I Vars button Each item in the cluster has a full description that is accessible using Help Show Help Because each item in the clusters have been defined as referencing a specific I Variable the item units and appropriate data ranges for each item have been specified Ht aie la a P hi Application Basics 53 PMAC PanelPRO User Manual The diagram for the exercise demonstrates why using these ICVs makes life easier The Boolean criteria for executing the case are the same as in PmacTutor6 It is executed whenever Motor Number is changed or the button is clicked When the case is executed because of a change in Motor Number the VIs perform a get operation and refresh the cluster contents with the configuration of the new motor Motor Number Li ae The observant reader will note that the VI makes use of local copies of the panel control indicator clusters Those clusters that contain Boolean controls such as PmacMotorI VarPID and PmacMotorI VarFlag have their Booleans set for pressed mechanical action not latched action They are not used to initiate a command or action This does not violate the basic caution on using local copies of control clusters noted in this document in several places Grouping Multiple Variables It should now be obvious why the PmacI Var VIs re
246. r operation is enabled by checking the Enable box Nothing happens until the program is run This is due to the organization of the example not the associated Vector VI When the Vector portion of the example is enabled and the Run button is clicked the chart will begin updating Disable the top portion so that it does not steal samples from the Vector operation DPR Dual Ported RAM PMAC PanelPRO User Manual Notice that the displayed data is more quantized because of the DPR data is updated in the background Fixed Background data is program related and therefore computed at a slower rate and updated only when requested The other thing to note is that the velocity for Fixed Background operation is in encoder counts per minute whereas Real Time motor velocity is in scaled x09 counts per servo cycle The diagram for the example shows three VIs One VI configures the operation one fetches the data for a single motor and one fetches the vector data In addition there is a small diagram to handle the encapsulated motion program A CASE structure is used to control the update of the display clusters The PmacDPRFixedBackConfig and PmacDPRFixedBack VI operate similarly to their PmacDPRRealTime versions in that the Enable terminals operate the same way e PmacDPRFixedBackConfig DPR Fixed Background buffer is configured to update motor information for all motor between one and Enable Motor Numbers when Enable is true Operation is disabled wh
247. r to the documentation in in this manual for details on using the capabilities of the two panel components Help Show Help will also provide detailed descriptions of the buttons and indicators Motion Program Sub VI Mom OSNON Positions Coord Defs awed fos i yg lo No Program sr Ee r Step Hans Engt i ei Continuous ca Motion Req Motion Mode Run Time Amplifier Error Fault Warning Fatal Following Error Following Error Encapsulated Motion Programs and POMs 91 Load Clear Down Show Window Load Log PMAC PanelPRO User Manual The implementation of the VI is quite a bit different from most of those already introduced This VI is embedded in the application s execution loop so that it can continuously monitor the attached motion program As such it is not wrapped in its own loop It utilizes several VI control and server concepts found in LabVIEW to control the display of the panel and selective execution of some of its components so that it does not consume a lot of execution time unless required There are four major pieces of the diagram 1 On the far left is a case structure that controls and monitors the actual execution of the attached motion program 2 Below this is a small case structure that opens and displays the panel in response to the Boolean input Panel Show 3 The very large case structure on the right is execut
248. ram can be loaded Click the Create PLC VI button to create an encapsulated PLC Sub VI for this PLC This has already been done for this homing PLC PmacHomePLCl vi and the other PLC and motion homing programs documented in the PMAC User Manual The raw encapsulated PLC Sub VI is shown here e PmacPLCSubVI PmacPLCSubVICreate makes a copy of this VI with a new name that matches the name of a PLC program Because the PLC program has the same name with a different extension this VI knows how to open parse load and run a PLC program without intervention or extra inputs It allows interactive monitoring and changing of the PLC program s execution state Details of its implementation are contained in the manual The VI downloads the associated PLC program when first loaded unless this option is disabled in the diagram and a default for PLC Number are provided for the PLC VI State Cluster The VI queries PMAC for the PLC s execution state every execution This is done whether the program is executing or not New Output is true any time PLC Enable is true Homing Encoders and Position Capture 113 PMAC PanelPRO User Manual New Output Bool F PLC Vl State Cluster Execute State Bool DeviceNumber 32 0 PLC Enable Bool F Using this new wrapper VI it is easy to create PLC programs and use them in the PMAC Panel Pro applications The indicator on the example panel displays the Execute State of the properly loaded PLC program e
249. rams 2 Tools to monitor the execution and debugging of programs 3 Tools to develop PMAC Panel Pro panels to communicate program specific data between the program and user 4 Tools to encapsulate programs their execution and monitoring into a single easy to use VI The purpose of these collections is to allow the integration of motion programs into a PMAC Panel Pro application Either Pewin 32 Pro or the PMAC Panel Pro application tools documented in the Development Tools section of this manual can be used for the development of the raw motion programs PmacTerminal Terminal application tools for interactively creating controlling and monitoring PMAC and the programs PmacFile Tools for maintaining ASCII program files LabVIEW datalog files and downloading files to PMAC PmacPQM PMAC program execution is parametrically specified using P Q and M Variables For example the number of times a move is executed the increment of a move or the radius of a circular move can all be specified using Ps and Qs Specific machine inputs and outputs and internal registers are accessible using M Variables Mapping of these quantities to LabVIEW controls is facilitated by the ICVs in this collection In addition the ability to log this information to a LabVIEW datalog file and re execute the motion at a later time is provided PmacPLC PLC programs and their execution status can be edited and controlled using the VIs in this coll
250. rd Number Comm d Pos will represent When New Output is true DPR Fixed Motor Cluster and DPR Fixed Coordinate Cluster contain the most recent background data When Enabled is false the two output clusters contain the last valid data even though New Output is false Device Number 132 0 Enabled Bool T Motor Number 132 1 8 1 Coord Number 132 1 8 1 Coord Asis Char Notice that there is a CS knob and a Coordinate Axis string The values in the Coordinate cluster are for all motors in the CS while the Commanded Pos Comm d Pos is for a specific Axis in the CS In the example the X axis is specified If the axis is changed to Y and Run is clicked again notice that the O ein i o Pot _ Following Enor DPA Fixed Coordinate Cluster oo Comm d Pos Dbl BE Time Move i32 BS Time Accel 132 lg Prog Remain i327 Ey Ea Prog Exec 13 d Prog Mode Motion Mode Amplifier Fault Error Warning Fatal Following Error Following Error Single Ho Program i Step Running Continuous Hotion Reg Continuous Hotion Hode Run Time Error Circle Radius MOT ial ils Target Pos Velocity Comm d Pos Time in May TA na A M g Valid Output 1023 New Output Bool DPR Fired Motor Cluster DPR Fixed Coordinate Cluster Comm d Pos does not update because the Y axis is not defined in CS 1 The operation of the example is a little different when the Vecto
251. re are two VIs to read and manipulate memory data in various forms Remember that PMAC s integers are 24 bit words e PmacMemoryRead Read a 24 bit quantity from the memory location specified by Address Spec String For example X 002B The result is output as both an 132 and a Boolean array Device Number 132 0 blem Output Value mz Address Spec String Read Output Boolean Array e PmacMemoryGet Output Value is the value of the bit field defined by Start Bit and Number of Bits at the specified memory address Output the field as both Output Value and Output Boolean Array Device Number 132 0 ken Output Value i32 Address Spec String Get Output Boolean Array Start Bit 132 Number of Bits 132 The data retrieved from PMAC can be manipulated using the following Vis e PmacMemoryGetBit Bit Value is the bit at Bit Number in Input Value Input Yalue 132 Get a a 8 Bit Number 132 Bit Value Bool e PmacMemoryGetBits Fetch the field defined by Start Bit and Number of Bits from Input Value Return the field as Output Value 132 Output Boolean Array and Bit Number same as Output Value Bit Boolean Array can be used with sets of radio buttons If Output Value 3 then Bit Boolean Array is 0 O O 1 Input Yalue i32 Get Output Value ie Start Bit 132 Bits Output Boolean Array Humber of Bits 132 Bit Number i32 w Pot Boolean Aray Writing Memory Data There are two VIs to directly manipulate memory data in various forms The data i
252. returned by the CIN only when a vector of a specified length is built The panel for the example is shown below The panel demonstrates the fetching of vectors for the purposes of driving a real time chart On the top left is a knob for selecting a motor and specifying the number of samples to accumulate before updating the chart On the bottom the same operations are performed but motor items such as Position Velocity and Following Error are converted to CS units in the standard manner defined for PmacMotors On the left between the two sets of controls is a small block of controls to enable DPR Real Time data buffering 148 DPR Dual Ported RAM PMAC PanelPRO User Manual Pmac DPR Real Time Vectors Example 45 Servo Diff 3 6 Position 24 7 Velocity 8 Motor Number Enable J Buff Length 1128 Follow Error TT ARF ure glo D Valid Output Fosition Velocity Follow Error Wej QF gga ko _ Valid Qutput 4 5 143 0 123727 0 0 0 123727 0 i Enabled Motor Numbers 5 Sample Period Enabled Convert To CS 4 5 O 6 x Enable 2 ae 7 1 8 Coord System 256 Buff Length 3 To execute the example select how many motors PMAC should copy to DPR using the Enable Motor Numbers knob Sample Period defines the servo sampling interval Then click Enable to start the DPR Real Time data buffer As with PmacDPRRealTimeExamp a motor can be selected to fetch and then c
253. rganization and facilitate access PMAC Panel Pro provides a special collection of VIs to manipulate and access them Each type of I Variable Boolean Short Long etc has three VIs The VIs for accessing Long 132 I Variables are used to illustrate the interface 38 Application Basics PMAC PanelPRO User Manual e PmaclIVarSetLong Set the Long I Variable specified by IVar Set Number and I Variable Number The variable address is calculated as Var Set Number 100 I Variable Number Var Set Number 0 addresses global I Variables IVar Set Numbers from 1 8 address motors and coordinate system I Variables Device Number 32 0 lAa Mar Set Number 132 0 9 0 SLng l Yarable Number 132 0 99 Input Yalue 132 0 e PmacIVarGetLong Get the Long I Variable specified by IVar Set Number and I Variable Number The variable address is calculated as IVar Set Number 100 I Variable Number IVar Set Number 0 addresses global I Variables IVar Set Numbers from 1 8 address motors and coordinate system I Variables Device Number 32 0 far S Yar Set Number i32 0 9 0 GLng Response 132 Variable Number 132 0 99 Default 32 0 e PmaclVarLong If Set Get is false or not wired get the Long I Variable specified by IVar Set Number and I Variable Number Response Available will be true to indicate Response contains the new value If Set Get is true set the Long I Variable using Input Value Response Available will be false an
254. riable item is defined in the cluster it is a string 1 e P34 Set this as the default for each control in the panel and save the VI using the cluster not the original cluster itself PmacPQM Variant functions as a neutral or void type of PQM cluster e PmacPQMVariant Cluster for tying P Q or M Variable definition with a PQM type neutral string Generally this cluster is not used on application panels POM Variant Cluster P34 PmacPQM Conversions There are three types of PQM VI for processing PQM clusters The examples given here are for the PmacPQMLong collection Similar collections exist for PmacPQMBool PmacPQMShort and PmacPQMDbdI e PmacPQMLong If Set Get is false or not wired get the Long PQM Variable specified by PQM Variable String Response Available will be true to indicate Response contains the new value If Set Get is true set the Long PQM Variable using Input Value Response Available will be false and Response defaults to Input Value If an M Variable is specified it must be defined using Pewin 32 Pro PmacTerminal or PmacCommSendString Device Number 132 0 ory Response Available Bool F Set Get Bool F POM Yarable String Input Value 132 e PmacPQMLong2Var Convert the PQM Long Cluster to a type neutral PQM Variant Cluster Response idz POM Long Cluster PUM Variant Cluster e PmacPQMVar2Long Convert a type neutral PQM Variant Cluster to a PQM Long Cluster POM
255. riables generally this is not a problem because they exist only to aid further motion calculations However for M Variables particularly outputs this can be a problem because with a normal variable value assignment statement the action will take place sooner than is expected looking at the statement s place in the program For example in the program segment X10 Move X axis to 10 M1l 1 Turn on Output 1 X20 Move X axis to 20 PMAC and NI DAQ Interfacing 129 PMAC PanelPRO User Manual It is expected that Output 1 is turned on at the time the X axis reached position 10 Because PMAC is calculating ahead at the beginning of the move to X10 it will have calculated already through the program to the next move working through all program statements in between including M1 1 which turns on the output Therefore using this technique the output will be turned on sooner than desired How They Work Synchronous M Variable assignment statements were implemented as a solution to this problem When one of these statements is encountered in the program it is not executed immediately rather the action is put on a stack for execution at the start of the actual execution of the next move in the program This makes the output action properly synchronous with the motion action In the modified program segment X10 Move X axis to 10 M1l 1 Turn on Output 1 synchronously X20 Move X axis to 20 The statement M1 1 the double equals i
256. rmore LabVIEW does not support a 48 bit integer or 48 bit floating point number Fortunately because Query Response communication is conducted with ASCII strings the size of PMAC s data is somewhat hidden To simplify the interface between LabVIEW and PMAC PMAC Panel Pro supports the conversion of PMAC data into one of six LabVIEW data types Conversion into unsigned representations is done easily using LabVIEW s many conversion VIs The following table enumerates the representations and names supported in each domain The PMAC Panel Pro names Short Ushort Long and ULong are used in the names of many Query Interface VIs PMAC LabVIEW PMAC Panel Pro l bit binary Boolean or Bool 1 8 16 bit integers 16 bit integer 116 u16 Short 116 UShort u16 16 24 32 bit integers 32 bit integer 132 032 Long 132 ULong u32 24 bit floating point 48 bit integers 64 bit floating point doubles Double or Dbl 48 bit floating point doubles There are some situations depending on the value of I9 where PMAC s ASCII response strings are hexadecimal not decimal The conversion of these ASCII responses into equivalent native LabVIEW binary representations are handled by classes of VIs that use PComm 32 Pro s binary variable access capabilities 14 PMACPanelPRO Basics PMAC PanelPRO User Manual Download Management Maintenance of PMAC programs is provided by a collection of VIs that directly access PComm 32 Pro s download functions Th
257. rms the expression on the right side of the statement is evaluated when the line is encountered in the program ahead of the execution of the move The value of the expression the variable number and the operator are placed on a stack for execution at the proper time Position Capture FLAGs Interfacing to the FLAG inputs required for position capture was covered in detail in previous sections Because these inputs are so closely associates with hardware limit switches refer to the PMAC hardware and PMAC User Manual as well as any manuals supplied by the system integrator Many PMAC based systems for example X Y tables have already defined the operation of the limit switches and FLAG inputs Hence the use of these inputs must be coordinated with the system manufacturer s usage 130 PMAC and NI DAQ Interfacing PMAC PanelPRO User Manual DAQ Signals This manual cannot cover the wide selection of NI DAQ boards or their signal sets For the purposes of this section a few general signals will be discussed that can be found in some form on most National Instruments DAQ boards and that can be used to trigger acquisitions and define the DAQ sample rates Information that is more detailed can be found in the LabVIEW DAQ examples and tutorials and the manual for the DAQ board All of the examples in this section use the standard LabVIEW examples Connections to the DAQ board are best done using one of National Instruments many terminal blocks or
258. rray with New Output true The second operation is to monitor the associated motion program using PmacProgRun If Program Run is true the program is running and can use the newly loaded P Q or M variables The Program Running output will be true indicating that the program is running If Program Run is false no program is executing and Program Running will indicate whether another motion program is running in the associated coordinate system PmacProgRun is covered in detail here e PmacProgRun Control and monitor the execution of Program Number in Coord Number The specified program is started when Program Start is true and no program is currently running in Coord Number Program Running indicates that some program maybe not Program Number is running in Coord Number Output Program Start is a copy of Program Start and can be used to sequence program execution with other operations Device Number 132 0 Program Start Bool F Program Number 132 Coord Number 132 PmacPQMExamp The encapsulation of a motion program with a wrapper is a huge step toward integrating PMAC with LabVIEW The PmacPQM collection of VIs carry this further by providing an architecture for tying controls and indicators to the P Q and M Variables used by the PMAC motion programs and PLCs To illustrate how to do this use PmacPQMExamp located in the PmacPQM directory Jae Prog ane Program Running Bool F Hebe Output Program Start Bool F To begin look
259. rts the Home Complete flag for the motor is set to false and the Home In Progress flag is set true See this in the PmacMotorStatLimit cluster on the example panel Homing Encoders and Position Capture 109 PMAC PanelPRO User Manual e PmacMotorStatLimit Hegative Limit Exceeded Positive Limit Exceeded Home In Progress Kotor Status Limit Cluster At a fundamental level monitor the encoder s operation using the PmacEncoderStatFlags cluster and VI The five indicators on the bottom of the cluster simply reflect the state of their associated inputs Position Captured indicates that the configured trigger condition whether used for homing or some other purpose has occurred Count Error is used internally by PMAC Compare Equal will be covered in the next section A detailed description of these status bits and their standard PMAC M Variable definitions follow e PmacEncoderStatFlags Encoder Status Flags Cluster Compare E qual Pos Captured No Count Error No C Channel Flag Ho Home Flag Ho Limit Flag Ho Limit Flag Ho Fault Flag eza aA Eea M a a Ea Ee aea Compare Equal M1i16 gt x SC000 16 1 Compare equals flag for encoder 1 This compare equal signal is always copied into the compare equal flag M116 here that is available for PMAC internal use If using this flag internally make sure that the signal is latched M111 1 or it will be missed For interrupting the host edge trig
260. rvo_Peri0d 132 l 1 Enabled TRUE When currently enabled and Enable _Bool_T_ LVFALSE disable ALL background operations else if Enabled amp amp Enable Bool _T LVFALSE DPR Dual Ported RAM 145 PMAC PanelPRO User Manual PmacDPRRealTime Device_Number_132 0_ SerVO Period 152 1 0 Enabled FALSE Enable Bool _T Enabled return nokErr When first loaded make sure Enable flag is FALSE CIN MgErr CINLoad RsrcFile rf Enabled FALSE Indicate DPR Fixed Real Time disabled return NORTE This particular CIN has two functions CINLoad and CINRun LabVIEW creates the function and data type declarations such as clusters and arrays required by CINRun The function CINRun is called when the VI containing the CIN is executed CINLoad is executed when the VI is first loaded In this sample two functions from PComm 32 Pro are used PmacDPRRealTime enables and disables the DPR Real Time data buffer and PmacDPRSetMotors sets the number of motors to copy The logic of the IF statement uses the current enable state of the operation and the desired state passed in by Enable_Bool_T_ to turn the DPR Real Time data buffer on or off Notice the type of the Boolean and that most parameters are passed as pointers to data PmacDPRRealTimeMotor CIN The diagram for PmacDPRRealTimeMotor is shown below Note that the Device Number Motor Number and a false Boolean constant are passed to the CIN
261. s Cartesian coordinate system Ninety five percent of this tool functions as introduced in PmacTerminalMotors See the documentation for this tool The difference is that motors selected in Plot Select are displayed in the pseudo real time X Y chart To display 2 Axis data select two motors 40000 Ho Hd a 35000 M e TF a000 TER 25000 20000 au 79 15000 50 10000 25 s000 o 0 l I l l I l l I b4 D AOO0 10000 15000 0000 25000 30000 35000 40000 SY Butter Position Velocity Following Error C 5 Defs Plot Select Kdotor 1 Motor 1 Kotor 2 Motor 2 Kotor 3 Motor 3 Motor 4 Motor 4 hKdotor 5 Motor 5 Motor amp paitan E Kotor ma i Kotor amp otor Disable Menu Track Position v Coord Sys 3 x I CS Units The charting of 2 Axis motion uses a special chart buffer PmacMotorsPlotX YChartBuffer to fool the standard LabVIEW X Y plot control into behaving like a real time chart This is required because LabVIEW s X Y plot does not maintain a history buffer it plots sets of points The slider on the right of the plot specifies the length of the history buffer for PmacMotorsPlotX YChartBuffer Like a standard real time chart 2 Axis position history is displayed like a snake moving around the coordinate space The head is current position and the tail is the last position in the buffer This tool will definitely help in understanding what moves are executing in a 2 Axis system The implementation of the X
262. s OR d with the contents of the field at the specified address thereby setting bits specified by the mask If XOR OR is true the mask is XOR d with the contents of the field at the specified address thereby clearing the bits specified in the mask Device Number 132 0 ppp er Response Available Bool F Set Get Bool F i r Bit Field Value 32 DPR Numernc Spec Cluster ww Bit Field Bool Array XOR AND Bool F PmacDPRNumericClusterExample This example extends the previous example by defining a cluster containing a set of DPR numeric data The purpose of doing this is to hide the addresses inside the VI and get ready for another example that will use a CIN to access the DPR numeric data The example operates the same as the previous one except that a large number of controls for defining the M Variables have been reduced to a single cluster as shown in the panel 400 600 200 00 Input DPR Numeric Cluster al E z 0 1000 0 M444 i32 lt 000 M445 Dbl C M446 XOR OR Mz mas ao a 0 0 30 0 20 0 30 0 Output DPR Numeric Cluster E o0 M444 i32 zi mon 000 M445 Dbl O _ M446 Bit Field 6 2 8 M447 H448 DPR RAW ma M aro jo POM Disabled L Set PQH F Iteration Timer m PLC Enable PLC Disabled J DPR Dual Ported RAM 161 PMAC PanelPRO User Manual The handling of the five VIs in the earlier example diagram is
263. s a menu ring control that works with its VI to query PMAC for a list of currently loaded PLC programs and their execution status Enabled Disabled 74 Development Tools PMAC PanelPRO User Manual In addition a button toggles the Execution State of the selected PLC If the menu ring shows PLC O1 as Enabled use the button to disable it thereby changing the text displayed in the menu ring e PmacPLC PmacPLCExecute I5 controls the general execution of PMAC PLCs Bit 0 controls the execution state of PLC O the foreground PLC and Bit 1 controls the execution state of PLCs 1 31 the background PLCs This control and its VI maintain I5 When the button says Background off the background PLCs are off Clicking on the button toggles them on and it will now indicate Background On Implementation Diagram The diagram for this tool illustrates some important concepts in the development of tools and custom applications Terminal window CharPos fia Visible Terminal windo Dev Open Hini Bi mE r L e oaj ry C S Units nits Prag n cs De fs rogram elect Program Select Coord StatPr es C tl a Ma P Ber Urer er es Term Curr Close Buffers 4 5 A Eue Open ae Bue Buff Space Status Yls execute AFTER the terminal loop is processed Query PMAC for currently addressed motor and CS If they execute concurrently with the loop terminal commands addessing motors and CSs will get out of sync and the
264. s an error a dialog with the log file is displayed Use this button to review the log file whether or not an error was generated Terminal Indicators There are several indicators introduced in previous sections on the panel that display the status of the motor coordinate system and motor motions These are simple rearrangements of the stock clusters The interesting thing about these clusters is that they track the commands entered on the terminal Address Motor 3 by typing 3 on the terminal screen and the motor clusters display the status for motor 3 Address coordinate system 2 by typing amp 2 on the terminal screen and the coordinate system status clusters display the status for coordinate system 2 Terminal Controls The PmacGlobalBufferSize VI is used to monitor and control PMAC s buffer status Sometimes when using a terminal program its not obvious that a download cannot succeed because a buffer was left open or the gather buffer was not deleted The size indicator and the Close Buffer button make it easier to monitor and deal with this problem There are three new control clusters and capabilities used to develop this tool Operationally these VIs are e PmacProgram PmacProgSelect This menu ring control with its VI query PMAC for a list of currently loaded motion programs and display the data in the ring Using it it can be determined what programs are currently loaded in PMAC e PmacPLC PmacPLCSelect This cluster contain
265. s clicked In the top right is a button that will toggle the Execution State of the encapsulated PLC program that sets up and executes a homing operation 106 Homing Encoders and Position Capture PMAC PanelPRO User Manual Le a T F F F r F LS aaa ES a 025 32 00 050 002 32 00 32 00 iela at la Welai ilala i Before going into the individual pieces of this example look at the diagram below As usual the execution loop has several motor ICVs and a standard I Variable architecture The PmacEncoderStat VI and cluster monitor the encoder status bits and PmacHomeComplete monitors the execution of homing moves and retrieves the Home State Cluster At the very bottom is the encapsulated PLC program Sub VI i upe _ PVE F Standard motor stuff Mo tatus Limit Cluste Motor Number Thane es Motor S tor S imi i Ene status flags as Encoder Status Cluster Motor Limit Control Cluster Monitor for home operation OOS and fetch Home State when complete True p maki ome f Home State Cluster H Open Com Confi S ure I Vars E TA EET ileal CTF op E SAA AAAA AAAA AAAA a A hee g f So ee on ee EIF i z3 ae i a Typical iVa Var Cluste 4 rchitecture PIII IAIIIIIIIIIIIIIII III IDI IIIINIAIII III II IID IIPIIIIIIIIIIIIIIIIIIIID I oad Fae gt Use of an encapsulated PLC program for homing Configuring the Position Capture Trigger Earlier position captur
266. s execution on timing can be seen The PQM approach can be used to validate the results of bit field manipulation that are masked by the DPR mechanism The five VIs in the middle handle the transfer of data between the host and PMAC using the same read write architecture used for PmacI Var PmacMemory etc All that is required is the address for DWord or Double memory or a DPR Numeric Spec cluster for field and bit access M444 Address Input Value 132 M445 Address 132 f 5 FIDH i Dutput Value Dbl Input Value 132 utput Yalue Output Yalue 132 DPR Numenc Spec H446 Output Value if SET CLEAR DPR Numeric Spec M447 Bi Boolean Bit Mt OTF Boolean Bit z a T S T PmacDPRNumeric VIs are discussed in two groups The first group covers word double word and floating point DPR M Variables The second group covers the bit and bit field VIs In a later example an approach for grouping collections of DPR M Variables into a cluster that can be handled using a CIN will be demonstrated e PmacDPRNumericDWord This VI is used to set or get PMAC long M Variables defined in DPR as M447 gt DP DE03 PMAC handles the translation of PMAC s representation into Intel format when the DP specification is used When Set Get is false default state Response Available is true and Output Value is the value in DPR located at Offset When Set Get is true Output Value Input Value Response Available is false and the specified
267. s first read from PMAC modified and then rewritten e PmacMemoryWrite Write a 24 bit quantity Input Value to the memory location specified by Address Spec String e g X 002B Pass Input Value to Output Value and Output Boolean Array Device Number 132 0 Men Output Value i32 Address Spec String Write Output Boolean Array Input alue 132 Application Basics 41 PMAC PanelPRO User Manual e PmacMemorySet Write Input Value to a bit field defined by Start Bit and Number of Bits at the specified memory address Output Value and Output Boolean Array are the value of the entire memory location with the new field Device Number 132 0 pave ye kiem Dutput Value i32 t Er Bi 39 Set Output Boolean Array Number of Bits 132 To implement these Vis the following two VIs are used to manipulate the data e PmacMemorySetBit Set Bit Number in Input Value using Bit Value The new word is Output Value Input alue 132 Bit Humber 132 Bit Yalue Bool e PmacMemorySetBits Insert Field Value into Input Value at the field defined by Start Bit and Number of Bits Output Value is Input Value with Field Value inserted Output Boolean Array is the Boolean representation of Output Value Output Value 2 Input alue 132 Outout value i32 Field Value i3 Aee AB Start Bit i32 Bits Output Boolean Array Number of Bits 132 Reading and Writing 48 Bit Memory Data Double word 48 bit memory data is handled differently than s
268. s green and says In Position when the motor is in position the bit is true Imagine a situation where motor not in position means its moving therefore the program is running and that is good e Home in Progress This is gray when there is no Home in Progress This does not mean that the motor has been homed When the motor is homing the indicator is green It may well be that this should be red when the motor is homing PmacTutor9 Motor I Variable Configuration In PmacTutor6 the general architecture for developing supervisory VIs for modifying individual I Variables was introduced In this exercise four VIs to encapsulate the most common motor I Variables are introduced This type of hierarchical I Variable architecture is used throughout PMAC Panel Pro e PmacMotorlVarPID Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the PID I Variables for the specified Motor Number are set Otherwise they are fetched from PMAC and provided by Output Motor I PID Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 132 0 E S data Her Output B ool F Motor Number 132 1 oml o Set Get Bool F Output Motor 1 PID Cluster Input Motor I PID Cluster e PmacMotorlVarMove Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the movement I Variables for the specified Motor Number are set Otherwise they are fet
269. s sent when the button is TRUE It is important that the Mechanical Action is set to Latch When Pressed or some other action that resets the state when read Dey Open The mechanical action of Send Latched requests Motor 1 s position H p as long as the switch is active The response is fetched as a string and converted to a double for computation or display i by reading the numeric value from the response string The second step in the diagram sends the command 1p to PMAC requesting the position for motor 1 as long as the button is true The response string is displayed both as a string and converted into a numerical value for display When sending any motor or coordinate system specific command to PMAC include the motor or coordinate system number with the command to prevent LabVIEW s execution order from sending addresses and commands in whatever order it desires PmacTutor4 Button and Response VIs The PmacResponse VIs send commands to PMAC and convert the ASCII response string into LabVIEW numeric data types String conversion VIs are not scattered all over the application There are more members in the PmacButton collection introduced in PmacTutor3 that use the PmacResponse VIs to convert ASCII string responses into numeric data PmacResponse PmacResponse consists of six VIs one for each type of numeric response conversion supported If there is a data type that must be supported add it by copying and modifying one of th
270. s to generate global commands for PLC and program control During development use the Abort All Motion button The Save Reset and Reinitialize buttons allow PMAC s configuration to be saved to its onboard battery backed RAM or flash memory This way PMAC will always boot with the proper program and configuration information for the application The two status indicator clusters might be useful during development as will the ability to monitor PMAC s available buffer space The two I Variable clusters are useful when configuring communication or require specific program execution characteristics For example later exercises execute multi axis motion using circular interpolation This requires 13 gt 0 Global Control Gather Status Buffer Status Start All Quit All Gather T Enable All Abort All Gather Start Disable All Kill All Reinitialize Gather Start No PLC PLE Motors MAC On Trigger Buffer Open Yo No PLC Close Buffers Me gpen CMD Executing Available Buffer Space CS No Card addr Ww i2 Serial Port Mode lt LF gt lt CR gt lt ACK gt w i3 Comm Handshake Mode Checksum EOL v i4 Comm Integrity Mode lt BELL gt lt CR gt ERR v i6 Error Reporting Mode ster Oran puter Open F 0 i11 Programmed Move Calc Time mS F 0 i12 Jog to Position Calc Time mS 0 i13 Programmed Move Segment Time mS O 114 Auto Position Match on Run Ix22 ma i50 Rapid Move Mode Long Hex l ar v i9 Program Listin
271. s value due to the sub count interpolation used internally by PMAC to compute motor position If the Encoder Counts button in the Jog cluster is clicked the PVE cluster and the Xformed Encoder Pos indicator will both display motor position in CS units Again the accuracy is subject to the interpolation performed by PMAC for its own internal use The transformation in both cases is implemented by combining PmacEncoderOffset and PmacCoordMotorToCoord to build the following VI that converts a raw encoder position either Capture or Compare to motor position or CS units Usually this VI is used to convert a captured encoder position into motor position or CS units e PmacEncoderToCoord This VI converts Input Value Servo Position or Capture Position from absolute encoder position to either CS units or motor position in encoder counts Coord Specify Cluster specifies a motor within a CS and an attempt to convert Input Value from encoder position to CS units If the motor is not defined in the CS Output Value is motor position in encoder counts If the motor is defined and Convert is true Coord Defined is true and Output Value is in CS units Coord Definition is a string specifying Output Value units as Encoder or the CS definition of the motor Device Number 132 0 be Coord Defined Bool Coord Specify Cluster Output Value Double Capture Offset Bool F Coord Definition String Input Yalue Double To use this
272. s will be readily duplicated Some applications require a slightly different architecture than that presented here If so modify the existing CINs to suit any particular needs Required Background Understanding Before reading this material there must be some familiarity with PMAC s DPR capabilities This can be found in the PMAC User Manual PMAC Software Reference Manual and PMAC Dual Ported RAM manual The architecture of the CINs to support the VIs is influenced by the PComm 32 Pro DPR API so having that manual available is also necessary In particular the section on PComm 32 Pro DPR Features should be read before proceeding DPR Dual Ported RAM 141 PMAC PanelPRO User Manual General Architecture Notes PMAC Panel Pro s DPR support is designed to be simple and extensible There is not a lot of error checking The basic assumption is that there is a DPR card with the PMAC PMAC DPR does not check automatically for this nor does it enable or disable itself automatically As the examples are inspected note that each mechanism has a configuration VI As applications are developed move these into the PmacDevOpen VI so that opening PMAC also enables DPR PmacDPRRealTime PMAC s Real Time data buffer mechanism automatically copies 27 selected Motor Calculation Registers from their native PMAC locations to DPR locations at a specified servo cycle sample rate PComm 32 Pro supplies a set of routines to read these values from DPR and conv
273. se the Vector VIs and reload them so that the buffer management can be reinitialized Otherwise it is probable that buffer bookkeeping will become garbled and strange things will happen A Note about Vector CIN Reentrancy Many of the PmacDPR VIs that use CINs are reentrant If there are two Vector VIs buffering servo data for the same motor there will be strange results Sometimes one of the VIs will update the BufferCount and sometimes the other VI will update the count Eventually one of the two VIs completes the acquisition and gets the vector data leaving the other one without an acquisition Generally this is a mistake in the application logic and can be remedied by handling the distribution of the acquired vectors in your diagram Use one Vector VI per motor thereby guaranteeing no need for mutexs to control access to the temporary data buffers PmacDPRFixedBack PMAC s Fixed Background data buffer mechanism automatically copies 34 selected Motor Calculation Registers Coordinate System Control Registers and Program Execution Registers from their native PMAC locations to DPR locations when requested Whereas the Fixed Real Time data buffer is motor specific the Fixed Background data is Motor and CS specific therefore program specific PComm 32 Pro supplies a set of routines to read these from DPR and convert them into legitimate Intel formats This process hides the required handshaking between PMAC and the host to avoid collisions when ac
274. ser Manual This panel captured while actually running demonstrates how useful these new capabilities are The jog control indicates a move to a position of 23 4 defined in Coordinate Units not motor encoder counts The PVE indicator has an orange LED indicating that the displayed position velocity and following errors are in CS units Furthermore because the Coord System dial is set to 1 motor 1 is defined as 1 gt 1000X in CS 1 The status indicators show that Motor 1 is assigned to a CS enabled and in closed loop mode Furthermore that it is Not In Position and there is a Warning Following Error Note that the position in the Jog Control is specified as 23 4 CS Units and the PVE indicator shows an actual position of 24 6 CS Units If actually running this exercise turn on Help by selecting Help Show Help As the cursor moves over the various indicator and control items in the clusters detailed help for each panel item is displayed The diagram for this panel is simple because PMAC Panel Pro handles all the details There are two control clusters one PVE cluster and two status clusters each with its associated function VI Add two dials and a Jog application has been created Note that the Coord Specify Cluster required by PmacMotorPVE is constructed by PmacMotorJog Dey Open Motor me EH pao PE Motor EVE E RECEM e Motor Jog Control Noose Motor Jog Stat Motor paT Motor Motor Limit Control Limits LEE a gt
275. sive terminal descriptions and their behavior are available with LabVIEW s Help Show Help facility and in the VI Reference chapter of the manual To help utilize the on line help associated with PMAC Panel Pro Vis there are terminal naming conventions to identify the name type default value and range of inputs and outputs Most input terminals have a default value Those that have a range coerce inputs to the range Most inputs are required A few are recommended Their default action is fully defined Typically cluster inputs and outputs are named for the wire type expected The following VI icon demonstrates these standards Range if any inserted here e g 1 8 Required Terminal Default Value Pw mk Device Number 132 0 Input PLC Exec Cluster First Time Bool F fiietarenceeuans Mer Output Bool F ans Output PLC Exec Cluster A Recommended Terminal PMACpPanel Datatype LabVIEW Datatype PMAC Panel Pro Tutorials If the basic ideas covered in the previous section are understood start developing PMAC Panel Pro applications The remainder of this section contains exercises that start with opening communication with PMAC and work up to the development of some very sophisticated capabilities The contents of these tutorials are necessary for all PMAC Panel Pro developers The on line Windows Help version of this document is a great way to display the contents of the tutorials and examples from within LabVIEW 26 A
276. sourcing current from the pins to ground to permit motion in their direction The direction sense of LIMn and LIMn is the opposite of what many people would consider intuitive That is LIMn should be placed at the negative end of travel and LIMn should be placed at the positive end of travel Fault Flag This flag takes a signal from the amplifier so PMAC knows when the amplifier is having problems and can shut down action The polarity is programmable with I Variable x25 1125 for motor 1 and the return signal is analog ground AGND FAULT is pin 49 With the default setup this signal must actively be pulled low for a fault condition In this setup if nothing is wired into this input PMAC will consider the motor not to be in a fault condition As the homing move proceeds and triggers the physical switch the encoder will signal this using these status bits When the configured position capture trigger condition occurs the Position Capture bit will become true Home Position Transformations Monitoring the homing operation is done in PMAC firmware When the home move completes the motor s zero position and its corresponding encoder s zero position will probably not match PmacHomeComplete monitors the home operation and reports a number of I Variables and memory registers that both demonstrate what is going on and are used for capture and compare equal operations in the next chapter e PmacHomeComplete Create a PmacHomeSta
277. t Actual Position for motor 1 42 Application Basics PMAC PanelPRO User Manual T FFC2 Machine Input S4444444 Bits 0 7 in this word 0 00 Output alue i32 Copy these machine input bits to th hi tput Doo z y bits aa Booo Output Hi Word 132 Bits 8 15 in this word 0 Output Lo Word i32 L 002b gt Present Actual Postion T FFC2 MachineOutput The diagram for this exercise demonstrates how the lower eight bits of Y FFC2 are written to the same memory location eight bits higher r Read lower 8 bits FFC rite them bits higher ey Open e lfc contains FFC2 blem a Yarnety of info that OW Get Pe Lite pHs is found on PMAC J5 B FFC MachineOutput FFC 2 Machine Input L Output Value i32 ECE ual i321 Output Hi Word i3 32 Output Lo Word i32 SEE L 002b ts the scaled present actual position for motor 1 Get the double value i and its lo hi integer representation PMAC Panel Pro ICVs The previous set of exercises introduced PMAC Panel Pro s Device Communication and Query Response interfaces to PMAC They handle the details of sending commands and requests to PMAC and converting basic responses into LabVIEW data formats The exercises in this section introduce another level of PMAC Panel Pro capabilities that provide indicators controls and VIs for many of PMAC s most common on line commands e Handle queries for motor coordinate syste
278. t Get is true the global communication I Variables are set Otherwise they are fetched from PMAC and provided by Output Global I Comm Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 132 0 _ _ New Output Bool IF Deget Bool F AT Input Global l Comm Cluster Output Global l omm Cluster e PmacGloballVarMove Follow PMAC Panel Pro s standard I Variable VI architecture When Set Get is true the global movement Il Variables are set Otherwise they are fetched from PMAC and provided by Output Global I Move Cluster with New Output true Set Get is not required and defaults to a Get operation Device Number 132 0 ____ New Output Bool F Set iGet Bool F anan Input Global l Move Cluster ermmm Output Global I Move Cluster e PmacGlobalStatBuffer Create a status indicator cluster for the PmacGlobalStatBuffer indicator containing PMAC s global buffer status piinasi Command Executed Bool F Device Humber 132 0 ee SOC Global Butter Status Cluster 58 Application Basics PMAC PanelPRO User Manual e PmacGlobalStatGather Create a status indicator cluster for the PmacGlobalStatGather indicator containing PMAC s global gather status Device Number 132 0 a Peene Global Gather Status Cluster The panel for this exercise is the basis for one of PMAC Panel Pro s terminal tools At the top is the PmacGlobalControl cluster Use thi
279. t and reads a record from the specified data log file The array is passed to the encapsulated motion program VI along with a true Boolean The wrapper VI will down load the variables to PMAC and start the program If PmacFileDatalog has new PQM array data because it read the data from a datalog file or simply passed the input array through the PQM clusters are updated with the PQM array This is done by the two case structures in the lower right of the diagram that convert the array items to appropriate types unbundle them and sets the local variables for the clusters on the panel If this is the first execution of the VI the shift register will query PMAC for the current P Q M Variables and update the clusters This example program indicates its location in the program by setting bits of a standard memory mapped machine output The output is monitored by PmacAccMachineOutput8 and used to drive an indicator on the panel The VIs and indicators in the upper right display the coordinate system definitions and motor position The coordinate system number for the VIs is obtained from the encapsulated motion program VI PmacTestExamp Development of the interactive application framework can get involved This section discusses one framework for controlling and configuring multiple motion programs The example PmacTestExamp located in the PmacTest directory has four encapsulated motion programs e PmacTestPQM1 pmc in CS 1 e PmacTestPQM2 pmc in
280. t to PMAC are generated from the panel e Feed Hold Bring the coordinate system velocity to zero thereby holding moves where they are Jog cannot be done from this mode Restart the program with RUN or STEP The command sent to PMAC is H e Abort Decelerate all motors immediately Restart the program with RUN or STEP The command sent to PMAC is A See the safety notes for the command in the PMAC Software Reference Manual e Halt Q Quit the program at the end of the current move or any already calculated moves Restart the program with RUN or STEP The command sent to PMAC is Q e Halt Quit the program at the end of the currently executing move Restart the program with RUN or STEP The command sent to PMAC is PmacTerminalMotors This tool is based on PmacTutor10 that introduced the PmacMotors ICVs Its purpose is to monitor selected motor motions from the terminal The arrays of indicators function as introduced in the earlier tutorial Select a coordinate system and enable CS conversion for motors defined in the specified coordinate system Motors selected in Plot Select are displayed in the real time chart The sampling rate is not uniform It is a best effort attempt to query as fast as possible For uniform sampling use PmacTerminalGather Motor positions velocities or following errors can be displayed The chart control palette allows panning and zooming of the display Use the Free Run Pause button to pause the c
281. talog Display at the end of the file Update the Current Record and Num Records in Output Datalog Display Cluster Indicate the new data by setting new Datalog Display true Append Record Bool pigg New Datalog Display Bool F Input Datalog Display Cluster 4 Output Datalog Display Cluster Input POH Yariant Array e PmacFileDatalogRead When Read Record is true read Output PQM Variant Array from the file specified in Input Datalog Display using Current Record Update the increment Current Record in Output Datalog Display Cluster and display the Note if any stored with the record Indicate the new data by setting new Datalog Display true Head Record Bool Input Datalog Display Cluster New Record Bool F Output Datalog Display Cluster z Qutout POM Yarnant Array e PmacFileDatalogCreate Create or Open an existing datalog file to store data of type Input PQM Variant Array along with notes When Create Open is true use the path in Input Datalog Cluster If this path is empty or Not a Path is displayed display a file selection dialog When a file name is entered or an existing file is selected the number of records in the file is determined All updated information is available in Output Datalog Display Cluster and indicated by New Datalog Display true ae haber aul et ee New Datalog Display Bool F nput Datalog Display Cluster i Input PQM Variant Array Creat Output Datalog Display Cluster Encapsulated Mot
282. teCluster containing I Variables and memory registers for the specified Motor Encoder number The VI monitors the Home In Progress Home Complete and Desired Velocity Zero status bits for the motor to determine when to query PMAC for the required data A query can also be forced if Capture Home State is true This assumes Motor N uses Encoder N Device Humber 132 0 HMotor Encoder Number 132 Capture Home State Bool F The contents of the Home State Cluster are discussed in detail here Again if developing PMAC Panel Pro application that uses PMAC s capture or compare equal capabilities these quantities must be understood Home Complete Bool F Home State Cluster e PmacHomeState Homing Encoders and Position Capture 111 PMAC PanelPRO User Manual Home State Cluster o Present Encoder Position OxCO02 i32 ooo Present Commanded Motor Position 0x0029 Dbl ooo Present Actual Motor Position 0x0026 Dbl o Encoder Home Position Offset 0x0815 i32 O _ Motor Pos Bias 00813 i32 Co Position Scaling Factor 1x06 132 o Motor Home Offset 1x26 132 Present Encoder Position 0xC002 132 The encoder Servo position register is 2 Encoder counts with the LSB the direction bit This output value is an actual encoder position referenced to a power up reset position of zero Present Commanded Motor Position 0x0028 Dbl This is the motor s present commanded position in units of 1 32 Ix08 encoder counts refer
283. tem is specified by the comment line USE CS 43 The down load compilation process ignores comments so this does not affect normal PMAC operation The comment can be any mix of upper and lower case For safety always use capital letters The program number is parsed from the line open prog 10 Again this can be a mix of upper and lower case When the program is down loaded a cluster indicating the coordinate system to use program number and Load State is created Program Vl State Cluster g Program Loaded T Program Number 132 T Coord Number i32 This cluster is used by a number of PmacProgram VIs to do useful things 78 Development Tools PMAC PanelPRO User Manual The diagram for the tool has a standard organization Note the use of PmacProgParse to parse the program window and generate the Program State cluster This cluster is hidden on the panel and not used in the tool 3 Subyll Creatd Create PLC I Term Menu Sare program PLC G withthe proper name qj LTE E Encapsulating Motion Programs The Create Prog VI and Create PLC VI case structures at the bottom pass the program buffer to a very special VI that creates a VI wrapper for the program being edited The detailed use of the new motion or PLC program VIs will be covered in later sections e PmacProgSubVICreate Prompts for a file to save the Program Buffer to Make a copy of PmacProgSubVI VI and change
284. tenon from the ASCII response string into the Lab iew numeric Send Latched PmacTutor5 Accessing PMAC Status PmacTutor4 demonstrated the conversion of PMAC responses into numerical LabVIEW data types Several responses require conversions that are more sophisticated PMAC status is returned as twelve hexadecimal characters for a total of two 24 bit status words Because status is critical to successful integration of PMAC with the LabVIEW application there are three VIs that request status and convert it into two unsigned integers and two 24 element Boolean arrays The Boolean array representations allows selection of individual status bits for custom use using LabVIEW index VIs The unsigned integers can be used for individual bit manipulation and testing using logical operators These VIs are e PmacMotor PmacMotorStat Query PMAC for the status of Motor Number Report the two status words as arrays of Booleans and unsigned 32 bit integers Device Number i3 0 Kator First Word 24 Element Bool First Word Binary Status udz Motor Number 132 1 8 1 se Second Word 24 Element Bool Second Word Binary Status we e PmacCoord PmacCoordStat Query PMAC for the status of the CS specified by Coord Number Report the two status words as arrays of Booleans and unsigned 32 bit integers Device Number i32 0 Coord First Word 24 Element Bool First Word Binary Status uz Coord Number 132 1 8 1 ss Second Word 24
285. terval generation done by the PLCs using PMAC Panel Pro This works only when the interval rate is long relative to LabVIEW s service rate If an interval is missed and the motor is already beyond the next interval position the compare condition never occurs and pulses do not generate If the PmacPosCompGen PLC 1s disabled and the software Compare Interval box is checked the trigger is handled by the 3 input AND case Be careful not to enable the PLCs by changing P101 before getting the software version of the interval generation running 124 Encoder Capture and Compare Operation PMAC PanelPRO User Manual PmacEncoder Registers Incorporating compare and capture capabilities into the on applications is facilitated by the PmacEncoder collection of ICVs These fall into three categories Basic encoder register access and control conversion of encoder positions into motor position or CS units and back and ICVs to facilitate the application Encoder Register Access VIs to access the encoder registers are provided but generally are not used in the applications They are however useful when beginning to work with the encoders The most important of these are e PmacEncoderRegStat Fetch the encoder control status word for Encoder Number and parse it into its pieces Encoder Status Control 132 is the integer representation of the register Position Capture Control can be used with PmacEncoderCaptureControl Capture Flag Control can be used with
286. the Y Axis To plot one or more motors click the appropriate radio button The colors for the plots and the legend are updated automatically These predefined clusters display motor states using the same standards as PmacMotorP E The legend and plot colors are configured by PmacMotorsPlotSelect Position C S Defs Motor 1 Motor 2 Motor 3 Motor 4 Motor 5 Motor 6 Motor 7 Motor 8 Motors PYE Cluster 56 Pmac Motors Chart 80 0 Motor 1 60 0 Motor 2 40 0 Motor 3 20 0 Motor 4 0 0 20 0 40 0 Motor 1 Motor 2 Motor 3 Motor 4 Motor 5 Motor 6 Motor 7 Motor 8 80 0 5 1279 Fee Motor 2 v Jog Relative C JogTo Make Pre Jog _ComdSys2_v Menu rings instead of K r 3 l numeric controls 00 10 20 30 40 50 60 70 80 90 10 0 i Encoder Counts MEE 1300 1320 1340 1360 1378 Application Basics PMAC PanelPRO User Manual Use the motor and CS menu rings to select motors to jog and coordinate systems to convert positions to CS units If there are motion programs running on PMAC while this VI is executing the position data plotted and displayed by this example will be from those motion programs In either case motor positions are displayed in real time in the PmacMotorsPVE cluster and the strip chart To implement this exercise PmacMotorJogControl and PmacMotorsPositions are used The CS definitions are retrieved using PmacCoordDef covered in
287. the menu Copy the ttems from the case above and and paste them into your new case Change the name of the YI to run when the item Checking for menu selections consumes alot of Lab VIEW s time The counter and conditional limit the checking to once every 32 calls You can change this In your own application if desired There are a few limitations associated with using LabVIEW s menubar capabilities The main one is that it slows applications noticeably that are doing highspeed query response updates of status and position indicators To remedy this the PmacTerminalMenu VI is configured to execute the actual checking of the menu selection once every 32 calls This logic can be changed or add timers to suit individual needs Basic Tool VI Requirements PMAC Panel Pro s use of the menu bar selection VIs spawns the VI specified by the selection as a separate concurrently executing task This means the VI should be organized much like the exercises Open PMAC run a while loop use the Stop button The diagram for PmacTerminalJog is shown here to illustrate this Dev Open fg Motor E ED ies LinnSit Motor el Fae Coord Number JogSt Hotor State Motor Control Lil aE The only modification is the addition of the PmacTerminalMenu VI that actually spawns the new VI in response to a menu selection and the Current VIs Menu function selected for the function palette e PmacTerminalMenu This VI uses the Current VI Menu suppli
288. this architecture eliminates many case structures and allows adding or deleting commands as required Using PmacMotorJogControl and its cluster with PmacMotorPVE and its cluster motor jogging and position monitoring can be added quickly on any panel 48 Application Basics PMAC PanelPRO User Manual Control Clusters and Local Variables It has already been noted that clusters should contain either indicators or controls but not both When a VI reads the state of a latched Boolean control the control is reset Hence if there were two users of the Boolean state the second one to read the state would get the wrong answer A corollary to this rule is that not to use local variable copies of control clusters that contain latched Boolean controls PmacTutor s Motor Control with Status Monitoring This exercise introduces another PmacMotor control and several indicator clusters for displaying motor status As with the PmacMotorJogControl status clusters require an associated VI to query PMAC for the required information and assemble it into a useful form This is the first exercise to actually generate an application that can be used to exercise PMAC The panel contains PmacMotorJogControl and PmacMotorPVE already introduced In addition there is a PmacMotorLimitControl and two new status clusters The VIs for the new panel are e PmacMotorLimitControl Generate PMAC on line commands for controlling move limits and operation for Motor Numb
289. tilities Interfaces PmacButton ICVs Indicators PmacSetup Device Management PmacDevice Controls Pmacutility and Communication PmacComm Vis PmacDocument PmaclVar PmacMemory PComm32 PMAC Within each category are several sub directories containing collections of indicators controls and VIs ICVs that provide capabilities to make the application development task easier The VIs in each sub directory follow a naming convention that makes them easier to locate For example in the directory PmacCoord all VIs are named PmacCoord The names of VIs in a given sub directory may have shortened names to make them a little easier to fit on the screens e g VIs in PmacResponse are shortened to PmacResp The collections of VIs in each category implement most commonly used capabilities and generally have examples to demonstrate their use The examples will have the word Examp or Example at the end of their name The remaining sections cover numerous tutorial exercises and examples to demonstrate their use PMACPanelPRO Basics 15 PMAC PanelPRO User Manual Device Management and Communication At the lowest level of the architecture is VIs that configures and manages PMAC Panel Pro communication with PMAC using PComm 32 Pro PmacDevice Configure and manage access to PMAC using PComm 32 Pro Configuration of this access must match the driver configuration set using the control panel applet or MotionExe application PmacComm Pro
290. tion Application Basics 45 PMAC PanelPRO User Manual It is defined as Coord Specify Cluster Cluster defining the motor CS and conversion state to be applied Coord Number 132 1 8 1 Coordinate number to use Motor Number 132 1 8 1 Motor Number to use Convert Bool Apply a conversion for the specified motor in the specified CS The VIs are e PmacMotorPosition Query PMAC for Motor Number s position PMAC reports the value of the actual position register plus the position bias register plus the compensation correction register and if bit 16 of Ix05 is 1 handwheel offset mode minus the master position register Coord Specify Cluster specifies a motor within a CS and an attempt to convert motor position from encoder counts to CS units If the motor is not defined in the CS no conversion is applied If the motor is defined and Convert is true Coord Defined is true and position is scaled from encoder counts to CS units Coord Definition is a string specifying position units as Encoder or the CS definition of the motor Device Number 132 0 Coord Specify Cluster Coord Defined Bool Position Double Coord Definition String e PmacMotorVelocity Query PMAC for Motor Number s present actual motor velocity scaled in counts servo cycle rounded to the nearest tenth The raw response reports the contents of the motor actual velocity register divided by Ix09 32 This is converted to counts msec by multiplying by 8 388 60
291. tion from a 24 bit encoder register pointed to by Ix03 and extends it in software to a 48 bit register for the actual motor position In the process of extension it multiplies the encoder value by the position scale factor Ix08 Because the register in the encoder conversion table is in units of 1 32 of a count the actual motor position register is in units of 1 x08 32 of a count The extended motor position registers are set to zero on power up and reset unless there is an absolute position sensor and again at the end of a homing search move The encoder position registers are set to zero on power up and reset only Therefore after a motor is homed there is an offset between a motor s zero position and its encoder s zero position Try to understand this offset because the encoder registers are used for position capture and compare not the motor registers Depending on the mechanical configuration the rollover of encoder registers must be handled if they will be traveling more than the 8 million counts supported by the 24 bit encoder register The modulo operator is useful for this For more details refer to Synchronizing PMAC to External Events in the PMAC User Manual Input Encoder Encoder Motor Axis Signal Position Position Position Position Quadrature Capture Position Mx03 Act Pos Cmd Target Pos Move End Pos Parallel Compare Position Mx03 P Mx62 Mx61 Mx63 Mx65 Analog Phase Position Mx01 et
292. tom Gather Specification cluster that allows the entering of a description address and scale factor Clicking its associated gt button adds this item to the selection list Be aware that the PComm 32 Pro library requires addresses to be specified as X S kKkKK Y S AK K DP S x To write the gathered data to a spreadsheet file click the Write Spreadsheet radio button before executing the gather To actually gather the data click Step or Program Step executes a 250 mS step to 1000 counts and back to 0 counts using the motor specified in the menu ring used to setup the gather Program executes the encapsulated motion program wired into the diagram During the gather the Gathering indicator is green After the gather the data is plotted and the indicator turns gray If Write Spreadsheet was selected the system will prompt for a file name The diagram for implementing this tool is a great source of ideas for building gathering into applications Being a full application tool it requires a bit more work and it is not as bad as it looks Outside the execution loop all motor servo loops are closed by PmacMotorsCloseLoop To exit the loop the Stop button first sends a delete gather command to PMAC to free the buffer space Buffer space is monitored using PmacGlobalBuffers and an indicator How a Gather Selection list is built is outlined in the next section hannan Addr k z za _ _ _ oH Motore Strings Gather Variable Ho
293. tors and PmacTerminalMotorsXY tools the plot attributes can be modified prior to running the tool to accommodate an expected scale PMAC Panel Pro has utilities to set the legend and plot colors to reflect the gather selections One issue to consider when gathering data is that the gathered variables can and will as in the sample panel have widely varying ranges Choose to stack the plots if necessary 1000 0 1 Present Actual Positi 900 0 1 Present Desired Pos 1 Actual Velocity 600 0 400 0 200 0 0 0 a IER e a a 200 250 300 350 400 450 500 55 g oy 150 Wet 0 600 650 1 Present Actual Position _____ DAC Command Value w Command Value 1 Present Desired Position Select New File _ New File Select New File_ Write Spreadsheet 1 Actual Yelocity _ Motor CS1 w 1 P Yariable E e Custom Gather Specification _ a j me Custom Gather 1 Y C003 1 0000 Remove _ E Ea aL To select Address Items use the controls contained in the PmacGatherSelect cluster on the bottom left PMAC allows selection of up to 24 Address Items The following section covers methods for extending the PmacAddress selection VIs The PmacGatherSelect VI builds an array of Address Items containing a string description an address and a scale factor using the interactive commands from the panel cluster e PmacGatherSelect Maintains a PmacGatherSelect Cluster and builds a PmacGatherSpec cluster to define gather o
294. trol the motion and coordinate control of those devices with the execution of the motion PMACPanel D for Service Indicators Controls and VIs p Other LabVIEW and a Digital Applications Utilites and Drivers Triggers J evview caras LabVIEW Cards Client Application The figure below illustrates a set of Query Response exchanges between the PMAC Panel Pro client application and PMAC Commands for service are sent by the application in response to e Button clicks e Events such as measurements made by other instruments e Polling requirements In response to these requests PMAC responds with the requested operation or data Because of this architecture everything PMAC does is under control of and in coordination with client applications Get Position Motor 1 SS 138645 Display Position Run Program 32 in Cycle Start Coordinate System amp 3 Button Clicked Get Coordinate System amp 3 Status Update Status Running In Position PMAC Get Program 34 Program Counter Update Program Window E P34 23 X5Y30 Get Machine Input X 0034 If Input 00110101110010 oe Start GPIB Acquisition Ee Client Application 00110101110011 PMACPanelPRO Basics Il PMAC PanelPRO User Manual Application Development Components Depending on the motion requirements system integration requirements and performance needs there are three metho
295. ts Technical Support with any questions prior to proceeding External PMAC Signals PMAC provides a number of hardware interfaces that can be used easily to synchronize PMAC with most NI DAQ boards and systems Depending on individual needs PMAC also supports a number of I O accessories PMAC Panel Pro does not support all of these with ICVs It is way beyond the scope of this manual to detail all possible approaches to accessing the interfaces on these boards Custom ICVs can be created easily for these accessories using PmacAcc and PmacMemory ICVs Three primary PMAC signals will be outlined here Position Capture was discussed in a previous section and will not be repeated here When interfacing these signals to DAQ boards it will be demonstrated how to use these signals to trigger acquisitions and provide the sample scan clock Before actually using these hardware signals consult the PMAC User Manual and the hardware manual for the particular PMAC model The signals are EQU signals Servo Clock General Purpose Machine I O Position Capture Flags PMAC s encoder clock or ADC clocks will not be considered To use these consult the PMAC User Manual the hardware manual for the particular PMAC model or contact Delta Tau Technical Support The following sections are reproduced from various portions of the PMAC User Manual and describe the signals how to access them and potential limitations in their use Compare Equals Outputs JEQU
296. ts that could cause harm to the controller by damaging components or causing electrical shorts When our products are used in an industrial environment install them into an industrial electrical cabinet or industrial PC to protect them from excessive or corrosive moisture abnormal ambient temperatures and conductive materials If Delta Tau Data Systems Inc products are exposed to hazardous or conductive materials and or environments we cannot guarantee their operation PMAC PanelPRO User Manual Table of Contents INERODUC ON gasses ta ascent cca c cote Fastening es cca vas ceca es cnet seseuatsaseveccesvszscessvevesseuenseuesezsuenesas teeeves 1 IV VA Ay OUI ies eapeaawadeettansateecncanicebentabnd E A E E E seamadunsatasderanenossteanenstenuavantes l Use Caution When Running the Examples csssseeeeeeeeecccccesscccesssssscssesceeeececceccecsseceeessssseeseeseeceeessneeeeaaseess l AM EM h E E A E EA l MOO O S e E N T TA AER E AS 1 Keep Away from Live Circuits cccccccccccccccccccnenssseccccccnaassssecceccaaaassseecceesaaaasseeecessaaauanssseeeeeesaaaaseecesauananeeeeeessaagaaasgss I Live Circuit Contact Procedure 1s sisesan asaseassasnigcieionet auacaneeauataais eiatasisobacoass indebida norai disit doacaneaeaaneaank aacasiecnce 2 Electrostatic Sensitive Devices ance 2ssccscecesesnscanatanieainraans Joscassecwsedass qoaeannGghepoaet dasaansaaauasacs pianooiaasdasuaeaneaaaneseh eiatasceanid 2 Hardware TUE OCOS aisre ienna iin
297. tter sourcing drivers by replacing this chip in U54 with a UDN2981A driver IC and changing jumpers E101 and E102 PMAC STD On PMAC STD these signals are brought out on connector J6 JEQU on each of the piggyback boards They are open collector sinking outputs with internal 1 k pull up resistors rated to 5V On PMAC STDL1 5 these signals are brought out on connector J8 JEQU optically isolated from the digital circuitry and either referenced to analog ground AGND or an external flag supply ground As shipped from the factory they are open collector sinking outputs with a ULN2803A driver IC rated to 24V and 100mA each They may be changed to open emitter sourcing drivers by replacing this chip in U54 with a UDN2981A driver IC and changing jumpers E101 and E102 Servo Clock JRS232 PMAC s servo clock defines the rate at which servo loops are updated and background computations are performed Using this clock for other timing is an excellent way to synchronize PMAC s movement with externally gathered data PMAC allows multiple cards to share a common servo clock over spare lines on the serial connector J4 The servo clock on J4 JRS232 is located on pin 8 and is referenced to ground on pin 9 If multiple PMACs are being used the clock signals can be shared simply by tying identical pins on the PMACs together Acc 3D or 3L cables with extra PMAC connectors one Acc 3E for each extra PMAC can be used to share the clock signals
298. tus VIs For completeness PMAC Panel Pro provides indicator VI pairs to monitor all bits in both motor status words Copy the individual cluster items into custom clusters to avoid creating them from scratch Each cluster LED has been carefully constructed to include detailed help labeling and Boolean text The icons along with the panel clusters are e PmacMotorStatl Create a status indicator cluster for the PmacMotorStatl indicator containing the status for Motor Number Device Number i32 0 Motor Motor Number i32 1 8 1 Gtat Motor Status Word 1 Cluster Motor Status Yord 1 Cluster do Ho Phase Running Block Internal Internal Commutation Dwell Request Use Use eee ert Data Block Home In Internal Internal Error Progress Use Use Positive Running Desired Internal Internal Internal Limit Exceeded Hove Velocity ero Use Use Use Hand heel Integration Abort Internal Internal Internal Enabled Hode Deceleration Use Use Use e PmacMotorStat2 Create a status indicator cluster for the PmacMotorStat2 indicator containing the status for Motor Number Hegative Limit Exceeded cil Device Number 132 0 hl otor Motor Number i32 1 8 1 Te e Motor Statue Word 2 Application Basics 51 PMAC PanelPRO User Manual Motor Status Word 2 Cluster Not Acsioned Reseed Reserved am Tyger ee 3 ae E Reserved Disa gare ee eos NG Reserved Reserved Heserved ae aha Soh ne TCS Reserved
299. u should not we did not mix indicators and controls in clusters The numeric control is used tied to the slider control and specifies where to Jog To or how much to Jog Relative Encoder Counts tells the control s YI whether to interpret this value in encoder counts or C S units This cluster displays a motor s position velocity and following error It s associated VI requests and packages all three for display in this cluster The bottom LED is orange eo Encoder when the display is in C S units Application Basics 47 PMAC PanelPRO User Manual Generating On Line Jog Commands The front panel contains a cluster of controls defined by PmacMotorJogControl to group the most commonly used jog operations into a single panel item This cluster must be used with its associated function VI to generate jog commands for PMAC e PmacMotorJogControl Generate PMAC on line commands for controlling jogging Motor Number Command Executed Bool is true when any button is clicked in Motor Jog Cluster The value in the numeric control specifies the position Jog To and Jog Relative jog the motor to This value is interpreted as either Encoder Counts Default or Coordinate Units in Coord Number as specified on the button The button state is provided as the output Convert to Coordinate This VI builds a Coord Specify Cluster using the various inputs to simplify the interface to PmacMotorPVE and other PMAC Panel Pro ICVs
300. ual 140 PComm32 Code Interface Nodes PMAC PanelPRO User Manual DPR DUAL PORTED RAM Every collection of VIs presented so far uses ASCH command strings to communicate between PMAC and the host This is independent of whether the actual transfer between the host and PMAC takes place over a Serial port the bus or DPR The parsing formatting handling and interpretation of the commands is responsible for most of the time required for communication even communication that takes place using dual ported RAM DPR Dual ported RAM provides seven other mechanisms for the transfer of limited and specific sets of numeric data between the host and PMAC that requires far less handling This results in much faster transfers that may be advantageous in an application These mechanisms are e Fixed Real Time Data Buffer Automatic copying of limited servo data to the host at a specified servo rate e Fixed background Data Buffer Automatic copying of limited motion program data to the host on an as requested basis e Variable Background Data Buffer Automatic copying of user specified data to the host e General Numeric Access Bi directional transfer of numeric data between the host and PMAC using any DPR addresses not dedicated to another operation e Control Panel Emulation of PMAC s hardware control panel e Binary Rotary Buffer Execution of motion programs loaded by the host on an as requested basis e Real Time Data
301. ulses to synchronize the DAQ systems with the system s motion As P101 is increased the time between the pulses increases When the jog is stopped the pulse interval increases as the motor slows and eventually ceases because the motor stops When a jog is begun the pulse interval decreases until the motor reaches a steady state velocity Method 2 One Shot Operation If the PmacPosCompGen PLC is disabled by clicking the Disable Comp Pulse PLC button the corresponding indicator turns red Manually configure compare equal operations by entering a position in the numeric control above the Enable Reset Compare button The value entered in motor position or CS units as specified by the Encoder Counts button in the Jog cluster 1s used to configure a one time compare trigger Select the conditions for the operation using the buttons in the configuration cluster The operation should be latched Send the trigger to the external world using Output on the EQU Line and configure whether the condition is true High or true Low When this is complete click Configure Compare then Enable Reset Compare This will configure the flags and the compare equal value When jog the motor is jogged the Compare Equal indicator will turn green when the condition occurs The compare equal register cannot be read so keep track of the last value that was set Fortunately PmacEncoderTrigger does this Method 3 PMAC Panel Pro Interval Generation Perform the same in
302. unication drivers are now installed on the system Configuring LabVIEW During the installation of PMAC Panel Pro the directory PMAC Panel Pro lib containing the PMAC Panel Pro distribution VIs was created in the LabVIEW directory Three things need to be done to seamlessly integrate PMAC Panel Pro into the LabVIEW development environment 1 Create a view 2 Mass compile the Vis 3 Configure PMAC Panel Pro for the PMAC driver configuration Installing the Release View To facilitate the use of PMAC Panel Pro install the view contained in the release or create a custom view so that the PMAC Panel Pro VIs and controls are easily accessible from the Controls and Functions palettes and do not clutter the User lib directory The procedure for doing this is outlined here 1 Run LabVIEW 2 Select Edit Select Palette Set gt PMAC Panel Pro This view is a modification of the default view If no PMAC Panel Pro selection appears check for a directory named PMAC Panel Pro in the directory LabVIEW Menus 6 Getting Started PMAC PanelPRO User Manual The Controls and Functions palettes will appear as gt Functions ae Geof F gna TE Access to the entire suite of PMAC Panel Pro controls and function VIs is now available using the icon and its sub palettes PMAC Panel Pro icons are text based and indicate the PMAC Panel Pro lib subdirectory they are located in and their specific function Creating a Custom View If PMAC Pa
303. ure of the counter for encoder n Ifa flag input home limit or fault is used 1903 etc determines which flag Proper setup of this variable is essential for a successful home search which depends on the position capture function The following settings may be used 0 Software Control S O 1 Rising edge of CHCn third channeD o Z oS 2 Rising edge of Flag n as set by Flag Selec O o o Z o y 3 Rising edge of CHCn AND Flagn O Z oOo 4 Software Control S O 5 Falling edge of CHCn third channe o Z oO oS 6 Rising edge of Flag n as set by Flag Selec O O o Z o Z o 7 __ Rising edge of CHCn AND Flag n O O Z oo 8 Software Control SSS O 9 Rising edge of CHCn third channel _ _ o SSS O 10 Falling edge of Flag n as set by Flag Selec O o o o Z 2 a Rising edge of CHCn AND Flag n Software Control Falling edge of CHCn third channel 14 Falling edge of Flag n as set by Flag Select 15 Rising edge of CHCn AND Flag n Note that several of these values are redundant To do a software controlled position capture preset this parameter to 0 or 4 when the parameter is then changed to 8 or 12 the capture is triggered this is not of much practical use 1 2 3 4 5 7 10 11 12 13 14 15 Encoder I Variable 3 Capture Flag This parameter determines which of the Flag inputs will be used for
304. usterB Woo 8 Ithe state of i Program File Path Edit 3 i fi 3 i StaP E 3 aI f Array g the VI panel i Motor Positions Positions es AN Satie recommen i E paseon fi Tue b e oee nn ae rer Input PQH Yariant Arra Tee i Program File Path Output PQH Variant Arra ig e IEEE EEEE EEEE EET EEETE New Dutput Bao E ma 5 s Program Vl State Cluster 5 x Program Running Bool F 3 5 De we Pro bal 4 Close the panel Lor I eer Exec EIE g EE DoE He Execute the Yls in the this case 2 f 5 ASAA A AA AAAA AAAA AAAA ON LY when th e pan el is open Stet i i for dadian Open the VI panel Prog n Open the VI panel _ Dbug gt Er Scroll Position Program Listing To hide many nasty details the VI maintains a Program VI State Cluster When the VI executes the first time the Program Loaded item in the cluster is false Hence the program execution case on the left cannot execute the large case does and the program is downloaded thereby updating the Program VI State Cluster indicating that the program is loaded the program number and associated coordinate system At this point the VI is knows everything it needs to run and monitor the program If the application does not need to be downloaded every time the system is turned on changing the labeled Boolean constant on the top to true with the mouse will disable automatic down load This prevents the down load but does not provide
305. ve been installed configured and tested use caution when moving motors to prevent damage and possible injury Getting Started 5 PMAC PanelPRO User Manual PMAC Test Pro is now in terminal emulation mode allowing interaction directly with PMAC Although it is tempting to move motors when communication is first established in this step be thoroughly familiar with the mechanical setup and be certain that commands executed from PMAC Test Pro will not cause damage or injury Check to see if there is a response by typing 110 lt Enter gt PMAC should respond with a six or seven digit number Now type III lt Enter gt PMAC should respond with a beep signifying an unrecognized command Next type P lt Enter gt This requests a position PMAC should respond with a number Note If the system contains a PMAC Lite the response will still contain eight numbers when lt CONTROL F gt is entered Now type lt CONTROL F gt The system should respond with eight numbers one for each axis since lt CONTROL F gt requests following errors from all eight motors some or all may be zero Note that even with encoder counts as read out no scaling PMAC s position is displayed with fractional counts If error dialogs appear or the responses are not as specified check PMAC Test Pro s help capability It might help to review the Configuring the Driver section If the problem persists contact Technical Support The PMAC and the PComm 32 Pro comm
306. very iteration of the VI When clicked the Home PLC 1 Toggle button on the example panel changes the state of the PLC For the purposes of this example click the button and the PLC begins executing and the sequence of operations in PLC 10 begin executing thereby configuring and executing the specified home operation There is one important point to note about this example M133 and M145 are defined outside the actual definition of the PLC When the VI is first executed the entire program buffer including these statements is compiled and down loaded to PMAC If certain I Variable and memory locations are set before the OPEN PLC statement these are executed when the program is downloaded not every time the PLC 1s enabled There are a few more examples of encapsulated PLCs in the following sections 114 Homing Encoders and Position Capture PMAC PanelPRO User Manual ENCODER CAPTURE AND COMPARE OPERATION PMAC provides sophisticated and precise motion capabilities that can be easily accessed from PMAC Panel Pro applications When coupled with National Instruments data acquisition boards PMAC and PMAC Panel Pro can be used to build highly integrated and precise motion based data acquisition systems using GPIB SCXI VXI or DAQ boards The degree of integration is directly related to a particular system and performance requirements Loosely coupled systems with slow event or clock rates that can be handled by LabVIEW can be integrated pr
307. vide the ability to send on line ASCII command strings and data to PMAC and receive ASCII responses from PMAC Error handling and the ability to buffer communication for analysis and future reference are provided at this level PmacIVar Provide direct binary access to PMAC I Variables This collection of VIs provides an easy to use architecture for accessing I Variables and avoids formatting problems that can arise when querying PMAC I Variables that might be returned as hexadecimal values PmacMemory Access to PMAC s memory mapped variables and registers are simplified with this group of VIs Query Response Interface PMAC s client server interaction model works by sending requests to PMAC and awaiting responses Interaction with PMAC at this level removes much of the tedium involved in sending commands and formatting responses PmacResponse Send formatted command strings to PMAC and convert ASCII response strings into numerical values for use in the PMAC Panel Pro application PmacButton In most user interfaces queries are sent to PMAC as the result of Boolean user actions and conditions This group of VIs send command strings to request responses when an associated LabVIEW Boolean condition is TRUE Indicators Controls and Vis ICVs This collection of directories and VIs provide an extensive set of indicators controls and VIs that will tremendously speed the development of PMAC Panel Pro applications Each of the
308. vo_Timer 1352 TD3HaL Position Dbl TD3Hd1 Velocity Dbl TD3Hd1 Commanded_Pos_Dbl TD2HA1l Following Error Dbl DPR Dual Ported RAM 151 ILL i SS PMAC PanelPRO User Manual TD3Hdl Master _Position_Dbl TD3Hdl Comp_Pos_Dbl TD2Hd1 DAC_i32 TD2Hd1 Move _Time_132 GLOBAL buffers for handling motor data define MOTOR_MAX 8 define BUFFER_MAX 512 IntoZ Li z2 int32 INL 2 BufferCount MOTOR_MAX ServoTimer MOTOR_MAX BUFFER_MAX DAC MOTOR_MAX BUFFER_MAX Move_Time MOTOR_MAX BUFFER_MAX float64 Commanded_Position MOTOR_MAX BUFFER_MAX float64 Position MOTOR_MAX BUFFER_MAX float64 Velocity MOTOR_MAX BUFFER_MAX float64 Following_Error MOTOR_MAX BUFFER_MAX float64 Master Position MOTOR_MAX BUF FER_MAX float64 Compensation_Position MOTOR_MAX BUFFER_MAX ft S CIN MgErr CINRun int32 Device_Number_1i32_0_ int32 int32 Motor Number 12327 _ 1 6 1I Buffer_Length_1i32_128_ TD1 DPR_Real_ Time Vector Cluster LVBoolean ValidData int32 DevNum Device_Number_1i32 0 _ int32 MNum Motor_Number_i32 1 8 1 1 int BCount BufferCount MNum int SPzZeliy o1z Tell PMAC we re doing our thing PmacDPRSetHostBusyBit DevNum 1 Check if PMAC is busy doing its thing if PmacDPRGetPmacBusyBit DevNum Get Servo timer ServoTimer MNum BCount PmacDPRGetServoTimer DevNum x If this is the first element of a new buffer
309. wing diagram E Sub E wk JETE Program Running Circle Program Running Circles a a gt G Program Running POH show POM 2 TF Motor Position Chart we r HEB Mos Y Chart EEI Pos hrs EE F Close Motra Select Plot Select rogram Running PUHT m Active Plot Plot Color Subyll Ji Plot Color Use a Panel to configure the move o 100 Encapsulated Motion Programs and POMs PMAC PanelPRO User Manual The handling of the Run Show Panel and In Progress indicators for the individual motion programs is simple because of the encapsulation VIs At the bottom the Show PQM1 Panel button is supplied to PmacTestPQM1Panel to allow configuration of the PQM Variant Array supplied to the appropriate encapsulation VI The implementation of the plots charts and other indicators is identical to that covered already Encapsulated Motion Programs and POMs 101 PMAC PanelPRO User Manual 102 Encapsulated Motion Programs and POMs PMAC PanelPRO User Manual HOMING ENCODERS AND POSITION CAPTURE PMAC utilizes a custom gate array to interface motor encoders to PMAC and perform a number of high speed computations required to monitor motor position When writing PMAC programs moves in coordinate system units can be specified Motor positions are specified in encoder counts The gate array uses another version of encoder counts to translate motor position into encoder position In a
310. word PmacCINBase used 21 times in it The workspace has the keyword PmacCINBase used once Copy the files to a new directory give them new names such as PmacMyCustomCIN dsp and PmacMyCustomCIN dsw and replace all references to PmacCINBase with PmacMyCustomCIN Then open the new workspace in Visual C and compile the project using the LabVIEW created C source file named PmacMyCustomCIN c If the installation is different from that contained in PmacCIN try to edit the dsp or dsw files If there are too many changes create a Microsoft Visual C environment from scratch add the paths and libraries for PMAC and get one project to work From this point on copy the dsp edit it and insert it into an existing workspace It takes a little work the first time but adding new CINs is easy after that Multiple CIN Projects in a Workspace Managing multiple CIN projects gets troublesome quickly if each CIN has its own project and workspace Navigate to the PmacDPR directory and open the Microsoft Visual C workspace named PmacDPR dsw and note that the workspace shown below has 12 projects in it PmacDPRVarBack is the currently active project and will be compiled when the Build command is selected This figure is also instructive in that the project PmacDPRFixedBackVectors is open It shows that any LabVIEW CIN project requires cin obj labview lib lvsb lib and lvsbmain def For PMAC Panel Pro Pmac lib is also required The file PmacDPRFixedBackVectors c
311. written 1s used to store the position for compare operation Using this capability trigger events can be configured that occur at specified encoder positions in the system Because the triggering is implemented in hardware it is very fast and accurate The next section outlines how to use external TTL level signals to trigger data acquisition on NI DAQ boards Compare operations require three steps 1 Enable and configure the operation using the encoder control register 2 Load the compare position into the encoder register 3 Monitor the compare equal flag in the encoder status register and repeat these steps as required These steps may be performed in a PLC or a PMAC Panel Pro program Encoder Capture and Compare Operation 119 PMAC PanelPRO User Manual Required M Variables To utilize this feature from a PLC access the encoder control status register and the position compare equal register For Encoder 1 the standard M Variable declarations are MiLO03 gt X 5C003 0 24 S 24 bit pos compare register MiLTI gt xX2SC000 11 1 Compare flag latch control Mli2 gt xX SC000 12 1 Compare output enable bit MIL S gt x75C000 13 24 Compare output invert bit MIL iL6 gt xX eC000 16 4 Compare equals flag Similar sets of registers and M Variables are defined for the other encoder registers Pre loading the Compare Position To pre load a compare position assign an encoder position value to M103 such as M103 1250 This valu
312. y Input POM Variant Array The VI forms a basis for generating custom pop up PQM panels The diagram shown here has pieces of Sanya a k sae Pe eto a a a a a a ota a a a a a a a a a a a a a a tat a a a tat a a tot a a a a a a a a a a a a a a a a a a aa a a Init w Input Yariant Bool F E N CE E g Device Humber i32 0 Input POM Yariant Ara 7 IR PRS PSRs Rn a po ra nea ee nae ae al True iii an 7 Determine Fetch New Data the state of 3 the YI panel Acceleration in m5 a a POM Lav POM Lav 1 a E p a P nr f ar f f P HF m PEF m m C C utpat POM Variant Array p Output POM Variant Arra Handle the bug in 5 0 As with PmacProgSubVI there is no execution loop If Panel Show is true the panel is opened by the case structure on the top left If the panel is Open and Active the large case structure is enabled and the controls on the panel are active The panel clusters are converted to variants and used to set Output PQM Variant Array Thus Output PQM Variant Array always reflects the current state of the controls If Init w Input Variant latched is true or if Update is clicked the controls are updated using either the newly fetched data or the Input PQM Variant Array When Cancel or OK is clicked the panel is closed The state of the OK button is used to set New Output Incorporation of this pop up VI into PmacTestExamp can be seen in the follo
313. y Dbl 4 2 m 3 Coord System E m DE bam ana m X R Time Move i32 132 Iteration Timer mS a gt G32 RerationTimermS ea i gt e PmacDPRFixedBackVectors Once DPR Fixed Background buffer operation is enabled this VI can be used to fetch the data for a specific Motor Number and Coord Number The input Enabled can be used to enable and disable the actual fetch The Default un wired condition is true Coord Axis Char is a string X Y Z A B C U V W indicating which axis in Coord Number Comm d Pos will represent When New Output is true DPR Fixed Motor Cluster and DPR Fixed Coordinate Cluster contain the most recent background data When Enabled is false the two output clusters contain the last valid data even though New Output is false 156 DPR Dual Ported RAM PMAC PanelPRO User Manual Device Number 132 0 Enabled Bool T Buffer Length 2 32 Motor Number 132 1 8 1 Coord Number 132 1 8 1 Coord Asis Char The details of the CINs associated with each VI will not be covered here They are similar to those presented in the PmacDPRRealTime collection Specific details are contained in source code comments New Output Bool DPA Fired Motor Vector Cluster DPR Fised Coordinate Vector PmacDPRNumeric PMAC s architecture permits access to any unused DPR memory for whatever purposes using M Variables These may be scratch registers or in the case of DPR registers through whic

Download Pdf Manuals

image

Related Search

Related Contents

Coach/Power - Sport Tiedje  Rémunération des professeurs des écoles : Une  品質マニュアル - samidare  manuale d`uso e manutenzione  Pioneer DEH-P3370XM User's Manual  Sea Gull Lighting 88082-71 Installation Guide    DESCRIPCIÓN: Revestimiento liso  01 Table of Contents - Isuzu Truck Service  Defender 21031  

Copyright © All rights reserved.
Failed to retrieve file