Home

Motion Control PMC

image

Contents

1. 149 DefineReferenceAcceptedOutput 151 DefineReferenceBackwardOutput 153 DefineReferenceForwardOutput 155 DefineReferencelnput 251 DefineReferenceOutput n 157 DefineReferenceRejectOutput 159 DefineTimerOutput 161 DefineVelocityOUutput 164 DefineZeroMarkerlnput 69 DisplayActualPositioN 02 DisplayAnaloguelnput 53 DisplayDemandPosition 54 DisplayFollowingError 55 DisplayPositionBound 57 DisplayPositionOverflowCounter 56 DisplayReferenceEtror 58 DisplayReferenceLengthFalse 59 DisplayReferenceLengthTrue 61 DisplaySnapshotPositioN 63 DisplayVelocity esas tintin ances kie sn Xx aab a Ru Yo iR d i 64 DriveCommand nne 66 67 E EnablePositionControl 176 ExecuteAnalogueDistancelnit 287 ExecuteMap eene nennen nnns 92 ExecuteMapVirtual 94 ExecuteSequence 309 G GetBusVariable 43 C7 075111
2. 292 SetAnalogueDifferentialGain 295 SetAnaloguelnputHighLimit ssuuse 296 SetAnaloguelnputLowL imit sss 297 SetAnaloguelntegralGain 298 SetAnalogueMasterRangebDistance 299 SetAnalogueProportianalGain 300 SetAnalogueRangeDistance 301 SetBacklashDistance 229 SetBusVariable i 43 SetCanS DO 51 SetClutchLength 111 Sel ControlWOP aaeeeiai n uses EE 182 SetCreepDistance i 230 Page 315 SetDeceleration i 232 SetDifferentialGain ecceceeceececeeceeeeeeeeeeeeeees 186 SetEncoderFeedbackChannel TO SetEncoderFilterTime enses 72 SetEncoderScaling 73 SetEncoderTiIMeout He 74 SetErrorOptionsWord 188 SetFeedbackEnNcOoder 76 SetFilterOnReference 253 SetHighPositioNLimMit 190 SetIntegralGain 187 SetL OWPOSItONLIMIE eie rna n ru nen 191 SetMapAdjustmentVelocity ssssusse 117 SetMapBaseAdvanceTimeConstant 121 SetMapBaseOffset
3. n 123 SetMapLinkOptionsWord esee 125 SetMapOptionsWord 127 SetMapPositionTIMEoOUt 131 SetMapScaleFromBoundSs 132 SetMaxPoOSsIitiONETTOr seen 192 SetMaxReferenceCorrection a 255 SetModbusAddtress 310 SetMonitorOutputFunction 37 SetMonitorOutputGain 39 SetMonitorOutputOffset n 40 SetMoveOptionsWord 234 SetNumberOfBitS e 83 SetPhaseAdvanceFactor eene 166 SetPositionBound 133 SetPositionCounter ceeceececeeceseeceeeeeeeeeeeeees 193 SetPositionOutputHysteresis 170 SetPositionOverflowCounter ese 135 SetProportionalGain 185 SetReferenceAcceleration esses 257 SetReferenceAdvanceFactor 258 SetReferenceCorrectionVelocity 260 SetReferenceErrorLimit cc cceceeeeeeeceeeeeeeeeeeees 262 SetReferenceFalseHighLimit 264 SetReferenceFalseLowLimit 266 SetReferenceFilterOptionWord 267 SetReferenceHoldoffTime esse
4. H3000 H2400 1800 1200 600 300 600 900 1200 1500 1800 2100 2400 2700 3008 Increments Illustration 24 Trapezoidal velocity profile Page 222 User Manual PMCprimo SoftPLC 14 Function library primo lib 1000 Position increments 750 dl time r nanna m Illustration 25 Positions course with trapezoidal velocity profile The required velocity cannot be achieved with a very low acceleration value which results in a triangle instead of a trapezoidal velocity profile Set velocity Actual peak velocity 1 Illustration 26 Triangle velocity profile PMCprimo signals the command execution with sign M at the serial interface Travel commands can only be executed with an active position control loop User Manual PMCprimo SoftPLC Page 223 14 Function library primo lib The target position is checked before execution of a move command as to the observance of the software limit function blocks SetLowPositionLimit and SetHighPositionLimit If the target position is outside of the software limits the move command is not executed and PMCprimo signals the error target position is outside of the software limits Input variables bExecute BOOL The movement is started in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if on
5. UJ Oo Version 1 008 or higher This bit defines the parameter of the function SetReferenceAcceleration see page 257 0 RC sets the acceleration for the reference correction 1 RC sets an acceleration distance Bit 7 not used Output variables bDone BOOL Value is written True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceMode SetMaxReferenceCorrection SetReferencePosition and InitialisePosition Factory setting 0 Examples Declaration INST SetReferenceOptionsWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 10 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 10 bVarBOOL2 Inst bDone Example in FBD INST setReferenceOptionsWord fo BbvarBOooL1 BExecute hDone bVarBOOLZ I HusiMade bError 1 4usichannel ierror4umber 2 10HusiGontrolword User Manual PMCprimo SoftPLC Page 273 14 Function library primo lib SetReferencePosition Page 274 PMCprimo Command RJ Set deferred reference adjustment position Function library Referencing Description With this function block the user can define the position within the cycle limits at which PMCprimo may correct a stored
6. User Manual PMCprimo SoftPLC Page 97 14 Function library primo lib GetWrapAroundOffset Page 98 PMCprimo Command GW Get wraparound offset value Function library Mapping Description With this function block the internally calculated offset value can be read out at the slave axis during the wraparound cycle limit This control function can be used to determine if the position allocation behaves as scheduled Additionally it can be determined if the behaviour of the slave axis during the wraparound is correct The value is internally calculated by the processor The given value is only valid after activation of the position allocation The reading of the GetWrapAroundOffset value can only be carried out on the slave axis The value must amount to the value 0 or position bound in the simple case when the position bound at the master and slave axes are identical If the value changes upwards or downwards in course of time the axis drifts away The settings of the position allocation must be checked in any case Input variables bExecute BOOL The value is read in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or is still under operation
7. bVarBOOL2 Inst bDone Example in FDB INST Execuiesequence fo bYVarBOOL1 4bExecute bDone DvarBooL E mu START SsMame bErrar iErrar lumbar User Manual PMCprimo SoftPLC Page 309 14 Function library primo lib SetModbusAddress PMCprimo Befehl MU As of version 2 006 available Description This function module sets the modbus number This is used in a ModBus multidrop net to indentify the device Input variables bExecute BOOL If the value is set the function starts working 0 resets the function module and the output variables are set to False or 0 usiAddress USINT The modbus number in the range of values 0 to 255 Output variables bDone BOOL sequence executed True or sequence is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Example INST SetModbusAddress bVarBOOL1 BOOL bVarBOOL2 BOOL Example in AWL CAL INST bExecute bVarBOOL1 usiAddress 5 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiAddress 5 bVarBOOL2 Inst bDone Example in FUP INST SetMadbusAddress bvarBooOL1 bExecute bDone bvarBooOL7 SH4usiAddress hErrar ierrorMumber Page 310 User Manual PMCprimo SoftPLC 15 Function library primo_tools lib 15 Function library primo_tools lib The functional library primo_tools lib contains 3 function blocks which can be in
8. INST DefineReferenceRejectOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DetineReterenceRejectOutput bYarBOOL1 4bExecute bDone bVvarb vol UsusiMode bError 14usichannal ierrorMumber 1 4usiBank 5 Jusi Output 4usiPalarity User Manual PMCprimo SoftPLC 14 Function library primo lib DefineTimerOutput PMCprimo command TC Define timer counter output Function library Output This function is available since Version 2 005 Description With this command it is possible to define a digital output for timer or counter function If for example a bound overflow output is defined it is possible extend the implulse with DefineTimerOutput in order CoDeSys can detect it certainly The timer counter can only be triggerd from PMCprimo The timer counter mode values are as follows BEEN One shot up counter One shot down counter Cyclic down counter aerate E E The output line is set true as defined with usiPolarity when the timer counter is first triggered and it is reset false when the timer counter reaches its final value set by the count parameter In all counter modes the counter is
9. RL This Bit activates a permissible position for correction of a reference error setting with the function SetReferencePosition page 274 A position is not defined with correction of a reference error The correction is immediately executed when recognising a reference input Position with reference error correction active This Bit prevents the movement back to the reference signal with initialisation Function InitialisePosition page 214 Movement back to the reference signal with initialisation is executed Movement back to the reference signal with initialisation is not executed Version 1 008 or higher This bit defines the parameter of the function SetReferenceCorrectionVelocity see page 260 RV sets the velocity for the reference correction RV sets the distance of the reference correction With this function the reference error is spread out to a defined distance Bit 6 of RW must be set if bit 4 is set If not then a warning is given out and bit 6 is set automatic User Manual PMCprimo SoftPLC 14 Function library primo lib UJ Oi This Bit determines if a reference error correction is only executed in the position indication or also at the motor This Bit does not have any effect at a slave axis with active position allocation as each reference error is corrected at the slave axis in this case 0 Motor position and position indication are corrected Only the position indication is corrected
10. SetSlowSpeedMode MoveConstantVelocity MoveRelativePosition MoveToAbsolutePosition SetReferenceCorrectionVelocity SetMapBaseOffset SetSlaveMapOffset and SetScaleMapping Factory setting 0 standard velocity step User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST SetSlowSpeedMode bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 1 bVarBOOL2 Inst bDone Example in FBD INST SetslowSpeedhiode BvarBOO0L1 BExecute bDone bVarB00L2 0 4usiMode hErrar 1 Ausichannal iIErrarMumber 1 4usivalue User Manual PMCprimo SoftPLC Page 239 SetVelocity Page 240 14 Function library primo lib PMCprimo Command SV Set velocity Function library Positioning Description With this function block the velocity is specified in increments second The velocity can also be changed during move SV command received x Illustration 31 Change travel velocity during a move Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on
11. 0 bVarBOOL2 Inst bDone Example in FBD INST InitialisePasitian BvarBOoOLb1 B5Execute BvarBOoOLb dusiMade 1 4usichannal iErrarMurmbar 0 bDirection User Manual PMCprimo SoftPLC Page 215 14 Function library primo lib InitialisePositionBounds Page 216 PMCprimo Command IB Initialise position and bounds Function library Positioning Description This function block is similar to the function block InitialisePosition With this function block the position bound of the machine is also determined additionally to the initialisation of the position PMCprimo executes an initialisation command at the selected axis so long until a reference signal is recognised for the first time Following the axis drives further with constant velocity until the reference signal is recognised for the second time PMCprimo considers the distance between recognising the reference signal as position bound of the selected axis PMCprimo signals I during the initialisation Execution The motor accelerates to the setpoint velocity and keeps the same so long constant until PMCprimo recognises a reference signal The direction to which the motor drives is determined via an argument The position counter is immediately set to the value of SetReferenceOffset Referenzoffset page 271 and the motor is braked Following the motor drives back to the position O The function block for the initialisation can also be used with an open position con
12. 10V Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or it is still under operation False e bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The actual value of the analogue input Examples Declaration INST DisplayAnaloguelnput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayAnalaguelnput bYarBOOL1 4bExecute bDone bvarBOOL2 UsusiMode hErrar 14usichannal iErrorMumber divalue diValue User Manual PMCprimo SoftPLC Page 53 14 Function library primo lib DisplayDemandPosition PMCprimo command DD Display demand position Function library Display Description The actual demand position of the selected axis is read into a variable with this function block The unit of the demand position is in
13. 14 Function library primo lib Examples Declaration INST GetCanSDO bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL 1 usiCanNode 4 uilndex 1622000 usiSubindex 0 usiBytes 4 LD INST bDone ST bVarBOOL2 ST diValue Example in ST INST bExecute bVarBOOL1 usiCanNode 4 uilndex 1622000 usiSubindex 0 usiBytes 4 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST Getlansbo bVarb00L14bExecute U4usiNode 0 4usiCanMetwork ierrorNumber 44usiCanMode divale 91 924 uilndex OusiSubindex 4 usibytes User Manual PMCprimo SoftPLC Page 49 SetCanSDO Page 50 14 Function library primo lib PMCprimo command QS Send SDO Function library CAN Description PMCprimo can have access to object library of a CAN unit per SDO and write for example demand values or configurate the unit The configuration of the parameter must be taken from the user manual of the corresponding network station Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set from False to 0 usiCanNetwork As of version 2 000 0 CAN main network 1 CAN at expansion board or second CAN controller usiCanNode USINT The CAN node address CANopen unit uilndex UINT The index of the object library usiSubIndex USINT The sub index for the access to the object library usiBytes USI
14. User Manual PMCprimo SoftPLC 14 Function library primo lib SetLowPositionLimit PMCprimo Command LL Set position limit low Function library Positioncontrol Description With this function block a software end position is set in a negative direction PMCprimo only starts a positioning movement if the target position is within the software end position In case the software end position is achieved with an end positioning PMCprimo switches off the controller release motor is de energised The input of the software end position is made in increments Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system diValue DINT The software end position 4 000 000 increments As of version 2 004 new range 2 000 000 000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetHighPositionLimit Factory setting 4 000 000 increments Examples Declaration INST SetLowPositionLimit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode
15. bExecute BOOL The function is started in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Motor is switched off True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Examples Declaration INST InitialiseDemandOffset bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST InitialiseDemand0Otffset bVarBQ00L1HbExecute bDone hvarBOooL7 04Uusilode hError 1HusiChannel ierrorNumber User Manual PMCprimo SoftPLC Page 179 MotorOff Page 180 14 Function library primo lib PMCprimo Command MO Motor off Function library Positioncontrol Description This function block switches off the controller release All other functions remain active the encoder signals are evaluated In case the controller release is re activated the motor remains in the instantaneous position In case of an open position control loop the setpoint signal is damped wit
16. bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiGain USINT The control factor from 0 to 65535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetProportionalGain SetAccelerationFeedForwardGain SetlntegralGain SetVelocityFeedbackGain und SetVelocityFeedForwardGain Factory setting 0 switched off Examples Declaration INST SetDifferentialGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 100 bVarBOOL2 Inst bDone Example in FBD INST aetbifferentialGain BpvarBooL1 bDone bVarB00L2 T hErrar 1 4usichannal iErrorMumber 100 uiGain Page 186 User Manual PMCprimo SoftPLC 14 Function library primo lib SetintegralGain PMCprimo Command KI Set integral gain constant Function library Positioncontrol Description With this function block the integral factor
17. diValue Page 58 User Manual PMCprimo SoftPLC 14 Function library primo lib DisplayReferenceLengthFalse PMCprimo commandi ZX Display length reference signal false Function library Display Description The length measured before is read out with this function block over which the reference signal had the condition False This indication is only made when Bit 0 of SetReferenceFilterOptionWord page 267 is set to 1 In case Bit 0 of the SetReferenceFilterOptionWord is set to 0 then automatically ZX is also set to zero Note To be able to measure the length of the reference signal the edge to be recognised is always changed internally The time for the reprogramming is the debouncing time Function SetReferenceHoldoffTime page 269 Signals which are shorter than the debouncing time or 1 millisecond cannot be measured and result a wrong value Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or it is still under operation False e bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The
18. 0 usiChannel 1 diValue 500 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 500 bVarBOOL2 Inst bDone Example in FBD INST SetLowPasitionLimit BvarBOoOL1 B5Execute bDone BvarBOoOLb 2 qusiMade hErrar 1 4usichannal iErrar lumbar 5004diValue User Manual PMCprimo SoftPLC Page 191 14 Function library primo lib SetMaxPositionError PMCprimo Command SE Set maximum position error Function library Positioncontrol Description With this function block a maximum position error which is continuously monitored by PMCprimo is set If the set error limit is exceeded PMCprimo brakes the axis up to the standstill and switches off the controller release motor is de energised The input of the following error limit is made in increments Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiValue UINT The maximum following error from 0 to 65535 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203
19. 1 In case of an error PMCprimo gives a signal and switches off the controller release Reaction of PMCprimo when recognising a reference signal before an existing reference error has been adjusted 0 In case of an error PMCprimo gives a signal 1 In case of an error PMCprimo gives a signal and switches off the controller release Reaction of PMCprimo when exceeding the maximum permissible limit values at the analogue input 0 In case of an error PMCprimo gives a signal i In case of an error PMCprimo gives a signal and switches off the controller release Suppress the error message reference input is missing see also SetReferenceTimeout page 280 if Bit 0 is not set to 1 0 The error message is indicated 1 The error message is not indicated if Bit 0 is set to 0 Suppress the error message reference error exceeded see also SetReferenceErrorLimit page 262 if Bit 1 is not set to 1 0 The error message is indicated 1 The error message is not indicated if Bit O is set to O Suppress the error message reference signal recognised before the existing reference error has been completely tuned if Bit 2 is not set to 1 0 The error message is indicated s The error message is not indicated if Bit O is set to O User Manual PMCprimo SoftPLC 14 Function library primo lib Bit 7 Suppress the error message analogue input limit exceeded see also SetAnaloguelnputHighLimit SetAnaloguelnputLowLimit page
20. 14 Function library primo lib DisplayPositionBound PMCprimo command SB Set position bound Function library Display Description The actual position bound of the selected axis is read in a variable with this function block The unit of the actual position is increment Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or is still under operation False e bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact the error cause see GetError page203 diValue DINT The actual position bound Also refer to DisplayDemandPosition und DisplayFollowingError Examples Declaration INST DisplayActualPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Examplel in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayPositionBound hExecute bDone 04usiNode hErrar 1 4usiCchannel iErrarMumber divalue diYalue User Ma
21. 4 iusiWadus User Manual PMCprimo SoftPLC Page 163 14 Function library primo lib DefineVelocityOutput Page 164 PMCprimo Command VO Define velocity trigger output Function library Output Description With this function block a digital output can be set dependent on the momentary velocity of an axis The specified output directs the specified signal level within the velocity range specified according to the sign With the function block SetVelocityOutputHysteresis a hysteresis can be set so that the output does not switch constantly if the actual velocity varies by the switch thresholds Input variables bExecute BOOL The output is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and A is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative diSpeed1 DINT The initial speed of the range diSpeed2 DINT The final speed of the range Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetVelocityOutputHyste
22. Connected function DefineAnalogueLimitErrorOutput DefineAuxiliaryOutput DefineBoundOverflowOutput DefineMotorErrorOutput DefinePositionTriggerOutput DefineReferenceAcceptedOutput DefineReferenceBackwardOutput DefineReferenceForwardOutput DefineReferenceOutput DefineReferenceRejectOutput und DefineVelocityOutput User Manual PMCprimo SoftPLC Page 173 14 Function library primo lib Examples Declaration INST UndefineOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiBank 1 usiOutput 5 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiBank 1 usiOutput 5 bVarBOOL2 Inst bDone Example in FBD INST UndefineQuiput DVvarBooL1 Page 174 User Manual PMCprimo SoftPLC 14 Function library primo lib 14 13 Positioncontrol The drive is operated with all position processes in a position control In case there are deviations between an actual position and the constant or consecutive setpoint positions these ones are reduced by the position controller Control algorithm PMCprimo includes a PID position controller with reverse velocity and acceleration pre control factors Vbemand KP ej KI Ze KD e 1 KV p P 1 KF d d 1 KA d di_1 di 1 di 2 KP proportional gain constant KI integral gain constant KD differential gain constant KV velocity feedback gai
23. Example of a function block from PMotion Motion MMotionGen bExecute The function block ST itself is designed in such a way Page 106 User Manual PMCprimo SoftPLC 14 Function library primo lib Declaration FUNCTION BLOCK Motion2 VAR INPUT bExecute BOOL END VAR VAR OUTPUT bDone BOOL FALSE bError BOOL iErrorNumber INT END VAR VAR iCount INT Motion Motiongenerator sMapName STRING Motion2 MName iSteps INT 1000 MNPT iNumberElements USINT 1 diMasterpos ARRAY 0 1 OF DINT 0 1000 MMx diSlavepos ARRAY 0 1 OF DINT 0 1000 MSx diFunction ARRAY 1 1 OF DINT 9 MFx diValuesA ARRAY 1 1 OF DINT 0 MAx diValuesB ARRAY 1 1 OF DINT 0 MBx diValuesC ARRAY 1 1 OF DINT 0 MCx diValuesW ARRAY 1 1 OF DINT 12201110 MWkx diValuesX ARRAY 1 1 OF DINT 0 MXx diValuesY ARRAY 1 1 OF DINT 0 MYx diValuesZ ARRAY 1 1 OF DINT 0 MZx END VAR Implementation IF bExecute TRUE AND bDone FALSE THEN Motion bExecute TRUE IF iCount 0 THEN Set Variables Motion sMapName sMapName Motion iSteps iSteps Motion iNumberElements iNumberElements Motion pdiMasterpos ADR diMasterpos Motion pdiSlavepos ADR diSlavepos Motion pdiFunction ADR diFunction Motion pdiValuesA ADR diValuesA Motion pdiValuesB ADR diValuesB Motion pdi
24. It is difficult to diagnose this problem however it can be avoided with a corresponding design of the tabular position allocation User Manual PMCprimo SoftPLC Page 85 Page 86 14 Function library primo lib The tabular position allocation must cover the complete position bound of the master axis from 0 up to the cycle limit The slave axis must know the position bound of the master axis enabling it to calculate its speed and its demand position beyond the cycle limit It happens automatically when starting the execution of a tabular position allocation with the function MapLinkSlaveToMaster page 104 The position bound of the master axis is automatically transmitted to the associated slave axis Slave A position Slave u bound map position relationship N 4 VA Master position Be n Master bound Illustration 12 position allocation for a cyclic machine The diagram shown in Illustration 12 indicates a system in which the master and slave axes execute their cycles in the same time with identical position bounds although they cover different distances A coincidence of position bound and cycle time is not required In practice neither position bound s nor cycle times coincide with linear software gear units except of 1 1 gear units The differences of position bound and cycle time between master and slave axes do not cause any problems when executing a tabular position allocation It is also possible to exceed the
25. SM SM x AP ei Al Xej AD ei ej 4 I SM AP AI AD ei Transmission ratio Master Slave Set transmission ratio SM command Proportional factor Integral factor Differential factor Web tension distance 7 set web tension actual web tension The dynamic behaviour of the web tension depends on these constant factors and on the mechanical behaviour of the driven machine The setting of these factors is imperative for the achievement of an optimum control behaviour User Manual PMCprimo SoftPLC 14 Function library primo lib CalculatelnitialRatio PMCprimo Command CR Calculate initial ratio from analogue range distances Function library Tension Description As soon as the function module is started PMCprimo calculates the initial transmission ratio from the values of the slave and master axes specifed with SetAnalogueRangeDistance and SetAnalogueMasterRangeDistance The calculation is executed with both measuring values with SetAnalogueRangeDistance Slave SetAnalogueMasterRangeDistance Master in the same way as with the values of SetPositionBound by the function SetMapScaleFromBounds In case the automatic measuring of the analogue distance is released at the master and slave axes the function module ExecuteMap executes an automatic measuring of the analogue distance at both axes Input variables bExecute BOOL The transmission ratio is calculated in case of a change from 0 to 1 0 resets the function module
26. The axle number from 1 to n depending on the system uiGain UINT The control factor from 0 to 65535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetAccelerationFeedForwardGain SetDifferentialGain SetlntegralGain SetVelocityFeedbackGain und SetVelocityFeedForwardGain Factory setting 10 Examples Declaration INST SetProportionalGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 150 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 150 bVarBOOL2 Inst bDone Example in FBD INST setFroportionalGain BvarBOOL1 BbExecute barbod Il 1usiMade 1qusiChannel ierroriNumber 150 uiGain User Manual PMCprimo SoftPLC Page 185 14 Function library primo lib SetDifferentialGain PMCprimo Command KD Set differential gain constant Function library Positioncontrol Description With this function block the differential factor of the control algorithm is set The differential factor is useful with very strong varying position errors e g with a step by step position modification The factor has only a secondary meaning in a well tuned control loop Input variables
27. Wait Available as of version 2 000 Description This function block tells PMCprimo to wait until the current channel reaches the given absolute position The position is specified in increments Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue UINT Absolute position for waiting Output variables bDone BOOL No more waiting True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Examples INST WaitForAbsolutePosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 200 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 200 bVarBOOL2 Inst bDone Example in FDB INST WaitFar amp hsalutePasitian BpvarBOoL1 User Manual PMCprimo SoftPLC Page 303 14 Function library primo lib WaitForBoundPosition PMCprimo Command WB Wait for bound position Function library Wait Available as of version 2 000 Description This function block tells PMCprimo to wait until the motor passes t
28. bVarBOOL2 Inst bDone Example in FBD INST SetbacklashDistance bVarBQ0L1HbExecute bVarB 00 2 04Uusihode 1Ausichannel ierror4lumber 204Uuiv alue User Manual PMCprimo SoftPLC Page 229 14 Function library primo lib SetCreepDistance Page 230 PMCprimo Command SC Set creep distance Function library Positioning Description The standard trapezoidal velocity profile of a positioning movement can be completed by the introduction of a way with creep speed for the positioning The creep speed is set with the function block SetSlowSpeed The creep speed is used for a slow move of the target position This command is only effective when SetSlowSpeedMode page 238 is set to O The deceleration action is initiated so early that the axis travels the slow creep speed 200 increments the latest before achieving the target position Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The way with creep speed from 0 to 65 535 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetErro
29. depending on the system usiValue USINT The value from 0 to 200 percent As of Primo_V2_006 lib udiValue UDINT Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceAcceleration and SetSlowSpeed Factory setting 100 percent Examples Declaration INST SetReferenceCorrectionVelocity bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 100 bVarBOOL2 Inst bDone Example in FBD INST SethieferencecorrectionVelocity bYarBOOL1 4bExecute bDone bVYarb vol 0 usiMode hErrar 1 A4usichannel ierrorkumber 1 00 usivalue User Manual PMCprimo SoftPLC Page 261 14 Function library primo lib SetReferenceErrorLimit Page 262 PMCprimo Command LR Set reference error limit Function library Referencing Description With this function block a reference error limit can be set in increments If PMCprimo recognises a reference error which is bigger than the set value the error signal Reference error outside limits is issued SetReferenceErrorLimit is independent on SetMaxReferenceCorrection page 255 and SetFilterO
30. is set to 1 If Bit 5 is set to O the software clutch time SetClutchTime page 113 is active This function block indicates the acceleration ramp as distance for the function of the software clutch The function software clutch is activated with Bit O the function block SetMapOptionsWord The software clutch function is designed for switching the slave axis to a driving master axis The software clutch functions as a mechanical fixed point clutch which couples point exactly while driving The slave axis waits in the instantaneous position until the master axis achieves the driving position For a velocity synchronous operation a value for nzO should be specified for the switching to the running master at the slave axis for SetClutchLength The value n 4194304 represents the longest possible and the value n 0 the shortest possible way as clutch length The specification of the clutch length is executed at the slave axis the indicated distance in increments however refers to the master axis Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue DINT The coupling distance in increments of the master Ab Primo V2 006 lib udiValue UDINT Output variables bDone BOOL V
31. or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetEncoderTimeout and SetlntegralGain Factory setting 16 7 10hex Examples Declaration INST SetControlWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 22010101 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 222010101 bVarBOOL2 Inst bDone Example in FBD INST SetControlyYvord bYVarBOOLt bYarBOOL 1 i iErrorNumber 23 01 0101 usiCantralward Page 184 User Manual PMCprimo SoftPLC 14 Function library primo lib SetProportionalGain PMCprimo Command KP Set proportional gain constant Function library Positioncontrol Description With this function block the proportional factor of the control algorithm is set A high value of the KP factor allows a short reaction time and an exact position control Therefore the KP factor should be set as high as possible without generating an overshooting Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT
32. position bound when executing a tabular position allocation with the slave position without problems In this case the slave axis automatically compensates the zero point of your position bound when achieving the cycle limit The position allocation between master and slave axes can be loaded with an Offset value with both axes These Offset values SetMapBaseOffset and SetSlaveMapOffset page 138 displace the relation master slave along the position axis of the master or slave respectively The value of the SetMapBaseOffset function is subtracted from the position of the master axis before the position enters the allocation This effects a displace of the position allocation line to the right see graph mentioned below The value of the SetSlaveMapOffset function is added to the position of the slave axis before the position enters the allocation effecting a displacement of the position allocation line upwards The functions SetMapBaseOffset and SetSlaveMapOffset allow that one or all slave axes can be displaced or turned relatively to the master axis even if the allocation master slave is executed User Manual PMCprimo SoftPLC 14 Function library primo lib Slave Normal map Slave With map base offset Master d Master Slave Slave S MF MF Master Master With map offse With both Illustration 13 effects positionoffset The data of the position table are entered as absolute position of the slave ax
33. udiValue 5000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 5000 bVarBOOL2 Inst bDone Example in FBD INST saelReferenceRepeatLength po 2 2 bvarBOOLi hExecute bDone b arBOOL2 I Hu siMacde bErrar 1HusiChannel ierrorNMumber 5000Hudi value User Manual PMCprimo SoftPLC Page 279 14 Function library primo lib SetReferenceTimeout Page 280 PMCprimo Command RT Set reference timeout Function library Referencing Description With this function block a monitoring can be activated for reference signals If a value unequal to zero is set reference signals can get lost before PMCprimo issues the error signal reference timeout If Bit 0 of the module SetErrorOptionsWord page 188 is set to 1 PMCprimo simultaneously switches off the controller enable motor is de energised Herewith the initialisation InitialisePosition InitialisePositionBounds page 214 216 can also be monitored The monitoring is only used for signals which are not filtered out function block SetFilterOnReference page 253 Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The number of sign
34. usiChannel 1 bDirection 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bDirection 0 bVarBOOL2 Inst bDone Example in FBD INST InitialisePasitianBaunds BbvarBOoL1 hbExecute bDone bVarB 002 Il HusiMade bErrar 1HYusiChannel ierrorMumber O4bDirection User Manual PMCprimo SoftPLC Page 217 14 Function library primo lib MoveConstantVelocity PMCprimo Command VC Move at constant velocity Function library Positioning Description This function block is used to drive the motor with a constant velocity in the specified direction PMCprimo accelerates the motor with the acceleration value SetAcceleration page 227 until it has achieved the velocity determined with the function block SetVelocity page 240 The motor drives with constant velocity until to a stop signal is detected PMCprimo signals the command execution with the sign V at the serial interface Move commands can only be executed with a closed position control loop Illustration 23 Move with constant velocity Input variables bExecute BOOL The movement is started in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system bDirection BOOL The rotational direction 0 negative 1 p
35. usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetReferenceMode and DefineReferencelnput The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defined User Manual PMCprimo SoftPLC Page 151 14 Function library primo lib Examples Declaration INST DefineReferenceAcceptOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DetineReferenceAcceptedQutput bVarBOOLt bYVarBOOL 1 1 5 0 Page 152 User Manual PMCprimo SoftPLC 14 Function library primo lib DefineReferenceBackwardOutput PMCprimo Command JB Reference adjustment backwards output Function library Output Description With this function block
36. 1 bVarBOOL2 Inst bDone Example in FDB INST Set naloguecontrolhiode bYarBOOL1 4bExecute bDone byarBOOLzi d usiNode bbEma 1 4usichannal ierroriNumber 1 4usiMade User Manual PMCprimo SoftPLC 14 Function library primo lib SetAnalogueControlSetPoint PMCprimo Command AC Set analogue control setpoint Function library Tension Description With this function module the setpoint value of the analogue control is specified The control deviation is calculated from the difference between the setpoint value and the actual value measured with the analogue input Input variables bExecute BOOL The setpoint is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system iSetPoint INT The web tension setpoint value in the range of 2047 corresponds to 10V Output variables bDone BOOL Setpoint set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueControlWord SetAnalogueControlMode and Execute Map Factory setting 0 Examples Declaration INST SetAnalogueControlSetPoint bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL IN
37. 1 milliseconds and therefore the distance the master makes within this time Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiPhase UINT The velocity dependent phase shifting from 65535 to 65535 As of Primo V2 006 lib diPhase DINT Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapBaseOffset and SetMapBaseAdvanceTimeConstant Factory setting 0 switched off User Manual PMCprimo SoftPLC Page 119 14 Function library primo lib Examples Declaration INST SetMapBaseAdvance bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiPhase 64 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 uiPhase 64 bVarBOOL2 Inst bDone Example in FBD INST SetiiapbaseAdvance bYarBOOL1 4bExecute bDone BvarBOooOL qdusiMade hErrar 1 4usichannal iErrorMumber 64 uiPhase Page 120 User Manual PMCprimo SoftPLC 14 Function library pr
38. 2 Fi NIE 2 IZ Noci in 2 1 3 Previous editions aeree tt 2 2 Contents lata 3 3 Contentsofillustrations iii 5 4 Abbreviations and symbols ri 6 3 INUTOOUCHOD ilaria 7 6 Manufacturer s declaration Safety Instructions 9 6 1 Manufacturers declaration ee 9 p2 Dally IMSMUICTIO MS ee aporia iii 9 7 General COS CHiN m T 10 8 News in PMCprimo firmware version 2 005 11 9 Installation of the software iii 12 OA Usag ordirecionies cuori 12 10 FPISESIODS rei itinere 12 11 Control cOnfiguratioN sarririaiionianionicianii anioni intaniiiriiiii 14 TVA PIMC DiC DAVE EEE E 14 P M doi 14 Ito PMCONMO MILIEU T 14 114 PMCprimo Diveli E 14 11 5 PMCprimo CAN Input Output ii 16 11 6 Profibus DP enhanced Master ei 16 11 7 iioii NT TU mmm 19 PF Profibus Slave C le 19 12 Communication with the control eee eeeee rere nennen 20 12 1 Kind of 9 0 0 a 216 6 9 E RUE 20 12 2 Setting of a new connection ei 22 13 SOMPLC in PMGDTEIITIO eint cuiua no caa haa uxo nan nube na SnssboEsinbnD uua Rus I xRU Su REG aiiai 24 5 MEE e RET RETE 24 19 2 Non tra
39. 296 if Bit 3 if not set to 1 0 The error message is indicated 1 The error message is not indicated Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetReferenceTimeout and SetReferenceErrorLimit Factory setting 0 Examples Declaration INST SetErrorOptionsWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 10 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 10 bVarBOOL2 Inst bDone Example in FBD INST SetErrarlptionsyvord BVvarBOoOL1 BhExecute BpvarBOoOLZ I HdusiMade 1HusiChannel 2 10HusiControlword User Manual PMCprimo SoftPLC Page 189 14 Function library primo lib SetHighPositionLimit Page 190 PMCprimo Command LH Set position limit high Function library Positioncontrol Description This function block sets up a user defined limit position If at any time the absolute position of the motor exceeds the high position limit PMCprimo gives the high position limit exceeded error message and goes to the motor off state This is similar to the action taken on detecting a limit switch input The value is defined in encoder
40. Connected function SetControlWord Factory setting 10 000 increments Examples Declaration INST SetMaxPositionError bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 200 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 200 bVarBOOL2 Inst bDone Example in FBD INST agtMaxPasitianErrar BvarBOOL1 bDone BvarBOoOL T hErrar 1qusiChannel iErrarurmber 200 uiV alue Page 192 User Manual PMCprimo SoftPLC 14 Function library primo lib SetPositionCounter PMCprimo Command ZC Zero position counters or set position Function library Positioncontrol Description The function block sets the position counter to the indicated value In case the indicated value is bigger than the position bound Function SetPositionBound the position is scaled to the position bound Input variables bExecute BOOL The position counter is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system diValue DINT The new position in the range of 4 000 000 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL Tru
41. Description With this function block the last recorded SnapshotPosition before of the selected axis is given in increments see DefinePositionSnapshot 249 Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL e Value has been read True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The stored PositionSnapshot Also refer to DefinePositionSnapshot Examples Declaration INST DisplaySnapshotPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplaySnapshotPosition bWYarB00L1 lt bExecute bOone bvarBOOLZ 0 usiMode bError 1 4usichannal iErrarMurnbaer divalue diYalue User Manual PMCprimo SoftPLC Page 63 14 Function library primo lib DisplayVelocity PMCprimo command DV Displa
42. Example in FDB DvarBOooL1 10 10 1 20 Taschinegmayrde hilfeomayr de INST SendMail hExecute BpvarBooLb SSener sFramAddress iErrarMumber sToAddress sSubject sMessageText User Manual PMCprimo SoftPLC 14 Function library primo lib ExecuteSequence PMCprimo Command XS sequence Execute sequence Function library Tension Description This function module enables the user to call a PMCprimo sequence A sequence call effects the immediate execution of the indicated sequence In case of an error the handling of the sequence is immediately stopped A sequence may only be recalled after the complete execution in case of non observance PMCprimo gives the error message Cannot execute sequence while it is in use Commands are executed one after another Input variables bExecute BOOL The sequence is started in case of a change from O to 1 0 resets the function module and the output variables gt are set to False or 0 sName STRING Name of th sequence Output variables bDone BOOL sequence executed True or sequence is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Examples INST ExecuteSequence bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 sName START LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 sName START
43. Example in IL CAL Inst bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 1 LD Inst bDone ST bVarBOOL2 Example in ST Inst DExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 1 bVarBool2 Inst bDone Example in FBD Inst SetMonitorOutputFunction bYarBOOL1 4bExecute bDone bVarBOOL2 0 4usiNode bEma 1 4usichannal iIErrarMurmber 1 Ausivalue Page 38 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMonitorOutputGain PMCprimo command KM Set monitor output gain Function library Auxiliary Description The analogue auxiliary output is not influenced by the factors of the control algorithm The analogue auxiliary output depends not on the pre setting of the control parameter SetControlWord page 182 The value to be given at the analogue auxiliary output is multiplied with the set value before its output The output signal can be inverted by changing the preceding sign Input variables bExecute BOOL The setting is executed with a change from 0 to 1 0 sets the function block back and the output variables are set to False or O usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system iValue INT The amplification factor As of Primo V2 006 lib diValue DINT Output variables bDone BOOL The function was executed True or is still under operation False bError BOOL True
44. False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The calculated Offset value during wraparound Connected function SetMapOptionsWord MapLinkSlaveToMaster SetScaleMapping SetMapBaseOffset and SetSlaveMapOffset User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST GetWrapAroundOffset bVarBOOL1 BOOL bVarBOOL2 BOOL diValue DINT Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone diValue Inst diValue Example in FBD IMST Ge t rap roundofset bvarBooOL1 bExecute bDone bvarBodonL7 I HusiMade bErrar 1HusiChannel ierrorMumber divalue divalue User Manual PMCprimo SoftPLC Page 99 14 Function library primo lib LengthOfAlignmentMove Page 100 PMCprimo Command XX length of alignment move As of version 2 004 available Function library Mapping Description With this command the necessary alignment move for the position table name can be aquired which are made automatically after the start of the function block ExecuteMap Bit O of MapLinkSlaveToMaster page 127 must be set to 0 Thus it is possible to check the alignment move before the execution of ExecuteMap The function
45. Host usiChannel USINT The axis number from 1 to n depending on the system diValue DINT Offset to be adjusted Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapBaseOffset and SetMapBaseAdvanceTimeConstant Factory setting 0 switched off User Manual PMCprimo SoftPLC Page 123 14 Function library primo lib Examples Declaration INST SetMapBaseOffset bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 3000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 diValue 3000 bVarBOOL2 Inst bDone Example in FBD INST Sethiapbasedttset bYarBOOL1 4beExecute bDone bVarB00L2 qusiMade hErrar 1 4usichannal iIErrarumber 30004diValue Page 124 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMapLinkOptionsWord PMCprimo Command LW Set map link options word Function library Mapping Description With this function block the axle coupling between the slave and master axes is adjusted The adjustment is executed on the slave axis and must be made before definition as slave axis with the function MapLinkSlaveToMaster page 104 With the pre adjustment axle coupli
46. Input Output Firmware Version 2 003 A sub element is added for the communication with a CAN I O extension Automatically global variables are arranged for 64 inputs 8 Bytes and 64 outputs This is also the maximum number of inputs and outputs This storage range is also pre defined if there are not so many input or output modules are available In this case the corresponding Bytes are not occupied Firmware Version gt 2 003 After the sub elemente PMCprimo CAN is added then it is possible to add with the context menu additional inputs and outputs to this element With the menu PMCprimo CAN Input Output 8 inputs and 8 outputs are added The maximum number is 256 inputs and 256 outputs Only one bus coupler is supported with 256 inputs and outputs If a second sub element PMCprimo CAN is added then it is ignored Profibus DP enhanced Master A sub element for the Profibus DP Master card is included This card can be installed into the PMCprimo 2 2 or 16 as option and can be used for communication with further input output modules HMl units or further Profibus units If you click with the right mouse button over the list entry Profibus DP enhanced Master a context menu with possible Profibus units appears This information is taken from the GSD files In order to install new GSD files copy the files to C Codesysforautomationalliance library plcconf or into the installation list given by you With the next start of the programming t
47. Inputs Module id 3 Hostlnput2 AT 11 WORD Bank 3 Inputs 1 eee ra HostOutput AT QW0 WORD Bank 1 2 Outr HostOutput2 AT 96QW1 WORD Bank 3 Output Input address J iPrimo Node npulOutpulVAR mm Output address RUE _ Nodelnput1 AT 962 WORD Bank 1 2 Inputs Nodelnput2 AT 96W3 WORD Bank 3 Inputs 1 Dunes ase i NodeOutput1 AT 9602 WORD Bank 1 2 Out NodeOutput2 AT 96 QW3 WORD Bank 3 Outpt fff PLC Configuration E PLC Configuration Module Primo BLOT Base parameters Primo Host Input Output SLOT i Hostinputl AT WD WORD Bank 1 2 Inputs Hostnput2 AT 1 WORD Bank 3 Inputs 1 Comment Bank 3 Inputs 1 8 HostOutput1 AT 96 QVy0 WORD Bank 1 2 Out B Channekd 1002 HostOutput2 AT 96QW1 WORD Bank 3 Outpul Class Size 16 F NodeOutput AT 95QW2 WORD Bank 1 2 Out Default identifier Nodelnput2 L NodeOutput2 AT 96 QWW3 WORD Bank 3 Outpt Primo Node Input Output VAR F iRec Input2 AT IW5 WORD Bank 3 Inputs 1 Rect Output AT WAWA WORD Bank 1 2 Out L Rerc1 Output AT 96 Q5 WORD Bank 3 Outpu Illustration 3 Renamed inputs User Manual PMCprimo SoftPLC Page 15 11 5 11 6 Page 16 11 Control configuration When the right mouse button is pressed via PLC configuration another context menu appears in which further modules can be added Following modules are currently supported PMCprimo CAN
48. Notes for the function library primo lib The PLC Function blocks call the corresponding PMCprimo commands Every function block has an input bExecute The corresponding action is started with an rising edge from 0 to 1 in PMCprimo Is the input bExecute on 0 the function block is relocated Every function block has three output variables bDone Signals True back if the action is completed False if the action is still under operation bError If an error has occurred TRUE is signalled back here iErrorNumber Should bError be TRUE then an error number is signalled back here which specifies the error in details The PMCprimo function library is divided in several sub files This subdivision only serves for clearness and does not have any effect on the integration in a PLC program Bibliotheksverwalter etandard lib 10 4 02 08 56 12 lecSfc lib 23 10 00 15 20 32 zu Margeteiprimoiprimoa lib 2 7 5 02 inl x FUNCTION BLOCK ExecuteSequence VAR_INPLT bExecute BOOL shame STRING EMD VAR VAR OUITPLIT bDone BOOL bError BOOL J Bausteine iErrarNumber INT Ausiliary END VAR on i Busv arables b CAN Display Llr Drive Encoder Mapping Output Position control Positioning EXECUTESEQUENCE Referencing Tension I ExecuteSequence FE E PrimoCommand FUN iErrorMumber Illustration 7 PMCprimo Function library User Manual PMCprimo SoftPLC Page 29 14 Function l
49. PMCprimo SoftPLC Page 117 14 Function library primo lib Examples Declaration INST SetClutchTime bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiPercent 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiPercent 100 bVarBOOL2 Inst bDone Example in FBD INST GetMapAdjustmentvelocity BvarBOO0L1 BExecute bDone bVarB00L2 0 zusiMode hErrar 1HusiChannel iErrar lumbar 100usiPercent Page 118 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMapBaseAdvance PMCprimo Command BA Set map base advance Function library Mapping Description With this function block an offset of the master position set with a SetMapBaseOffset see page 123 can be provided with a velocity dependent phase shifting masterspeed BA RE ee 256 256 map base advance The velocity of the master axis is indicated in increments second for example a phase shifting of 30 increments is the result with a velocity of 10 000 increments second and a SetMapBaseAdvance value of 200 The velocity of the master axis can be averaged temporally For that the function and SetMapBaseAdvanceTimeConstant exists with which the time for determination average velocity can be set This factor can also be considered as set time A value of 1 corresponds to 15 625 microseconds A phase shifting of 64 corresponds to
50. PScope can Following Use of signal synchronous CAN display error position channel x 1 Hiperface resolution with NB changeable absolute position SSI encoder see FSO Referencing not possible messages motor current available in loop of PMCprimo PMCtendo DD4 Yes with absolute position PMCprimo Gray code Drive and channel x 1 PMCprimo Drive channel x 1 Hiperface resolution with NB changeable absolute position 7 CAN open encoder see FSO Depending for CAN cycle 1 Yes No relative position 1 2 or 4ms 10 CAN open encoder see FSO Referencing not possible 1 Yes with Yes No absolute position PMCprimo Drive and channel x 1 B B m BEEN Yes with PMCprimo Drive and channel x 1 PMCprimo Drive and channel x 1 PMCprimo Drive see FSO Hardware register lt 1us Yes with channel x 1 resolution with NB changeable resolution of demand speed with DPRam depends from NB setting relative position PMCprimo Drive see FSO Referencing not possible channel x 1 resolution with NB changeable resolution of demand speed with DPRam depends from NB setting absolute position see FS 5 frequency see FSO If PMCprimo Drive Yes with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and 100kHz channel x 1 Not available With SSI encoder 1ms 16 see FS 6 frequency see FSO If PMCprimo Drive Yes with 100kHz channel x 1 PMCprimo Page 80 User
51. Positioning Description With this function block the user can determine the behaviour of PMCprimo with positioning commands In case of Input and Output Bit O stands on the right and Bit 7 on the left side Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiControlword USINT Each Bit has the following meaning Bit 0 reserved Bit 1 Determines if the position bound has an influence on the positioning commands 0 The position bound set with SetPositionBoundn has an influence on the execution of positioning commands 1 The position bound is considered with the execution of an absolute positioning MoveToAbsolutePosition In case of an absolute positioning the axis travels to the position within the position bound which corresponds to the absolute position Example rotary axis travels not 1 5 but 0 5 machine cycles Bit 2 This Bit determines that the starting direction of the absolute setpoint positions is determined at the rotary axes with Bit 3 0 Direction for starting of the setpoint position not defined 1 Direction for starting of the setpoint position can be defined with Bit 3 Bit 3 This Bit determines the starting direction of the setpoint position wi
52. Ser No 441 Version 1 007beta6 Feb 27 2002 15 32 49 Operate Mode STANDALONE MOTION INSTALLED SOFTPLC INSTALLED Date of Project 2002 03 13 Project Sample pro Title Sampleproject Version 1 0 Author Max Mustermann Description Sampleproject for documentation Channel 0 1 found Channel 0 2 found Channel 0 3 found RESTORING DATA 0 1 0 2 0 3 0 1 READY RESTORING DATA 0 1 Page 24 User Manual PMCprimo SoftPLC 13 SoftPLC in PMCprimo 13 2 Non transient storage Completely there are 256KB of a non transient flash storage for programs available This storage is used for half of PMCprimo programs and PLC programs each Therefore the PLC program can be 128KB big the maximum As of Firmware version 1 008c with PMCprimo command CD the available storage for PLC programs can be set For detailed information please refer to the PMCprimo reference manual Example 0 1 CD 0 1 Actual configuration Operate Mode STANDALONE Actual IP address 10 10 180 100 Actual Netmask 255 255 0 0 Fieldbus In Out length 50 words Fieldbus In Out offset 0 Channel 5 disabled RS 232 Software Handshake Xon Xoff CAN Cycle time 2 ms CAN node address 0 Flashmemory for SoftPLC 128KB Startup delay Os HEHE RE HERE HEHE EHEHEHEH kk kk kk kk ko kk kk kk kk kk kk ko ko Exit menu Change operating mode Delete application data Change CANbus configuration Change Ethernet Change in out length for Fie
53. VT StopMotorToPosition SetVelocity SetWindow SetTimeoutForWindow 194 TransferMapData 139 242 244 240 200 74 SV Wo de i TM TO SetEncoderTimeout W 1 1 Undefineinput 282 UL 171 UninkSlaveToMastr 140 o A UndefineOutput 173 vC jMoveConstanVeloiy 218 VH SetVeloityOutputHysteresis 172 VJ SetSlowSpeedMode 238 VM SetVirtualMotorMode 198 vo DefmeVelciyOuput 164 INT ooo SetVelocityAveragingTime 65 302 303 304 WR 305 306 226 287 309 co N Page 314 User Manual PMCprimo SoftPLC 17 Index 17 Index A AbortMotor nnns 201 acceleration feed forward 175 analogue control sees 289 PAIS IR se srccaaatstaradanonsdatanseacasnebuepasanerecasanenadananaaeceaancis 34 C CalculatelnitialRatiO 285 CANNetworkPositionControlDrive 45 CANPositionControlDrive 45 D DefineAnalogueLimitErrorOutput 141 DefineAuxiliaryOUtput 35 DefineBoundOverflowOutput 143 DefineMap enne nnn 90 DefineMotorErrorOutput 145 DefineOutsideWindowOutput 147 DefinePositionSnapshot 249 DefinePositionTriggerOutput
54. a variable with this function block The unit of the actual position is increment Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact the error cause see GetError page203 diValue DINT The actual position Also refer to DisplayDemandPosition und DisplayFollowingError Examples Declaration INST DisplayActualPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Examplel in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DISPLAYACTUALPOSITION User Manual PMCprimo SoftPLC 14 Function library primo lib DisplayAnaloguelnput PMCprimo command DA Display analogue input Function library Display Description The current value of the analogue input is indicated with this function block The value range is 2047 This corresponds to
55. and the output variables are set to False or 0 except diValue iNummer INT The number of the variable from 1 to 108 Output variables bDone BOOL The value was read True or it is still under operation False e bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The actual value of the BusVariable Connected functions SetBusVariable User Manual PMCprimo SoftPLC Page 41 14 Function library primo lib Examples Declaration INST GetBusVariable bVarBOOL1 BOOL bVarBOOL2 BOOL diValue DINT Example in IL CALINST bExecute bVarBOOL1 iNumber 2 LD INST bDone ST bVarBOOL2 EQ TRUE NOT JMPC else1 O0 LD INST diValue ST diValue else1 0 Example in ST Inst bExecute bVarBOOL1 iNumber 2 bVarBool2 Inst bDone IF bVarBool2 TRUE THEN diValue Inst diValue END_IF Example in FBD Inst GetBusvariable bvarBooOL1 bExecute 2 User Manual PMCprimo SoftPLC Page 42 14 Function library primo lib SetBusVariable PMCprimo command B1 B108 value Function library BusVariables Description The PLC can transmit a value to the BusVariable with this function block This BusVariable can be defined as TriggerVariable and is therefore able to call a PMCprimo program Input variables bExecute BOOL The setting is executed with a change from 0 to 1 0 places the function
56. axis stands and a control of the velocity ratio is possible In this case it is necessary to block the l part to prevent that a big web tension distance adds itself and effects a step response during start of the motor 0 The integral factor is blocked 1 The integral factor is released Bit 3 This Bit determines with which transmission ratio the web tension control is activated 0 The initial transmission ratio is the value of the module SetScaleMapping 1 The initial transmission ratio is the actual transmission ratio Normally it is the instantaneous transmission ratio determined the last before stop of the slave axis Bit4 This Bit releases the automatic initialisation between the upper and lower limit value at the slave axis during activation of a position allocation with a web tension control see also SetAnalogueRangeDistance and ExecuteAnalogueDistancelnit for detail information 0 The automatic initialisation of the transmission ratio with the upper and lower limit values is not released at the slave axis 1 The automatic initialisation of the transmission ratio with the upper and lower limit values is released at the slave axis Bit 5 This Bit releases the automatic initialisation between the upper and lower limit values at the master axis during activation of a position allocation with web tension control see also SetAnalogueRangeDistance and ExecuteAnalogueDistancelnit for Detail information This function is also
57. counter If the position counter reaches the value the function block bDone is set to TRUE Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue UINT Relative position for waiting Output variables bDone BOOL No more waiting True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Example INST WaitForRelativePosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 3000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 3000 bVarBOOL2 Inst bDone Example in FDB INST WWaitFarRaelativePasitian BvarBOOL1 B5Execute bDone bVarB00L2 dusiMade hErrar 1 4usiChannel iErrarMumhear 230004div alue User Manual PMCprimo SoftPLC Page 305 14 Function library primo lib WaitForStatusMotor PMCprimo Befehl WS Wait for motor status Function library Wait Available as of version 2 000 Description INST bDone changes to TRUE if the specified channels goes to state given by INST diValue bVarBo
58. counts If the SetPositionBound value is less than the high limit then the high position limit checking is disabled as the absolute position value wraps around to zero at the bound position before reaching the high limit position Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system diValue DINT The software end position 4 000 000 increments As of version 2 004 new range 2 000 000 000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetLowPositionLimit Factory setting 4 000 000 increments Examples Declaration INST SetHighPositionLimit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 4000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 4000 bVarBOOL2 Inst bDone Example in FBD INST SetHighFositionLimit bVarBO0L1HbExecute bDone BhvarBOooL7 Il HusiMade bError 1HusiChannel ierrorkumber 40004di alue
59. diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiCanNetwork USINT 0 PMCtendo DD4 in CAN Net command must execute on the host node 1 PMCtendo DD4 in CANOpen usiCanNode USINT The CAN node address 1 to 61 sCommand String The PMCtendo DD4 ASCII Command Output variables BDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT A possible value from the servo controller depending on the used command User Manual PMCprimo SoftPLC Page 67 14 Function library primo lib Examples Declaration ASCIIToDrive1 ASCIItoDrive bExecute2 BOOL bError2 BOOL iErrorNumber2 INT BDone2 BOOL Example in IL CAL ASCIIToDrive1 bExecute bExecute2 usiNode 0 usiChannel 1 usiCanNetwork 0 usiCanNode 5 LD ASCIIToDrive1 bDone ST bDone2 Example in ST ASCIIToDrive1 bExecute bExecute2 usiNode 0 usiChannel 1 usiCanNetwork 0 usiCanNode 5 bDone2 ASCIIToDrive1 bDone Example in FBD ASGITODrive ASCITODrve bExecute2z bExecute Il 1usiMade 1qusiChannel 0 4usiCanMetwork 5 1usiCanMacde Page 68 User Manual PMCprimo SoftPLC 14 Function library primo lib 14 10 Encoder DefineZero
60. energised The input of the path for encoder signals is made in the unit increments Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The monitoring time or way Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetcontrolWord Factory setting 500 Milliseconds User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetEncoderTimeout bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1000 bVarBool2 Inst bDone Example in FBD INST aetEncaderTimeaut BvarBOOL1 BbExecute bDone bVarBOOL2 0 4usiNode bEma 1 4usichannal ierrorMumber 1000 uiValue User Manual PMCprimo SoftPLC Page 75 14 Function library primo lib SetFeedbackEncoder PMCprimo command FS Feedback set encoder type Page 76 Fun
61. from O to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiGain UINT The control factor from 0 up to 65535 Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnaloguelntegralGain SetAnalogueProportianalGain und SetAnalogueControlMode Factory setting 0 switched off Examples INST SetAnalogueDifferentialGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 100 bVarBOOL2 Inst bDone Example in FDB INST aet amp nalagueDifferentialGain bvarBOOL1 bExecute bDone bVarBOOL2 JusiMade HEnglm 7 1qusiChannel ierrortMumber 1004HuiGain User Manual PMCprimo SoftPLC Page 295 14 Function library primo lib SetAnaloguelnputHighLimit PMCprimo Command AH Set analogue input high limit Function library Tension Description With this funciton module a permissible upper limit can be set for the analogue input In case the value of the analogue input e
62. function block The following error is the difference between demand position and actual position The unit is increments Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL e Value has been read True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The actual following error Also refer to DisplayActualPosition und DisplayDemandPosition Examples Declaration INST DisplayFollowingError bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayFallawingErrar bYarBOOL 4bExecute boone b varBOOL2i UsusiMode hErrar 14usichannal iErrorMumber divalue diValue User Manual PMCprimo SoftPLC Page 55 14 Function library primo lib DisplayPositionOverflowCounter PMCprimo command BC Set position ove
63. function block SetControlWord if it is accelerated trapezoidally or sinusoidally The motor accelerates with the accelerate value of SetAcceleration page 227 and stops with the ramp of SetDeceleration page232 The travel velocity is defined with the function block SetVelocity page 240 The position is indicated in increments When using MoveToAbsolutePosition for cyclic axes see also function block SetPositionBound page 133 It is possible to complete a position allocation function block ExecuteMap with this module It can be determined via Bit 6 of SetMapOptionsWord page 127 if it is moved with the actual or with the 6 velocity defined by SetVelocity to the specified position If Bit 2 of SetMoveOptionsWord is not set the instantaneous cycle is not left during uncoupling If necessary it is stopped and travelled to the demand position in an opposite direction If Bit 2 of SetMoveOptionsWord see page 234 is set the direction defined with Bit 3 is always kept If this does not coincide with the instantaneous direction it is modified If Bit 1 of SetMoveOptionsWord is set the shortest way is always travelled Enhancement as of version 1 008a While clutching out of a map with MoveToAbsolutePosition the actual velocity is compared with SetSlowSpeed If the velocity of the slave is lower resp equal SetSlowSpeed than SetVelocity is used 6000 Q Velocity Increments s H5400 4800 4200 H3600
64. functions SetFeedbackEncoder Factory setting CANPositionControlDrive PD 500 KBit MBIE 3 4 2ms 1 ms The setting is executed with a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 The node number in the linked system O if only one unit or Host The axis number from 1 to n depending on the system The CAN node address of the PMCtendo DD4 0 stops the connection The function was executed True or it is still under operation False True an error has occurred False no error Indicates the exact error cause see GetError page 203 0 no connection User Manual PMCprimo SoftPLC 14 Function library primo lib With version 2 003 a new function block CANNetworkPositionControlDrive is available This block has an additional input for choosing the CAN network with PMCprimo 2 2 16 and PMCprimo Drive2 Additional input variable usiCanNetwork 0 CAN main network 1 CAN at expansion board or second CAN controller Example Declaration INST CANPositionControlDrive bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChanel 1 usiCanNode 4 LD INST bDone ST bVarBOOL2 Example in ST Inst bExecute bVarBOOL 1 usiNode 0 usiChanel 1 usiCanNode 4 bVarBool2 Inst bDone Example in FBD Inst cAMPositionContralDrive 2000 bvarBooOL1 bExecute bDone bv arBOOLZ u I HusiMade bErrar 1Husi
65. incremented or decremented when either the output is set or reset by PMCprimo If it is an up counter its initial value is zero and its final value is given by the count parameter If it is a down counter its initial value is the count parameter and its final value is zero On the first count the output line is set to true and the counter is started and set to its initial value When the count is incremented or decremented to its final value the output line is reset false and the counter is stopped and reset to its initial value The counter can only activated User Manual PMCprimo SoftPLC Page 161 Page 162 14 Function library primo lib by a outputdefinition of PMCprimo In timer modes the timer is triggered in the same way as in counter mode but once triggered it counts once per tick until the final count is reached The output line is set true when the timer is triggered and is reset false when the timer reaches the final count In one shot modes the timer counter behaves as described above In cyclic modes it operates in a slightly different way When the timer counter reaches its final count the output line is toggled to its opposite state the counter timer is reset to its initial value and continues to run The output line changes state each time the counter timer reaches its final count Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variabl
66. installation manual Input variables bExecute BOOL The position control is activated in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Position control is active True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function MotorOff und GlobalOff Factory setting Release switched off Examples Declaration INST EnablePositionControl bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST EnablePasitianCantral bYarBOOL1 4bExecute bDone BvarBooOLb d usiMode bError 1HusiChannel iErrar lumbar Page 176 User Manual PMCprimo SoftPLC 14 Function library primo lib GlobalOff User Manual PMCprimo SoftPLC PMCprimo Command GF Global motor off Function library Positioncontrol Description All motors are switched off This function block is an all axis global MotorOff page 177 Input variables bExecute BOOL All
67. jump offsets verwenden F eserved Register 2 None z Output mode Base register for library data Nothing None Defaut Cancel Illustration 1 target system Here CoDeSys for Primo must be set and then the OK switching section must be clicked Normally no further settings required Afterwards this window appears in which the first module PLC PRG as a Program is defined File Edit Project Insert Extras Online Window Help 2 38 eji esee e New POU Name of the new POU PePe Type of the POU Program C Function Block C Function Return Type OOOO fene pv Reip Illustration 2 module PLC PRG The next you should define the control configuration It is made in the resources In addition to this click the right card tab below on the right and then click twice on the control configuration User Manual PMCprimo SoftPLC Page 13 11 Control configuration 11 Control configuration The connected Hardware is defined in the control configuration First of all automatically the Host is registered after preparation of a new project For this 4 global variables Hostlnput1 Hostlnput2 HostOutput1 and HostOutput2 are defined The variables have different meanings dependent on the Hardware 11 1 PMCprimo Drive Version 2 004 Hostlnput1 Word corresponds to 12 digital inputs the remaining 4 Bits are not used Hostlnput2 Word presents 8 virtual inputs the remaining 8 Bits are n
68. lib Examples Example in IL Declaration INST DefineReferencelnput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usilnput 2 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usilnput 2 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DLefineReferencelnput bVarB00L1 bDone bVarB00L2 hErrar iErrar lumber ao hi s Page 252 User Manual PMCprimo SoftPLC 14 Function library primo lib SetFilterOnReference PMCprimo Command FR Set filter on reference error Function library Referencing Description With this function block a filter can be set for a reference error With SetFilterOnReference 0 there is no filter active PMCprimo ignores reference errors which are bigger than SetFilterOnReference completely in case of values SetFilterOnReference 0 The function block is used for the filtering reference signals which are outside of the permissible range to be expected This module SetFilterOnReference is independent on the function X block SetMaxReferenceCorrection page 255 SetMaxReferenceCorrection limits the correction value which is corrected in case of a reference error at the motor Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the outp
69. node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiGain UINT The control factor from 0 to 65535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetAccelerationFeedForwardGain SetDifferentialGain SetlntegralGain SetProportionalGain und SetVelocityFeedForwardGain Factory setting 0 switched off Examples Declaration INST SetVelocityFeedbackGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 150 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 150 bVarBOOL2 Inst bDone Example in FBD INST agtvaelacityFeedbacktiain BvarBOOL1 BvarBOoO0L2 0 150 User Manual PMCprimo SoftPLC Page 195 14 Function library primo lib SetVelocityFeedForwardGain Page 196 PMCprimo Command KF Set velocity feed forward gain constant Function library Positioncontrol Description With this function block the setpoint factor of the control algorithm is set The setpoint factor influences the difference between the set velocity and the measured actual velocity In case of a pure proportional contro
70. number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiDistance UINT The distance from 0 to 65535 Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueRangeDistance und SetAnalogueControlMode Factory setting 256 increments Examples INST SetAnalogueMasterRangeDistance bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiDistance 5000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiDistance 5000 bVarBOOL2 Inst bDone Example in FDB INST setanalogueMasterRangeDistance 11 BvarBOOL1 BbExecute barBOOLz I HusiMaode 1HusiChannel S000 uiDistance User Manual PMCprimo SoftPLC Page 299 14 Function library primo lib SetAnalogueProportianalGain PMCprimo Command AP Set analogue control proportional gain Function library Tension Description With this function module the proportional factor of the control algorithm is set for the analogue control A big value of the AP factor allows a short reaction time and an exact analogue control Therefore the AP factor should be set as high as possible without generati
71. of the control algorithm is set The integral factor is useful in order to compensate a constant position error due to a continuous load and oscillations or with a velocity control The integral factor however also effects that the axis goes beyond the target position in case of a positioning as the position error which arises during a movement can accumulate This problem is also known as gt wind up lt Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiGain UINT The control factor from 0 to 65535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetProportionalGain SetAccelerationFeedForwardGain SetDifferentialGain SetVelocityFeedbackGain und SetVelocityFeedForwardGain Factory setting 0 switched off Examples Declaration INST SetIntegralGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 4000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usi
72. resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system diPosition DINT The absolute target position in increments in the range of 4 000 000 Version 2 004 new range 2 000 000 000 Output variables bDone BOOL Axis has been stopped True or axis is braking at the moment False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions MoveConstantVelocity MoveRelativePosition ExecuteMap InitialisePosition InitialisePositionBounds and MoveToAbsolutePosition Page 244 User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST StopMotorToPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diPosition 3000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diPosition 3000 bVarBOOL2 Inst bDone Example in FBD INST StopMotorToPosition bVarb00L1HbExecute bDone BbvarBOooOL 7 Il HusiMade bErrar 1HusiChannel ierrorMumber 30004diFosition User Manual PMCprimo SoftPLC Page 245 14 Function library primo lib 14 15 Referencing Activation and adjustment of the reference beh
73. the system udiValue UDINT The velocity from 0 to 4 000 000 increments s Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetSlowSpeedMode MoveConstantVelocity MoveRelativePosition and MoveToAbsolutePosition Factory setting 20 000 Increments s User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST SetVelocity bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 20000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 20000 bVarBOOL2 Inst bDone Example in FBD INST cetelocity bVarBO00L1HbExecute BvarBOOoL 2 dusiMade 1 4usiChannel ierrorMumber 200004udi Value User Manual PMCprimo SoftPLC Page 241 StopMotor Page 242 14 Function library primo lib PMCprimo Command ST Stop Function library Positioning Description The motor decelerates the specified ramp down to the velocity 0 with the function block SetDeceleration page 232 This function block can be used with each movement PMCprimo signals S during the deceleration process ST command x Illustration 32 End of movement with ST
74. to False or 0 The node number in the linked system O if only one unit or Host The axis number from 1 to n depending on the system 1 to 4 3 and 4 is virtual The output number from 1 to 8 The polarity O positive 1 negative Output has been written True or it is still under operation False True an error has occurred False no error Indicates the exact error cause see GetError page 203 DefinePositionTriggerOutput and SetVelocityAveragingTime Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetPhaseAdvanceFactor bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD IMST SetPhaseAdvanceFactor bVarbo00L1HbExecute bDone bYarbOOL usiNade bErrar usichannal iErrarMumhear usiBank usiOutput uivaluae ao ms cu User Manual PMCprimo SoftPLC Page 169 14 Function library primo lib SetPositionOutputHysteresis Page 170 PMCprimo Command PH Position Output Hysteresis Function library Output Description This function block can be used for an extension of the function block DefinePositionTriggerOutput A hysteresis is add
75. version 2 000 6 This extension operates only with PMCtendo DD4 version 4 94 and higher SetFeedbackEncoder 21 22 and 23 demand position with CANBus The position control is made by PMCtendo DD4 The position control of PMCprimo SetProportionalGainConstant SetVelocityFeed ForwardGain constant etc is not in use With SetFeedbackEncoder 21 and 22 the latch function of PMCtendo DD4 can be activate Therefore the drive command IN2MODE must set to 26 and reference input is input 2 of PMCtendo DD4 SAVE COLDSTART must be made The solution can set with the function block SetNumberOfBits command page 83 SetNumberOfBits 24 means 4096 increments per revolution The rolling direction can be set with bit 5 of function block SetControlWord page 182 With SetFeedbackEncoder 21 and 22 the referencing is supported completely InitialisePosition SetContinuousReferenceMode SetReferenceOptionsWord SetReferenceFilterOptionsWord SetReferenceFalseHighLimit SetReferenceFalseLowLimit SetReferenceTrueHighLimit SetReferenceTrueLowLimit There must set no DefineZeroMarkerlnput or DefineReferencelnput With FS21 or 22 no reference input of PMCprimo is allocated but referencing can be made Tip With every PC command the actual position of the drive is read and the position counter of PMCprimo is set to it If the motor is moved manhandled the change is seen after the next PC command Therfore the position is not lost After first switch on it isn t
76. with function block SetVelocity The position is indicated in increments When using MoveRelativePosition f r rotary axes see also function block SetPositionBound PMCprimo signals the command execution with the sign M Travel commands can only be executed with an active position control loop A relative positioning is independent on the Bits 1 3 of the function block SetMoveOptionsWord During an execution of this function the value of the velocity set with the function blocks SetVelocity or SetSlowSpeed can be modified The switchover of the velocity step can take place with the module SetSlowSpeedMode at any time however the value for SetSlowSpeed must always be smaller than the value of SetVelocity The target position is checked before the execution of a travelling command as to the observance of the software limits function blocks SetLowPositionLimit and SetHighPositionLimit In case the target position is outside of the software limits The travelling command is not executed and PMCprimo signals the error target position is outside of the software limits It is possible to leave a position allocation see function block ExecuteMap page 92 with the function MoveRelativePosition Input variables bExecute BOOL The movement is started in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host
77. written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The brake ramp of 1000 to 2 000 000 000 increments second Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions AbortMotor Factory setting 1 000 000 increments second Examples Declaration INST SetAbortDeceleration bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 1000000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 1000000 bVarBOOL2 Inst bDone Example in FBD INST SetAbotDecelaration BvarBOOL1 bDone BvarBOoOLZ i hErrar 1 Ausichannel ierrorMumber 1000000Hudi alue Page 226 User Manual PMCprimo SoftPLC 14 Function library primo lib SetAcceleration PMCprimo Command SA Set acceleration Function library Positioning Description This function block is used to specify the acceleration value in increments second The acceleration value can be modified at any time The lowe
78. 0 if only one unit or Host usiAtChannel USINT The axis number from 1 to n depending on the system diValue DINT The position of the other axis in the range of 4 000 000 increments Output variables bDone BOOL Value is written True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceOptionsWord SetReferenceMode Factory setting not defined User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetReferencePositionAtOtherPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiAtNode 0 usiAtChannel 2 diPosition 3000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiAtNode 0 usiAtChannel 2 diPosition 3000 bVarBOOL2 Inst bDone Example in FBD INST ogtkeferencePoasitian amp totherPoasition b arBOOL1 JhExecute bvarBOOL2 Dn usiMnde Rea 0 4usiChannel Uusiattode z usi tChannel S000 diPosition User Manual PMCprimo SoftPLC Page 277 14 Function library primo lib SetReferenceRepeatLength Page 278 PMCprimo Command RL Set reference repeat length Function library Referencing Description With this function block a reference position bound can be set
79. 2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST D etineMatarErraroutput BvarBOaOL1 BbExecute bDone BvarBOoOLb 7 usiNode hErrar usiChannel ierroriMumber usiBank usiQutput usiPolarity ao ms I Page 146 User Manual PMCprimo SoftPLC 14 Function library primo lib DefineOutsideWindowOutput PMCprimo Command OW Define outside window output Function library Output Description This function block defines an output for watching position error If the position error is bigger than SetWindow page 200 the output is set reset A line which has been defined as an outside window output may be returned to normal operation by entering this command without the sign Input variables bExecute BOOL The output is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber
80. 2 With optional expansion board Ethernet otherwise only serial communication Ethernet An IP address must be set in the control and the option Ethernet must be released via a Softwarekey The option Ethernet is always released with PMCprimo 16 and PMCprimo Drive2 No Softwarekey is necessary This is done by means of a PMCprimo CD and SK Command 0 1 SK RETURN 0 1 Series number 000102 Installed Softwarekeys Motion 49a84d Ethernet 03fce7 SOFLEPLhC 1 6195 New Key The control must be switched OFF and ON after the option Ethernet has been released 0 1 cd return Ds qus Actual configuration Operate Mode STANDALONE Actual IP address 192 168 0 6 Actual Netmask 255 255 25540 Fieldbus Address 4 Fieldbus In Out length 50 words Fieldbus In Out offset O0 RS 232 Software Handshake Xon Xoff R5 422 point to point CAN Cycle time 1 ms CAN node address 0 CAN baudrate 500 Kbit Startup delay Os Display mode channel state Ck Cock ck ckck ckck Kock ckock ck ckck kock kock ckokck kck kck ckock k ck ck kk kk Page 20 User Manual PMCprimo SoftPLC 12 Communication with the control Exit menu Change operating mode Delete application data Change CANbus configuration Change Ethernet Change in out length for Fieldbus Change offset for Fieldbus CAN Cycle time CAN node number Change Fieldbus address Change number of channels oOo o DUI RAe UNEO PRR WN H Change time and date Ch
81. 296 User Manual PMCprimo SoftPLC 14 Function library primo lib SetAnaloguelnputLowLimit PMCprimo Command AL Set analogue input low limit Function library Tension Description With this funciton module a permissible lower limit can be set for the analogue input In case the value of the analogue input falls below of this value PMCprimo issues a corresponding error signal If the Bit 3 of the module SetErrorOptionsWord is set to 1 the exceeding of the lower limit is evaluated as motor OFF error Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diLimit DINT The limit value of 2 147 483 648 up to 2 147 483 647 2047 corresponds to 10V it the analogue input is used Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnaloguelnputHighLimit und SetAnalogueControlMode Factory setting 2000 Examples INST SetAnaloguelnputLowL imit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diLimit 1000 LD IN
82. 3 UnlinkSlaveToMaster 140 V velocity feedbaCk 175 velocity feed forward 175 velocity feed forward gain 196 W WaitEndState 302 WaitForAbsolutePositioN 303 WaitForBoundPosition 304 WaitForRelativePosition 305 WaitForStatusMotor 306 User Manual PMCprimo SoftPLC pu bwwW In many countries we are www pilz com represented by our subsidiaries and sales partners gt Technical support Please refer to our Homepage 49 711 3409 444 for further details or contact our headquarters Pilz GmbH amp Co KG Sichere Automation Felix Wankel StraBe 2 73760 Ostfildern Germany Telephone 49 711 3409 0 more than automation ly S Telefax 449 711 3409 133 Reng E Mail pilz gmbh pilz de safe automation 21 471 06 2007 03 Printed in Germany
83. 5 usiPolarity 0 diPosition1 0 diPosition2 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 diPosition1 0 diPosition2 1000 bVarBOOL2 Inst bDone Example in FBD INST DefineFasitianTriggeroutput BvarBOoOL1 bDone bVarB00L2 T bError iErrarMumhear 1 5 T 0 1000 User Manual PMCprimo SoftPLC 14 Function library primo lib DefineReferenceAcceptedOutput PMCprimo Command RA Define reference accepted output Function library Output Description With this function block a pulse output can be activated when recognising a valid reference input signal If PMCprimo recognises the signal of a reference input as valid PMCprimo gives a pulse of 1ms to the defined output The polarity indicates the signal level of the output with the pulse output This function can be used for example to recognise products as ok if the function blocks SetReferenceFalseHighLimit SetReferenceFalseLowLimit SetReferenceTrueHighLimit and SetReferenceTrueLowLimit page 266 are used The pulse output is also executed during initialisation with InitialisePosition and InitialisePositionBounds Input variables bExecute BOOL The output is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host
84. BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 500000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 500000 bVarBOOL2 Inst bDone Example in FBD INST cetReferenceAcceleration BpvarBooL1 BExecute BpvarBooLZ I 1usiMade 1qusiChannel ierroriNumber 5000004 udi Value User Manual PMCprimo SoftPLC Page 257 14 Function library primo lib SetReferenceAdvanceFactor Page 258 PMCprimo Command RN Function library Referencing Description This function block is used to realise a shift dependent on the velocity of the referencing signal This can be necessary if the used sensor switches only slowly and therefore the measured position depends on the velocity The calculation occurs according to the following formula calculation as with PA and BA demand velocity RN Displacement 65536 The value is a time which results from the calculation 1 ms corresponds to the value 64 As a result the shift can be adjusted in steps of 15 625 micro seconds The average of the setpoint velocity is used for the calculation The time interval set with the function block SetVelocityAveragingTime is used Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node nu
85. BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceFilterOptionWord SetReferenceFalseLowLimit SetReferenceFalseHighLimit SetReferenceTrueLowLimit und SetReferenceTrueHighLimit Factory setting 0 switched off Examples Declaration INST SetReferenceFalseHighLimit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 500 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 500 bVarBOOL2 Inst bDone Example in FBD INST SethieferenceF alseHighLimit BvarBaoL1 BExecute boone barid qQusiMade hErrar 14usichannal ierrorMumber 500Hui Value User Manual PMCprimo SoftPLC Page 265 SetReferenceTrueHighLimit PMCprimo Command ZH Set reference input true high limit see SetReferenceFalseHighLimit on page 264 SetReferenceTrueLowLimit PMCprimo Command ZL Set reference input true low limit see SetReferenceFalseHighLimit on page 264 SetReferenceFalseLowLimit PMCprimo Command FL Set reference input true low limit see SetReferenceFalseHighLimit on page 264 Page 266 14 Function library primo lib User Manual PMCprimo SoftPLC 14 Function library primo lib SetReferenceFilterOptionWor
86. Bit determines if a necessary compensating movement for example after introduction of SetMapBaseOffset or SetSlaveMapOffset is independent or dependent on the set position bound Example The axis position is 10000 increments and the position bound is 10000 increments In case of an input of SetMapBaseOffset 20000 there is a compensating movement of 0 increments when Bit 1 is set O The position bound does not have any influence to a compensating movement 1 The position bound is considered when executing a compensating movement Always the shorter compensating drive is selected This Bit determines if the demand position is only driven in the direction selected by Bit 3 when activating a position allocation 0 Direction for starting the demand position not defined 1 Direction for starting the demand position can be defined with Bit 3 This Bit determines the starting direction of the demand position when activating a position allocation in case Bit 2 is set to 1 0 The correction movement is executed in a positive direction 1 The correction movement is executed in a negative direction User Manual PMCprimo SoftPLC Page 127 Page 128 14 Function library primo lib Bit 4 Selection between position allocation and velocity allocation A velocity allocation is meaningful when the absolute position allocation is without meaning 0 Position allocation 1 Velocity allocation Enhancement as of version 2 002 The mas
87. C 14 Function library primo lib Examples Declaration INST GetStatus bVarBOOL1 BOOL bVarBOOL2 BOOL diValue DINT Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST biValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone diValue Inst diValue Example in FBD INST Getstatus BvarBooOL1 b5Execute hvarBOooOoL7 04Uusilode 1HusiChannel ierrorNumber di value di value User Manual PMCprimo SoftPLC Page 213 14 Function library primo lib InitialisePosition Page 214 PMCprimo Command IN Initialise position Function library Positioning Description PMCprimo executes an initialisation function so long until a reference signal is recognised During the initialisation PMCprimo signals Execution The motor accelerates to the demand velocity and keeps the same so long constant until PMCprimo detects a reference signal The direction to which the motor drives is specified via an argument The position counter is immediately set to the value of SetReferenceOffset Reference offset page 271 and the motor is stopped Afterwards the motor moves back to the position 0 The function block for the initialisation can also be used with an open position control loop In this case PMCprimo waits for a reference signal and when detecting a reference signal the position counter is s
88. CANNetworkPositionControlDrive PMCprimo command PD positioncontrol to drive Function library CAN Description With this function block one or two PMCtendo DD4 with speed demand values can be controlled via the CANbus in the VMO Modus on the axis 2 and 3 PMCprimo Drive or four PMCtendo DD4 PMCprimo 2 2 The position is read from the encoder input or also via the CANbus It can be set with the function SetFeedbackEncoder page 76 The transmission of the speed demand value is made in a 4 ms step If the actual position is also transmitted via the CAN the actual position is transmitted within this time An interpolation is made in the system in 1ms steps These intermediate values are used for possible slave axes A PMCprimo Drive can still control 2 further axes and therefore a 3 axis system arises The position control parameters are set as with the internal axis and all movement functions are also possible The only difference to an internal axis is the reference function The reference functionality requires an utmost possible exact value If the actual position is transmitted via CAN an exact position measuring is not possible If the reference functionality is required with an axis via CAN either an additional encoder line from the encoder simulation of the servo control to the free encoder input must be arranged or the determined reference position has a temporary inaccuracy As only one additional encoder input is available
89. Channel ierrorMumber 4 usiCanhtode User Manual PMCprimo SoftPLC Page 47 GetCanSDO Page 48 14 Function library primo lib PMCprimo command QR Read SDO Function library CAN Description With this function block PMCprimo can take hold of the object list of a CAN unit per SDO and is therefore able to read actual values or configurate the unit for example The configuration of the parameter must be taken from the user manual of the corresponding network participant The read value can be allocated to a variable Input variables bExecute BOOL The reading function is started with a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiCanNetwork As of version 2 000 0 CAN main network 1 CAN at expansion board or second CAN controller usiCanNode USINT The CAN node address CANopen unit uilndex UINT The index of the object library usiSubIndex USINT The sub index for the access of the object library usiBytes USINT The number of the Bytes 1 to 4 Note The number of the Bytes must coincide with object library of the CAN unit Output variables bDone BOOL The value has been read True or is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The read value Connected functions SetCanSDO User Manual PMCprimo SoftPLC
90. Command The function StopMotor acts only on the instantaneous selected axis The function block GlobalStop page 178 acts axis overlapping Input variables bExecute BOOL The axis is stopped in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Axis has been stopped True or axis is braking at the moment False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions MoveConstantVelocity MoveRelativePosition ExecuteMap InitialisePosition InitialisePositionBounds and MoveToAbsolutePosition User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST StopMotor bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST atapMatar bVarBQ0L1HbExecute bVarB 00 2 04 Uusilode 1 4usichannel ierrorNumber User Manual PMCprimo SoftPLC Page 243 14 Function library primo lib StopMotorToPosition PMCprimo Command STnn Stop Functio
91. Cprimo SoftPLC Page 207 14 Function library primo lib Controller error Phase is missing in the supply voltage Controller error System Software is not ok Controller warning l t step is exceeded Controller warning Pre set ballast capacity is achieved Controller warning Watchdog for extension board PMCprimo has responded Controller warning Phase of the supply voltage is missing Controller warning Hiperface basic setting from motor loaded Controller warning Extension board PMCprimo does not function correctly Error CAN Bus When writing PDO data CAN not operational in Mode 205 eror CANA The CAN Contoler has been sched ue to 100 many ero Error CAN Bus Errors occurred with the SDO transmission Time out Error CAN Bus An error has occurred with the SDO transmission e g number of Bytes wrong 206 ox me WO I emrcANBusErormesssgs Ie message ompemened m ror AN Too many CAN emo CAN Bus sens ms omBemtae 00000 214 anodes nn Firmware version does RT 256 _ Eror Servo contr cannot be senso e CAN e Er Seno onor cannot be senese AR 26 Enoe canus Node guarana eror modem 250 tenton sta ine ima vatry backupmemoy zm Bator backup memor i ot avelabie mne sem 2a Position table Map lt gt has not been sent to axis Command TM a voso 0000000000000 a Enort seo cone A Page 208 User Manual PMCprimo SoftPLC 14 Function library primo lib 227 Data are not availabl
92. DIO DESE 48 GEIE NO erre 203 GetMappedMasterBound 96 CRISI RR A iari 212 GetWrapAroundOffset 98 User Manual PMCprimo SoftPLC s 89 an 177 MOD SIO ie csrl 178 InitialiseDemandOffset 179 InitialisePosition 214 InitialisePositionBOUndS usse 216 INtrodUction i 7 L LengthOfAlignmentMove 100 M ND i 84 MapLinkSlaveToDifferentialMaster 102 MapLinkSlaveToMaster 104 NAPPO lion 84 Master Operation 84 Motiongenerator 106 NOOO eran 180 MoveConstantVelocity 218 MoveRelativePosition 220 MoveToAbsolutePosition 222 P PhaseAdvanceFactor 166 F OSHIOMCOMUNON ME E e E a 175 NIG TOO SAO c 311 R RESCIETO MEG NES 225 Retain Storage ii 26 S 2151916 1 4 E RM glucosio 307 SetAbortDecelaration 226 SELACGEIERAMOM cca ai 227 SetAccelerationFeedForwardGain 181 SetAlignmentAcceleration 109 SetAnalogueControlMode 289 SetAnalogueControlSetPoint 291 SetAnalogueControlWord
93. ER Pointer to Array with the table support value Output variables bDone BOOL Table allocation True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see page 203 Example of a function block from PMotion Wapi Wapi hExecute The function block ST itself is built up in such a way Declaration FUNCTION BLOCK Motion1 VAR INPUT bExecute BOOL END VAR VAR OUTPUT bDone BOOL FALSE bError BOOL iErrorNumber INT END VAR VAR Map1 DefineMap iCount INT diSlavepos ARRAY 1 201 OF DINT END VAR User Manual PMCprimo SoftPLC 14 Function library primo lib Implementation IF bExecute TRUE AND bDone FALSE THEN IF iCount 0 THEN diSlavepos 1 0 diSlavepos 2 0 diSlavepos 200 1000 diSlavepos 201 1000 Map1 bExecute T RUE Map1 sMapName Motion1 Map1 diMasterBound 1 000 Map1 iSteps 201 Map1 pdiSlavepos ADR diSlavepos 1 iCount 1 END_IF Map1 bDone Map1 bDone bError Map1 bError ierrorNumber Map1 iErrorNumber END IF IF bExecute FALSE THEN Map1 bExecute FALSE Map1 Reset FB bDone Map1 bDone bError FALSE iErrorNumber 0 iCount 0 END IF User Manual PMCprimo SoftPLC Page 91 14 Function library primo lib ExecuteMap PMCprimo command XM Execute map Function library Mapping Description With this function block an available position alloca
94. Empfangen 6 Verloren 4 106 Verlust Ca Zeitangaben in Millisek Minimum Bms Maximum ms Mittelwert Gms Ge If the issue appears in such a way then the control is either not connected or the IP address or the netmask are set incorrectly Check which IP address and netmask the PC on which the CoDeSys programming tools runs has This can be made under Windows NT or 2000 with the command IPCONFIG Windows 95 98 and ME with the command WINIPCFG 95 CAWINNT System32 command com C gt ipconfig Windows 2666 IP Konf iguration Ethernetadapter LA N Uerbindung Verbindungsspezifisches DNS Suffix intranet mayr de 255 255 0 0 Ethernetadapter L N Uerbindung 2 Uerbindungsspezifisches DNS Suffix chrmayr lan IP_Adr 10 10 50 44 255 255 8 0 In this case two network cards are installed in the PC The PMCprimo is connected at the first network card and can be set to a IP address of 192 168 0 1 up to 192 168 255 255 The first two digits may not be different as the netmask 255 255 0 0 does not allow this Please contact your system administrator in case of further questions User Manual PMCprimo SoftPLC Page 23 13 SoftPLC in PMCprimo 13 SoftPLC in PMCprimo The functionality of the SoftPLC is implemented in PMCprimo as independent task The used preemptive multitasking operating system always selects this task if tasks with a higher priority are not active As the PLC must always be selected i
95. INT Indicates the exact error cause see GetError page 203 Connected functions SetMaxPositionError SetEncoderTimeout SetHighPositionLimit SetLowPositionLimit and SetErrorOptionsWord The function block UndefineOutput is available for cancelling the output definition Factory setting No output defined User Manual PMCprimo SoftPLC Page 147 14 Function library primo lib Examples Declaration INST DefineOutsideWindowOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DefineQutsidevvindowlutput bVarBQ0L1HbExecute bDone bVarB 002 usiMode bErrar ierrorkumber om DI Page 148 User Manual PMCprimo SoftPLC 14 Function library primo lib DefinePositionTriggerOutput PMCprimo Command PO Define position trigger output Function library Output Description With this function block a digital output can be defined as electronic cam The specified output directs specified signal levels within the position range specified according to the sign If SetPositionBound is set to 1000 and a position trigger output is defined between 0 and 200 for example and it is moved with constant velocity in ne
96. If the module is integrated in the PLC configuration then the Profibus board is used only by the SoftPLC The normal connection to PMCprimo with bus variables B is not used any longer The settings in the configuration menu CD command are not used For the SoftPLC the Profibus board is an expansion of inputs and outputs Profibus Slave IC With the PMCprimo 16 Drive2 it is possible to mount a special Profibus IC With this module maximum 32 bytes input and 32 bytes output data is possible As with the Profibus Slave this board is used normally by PMCprimo with bus variables For this in the configuration menu different settings are used size of data offset and station address It is also possible to enable a direct communication If the module Anybus IC PDP is added to the PLC configuration then the SoftPLC uses this Profibus IC as an input and output expansion The station address has to be set in the corresponding input mask because there is no hardware switch on board The setting for the inputs and outputs works like all other Profibus modules User Manual PMCprimo SoftPLC Page 19 12 Communication with the control 12 Communication with the control 12 1 Kind of connections Two possibilities are available for the communication with the control depending on the used Hardware PMCprimo Drive Only serial communication PMCprimo 2 2 Ethernet and serial communication PMCprimo 16 Ethernet and serial communication PMCprimo Drive
97. Indicates the exact error cause see GetError page 203 Connected functions SetPositionBound The function block UndefineOutput is available for cancelling the output definition Factory setting No output defined User Manual PMCprimo SoftPLC Page 143 14 Function library primo lib Examples Declaration INST DefineBoundOverflowOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DefineBboundOverlowlutput bYarBOOLt BvarBOoOL2 0 5 0 Page 144 User Manual PMCprimo SoftPLC 14 Function library primo lib DefineMotorErrorOutput PMCprimo Command DE Define error output Function library Output Description With this function block a digital output can be defined as error output The specified output directs the specified signal level if PMCprimo has detected an axis error motor OFF In case the position control loop is closed again function block EnablePositionControl the error output is reset In case of the following errors PMCprimo changes the signal level at a defined error output e Following error detected SetMaxPositionError e Monitoring time encoder signals exceeded SetEncoderTimeou
98. L Transmission ratio determined True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueRangeDistance SetAnalogueMasterRange Distance and CalculatelnitialRatio User Manual PMCprimo SoftPLC Page 287 Page 288 14 Function library primo lib Examples Declaration INST ExecuteAnalogueDistancelnit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiMasterSlave 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiMasterSlave 0 bVarBOOL2 Inst bDone Example in FDB INST ExecuteAnalogueDistancelnit BvarBOoOL1 BbExecute bDone bvarBOOLZ dusiMade bEmon 1 4usichannal ierrorMumber qusiMasterSlave User Manual PMCprimo SoftPLC 14 Function library primo lib SetAnalogueControlMode PMCprimo Command AM Set analogue control mode Function library Tension Description This function module releases an analogue control The value 1 means to release web tension control 0 blocks the analogue control The analogue control can be released or blocked at any time The activation of a position allocation with the function module ExecuteMap initiates various actions at the slave axis In case of an enabled web tension control these act
99. Limit SetReferenceTrueHighLimit und SetReferencePosition Factory setting 0 User Manual PMCprimo SoftPLC Page 267 Page 268 14 Function library primo lib Examples Declaration INST SetReferenceFilterOptionWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 111 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 23711 bVarBOOL2 Inst bDone Example in FBD INST GetReferencerFilterOptionyord bYarBOOL1 4bExecute bDone BvarBOooOL du siMade hErrar 1 4usichannal iErrar lumber 2 11H usiControlword User Manual PMCprimo SoftPLC 14 Function library primo lib SetReferenceHoldoffTime PMCprimo Command RH Set reference holdoff time Function library Referencing Description With this function block a debouncing time can be set for a reference signal PMCprimo only accepts the next reference signal after timeout of this switch off delay Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The filter time from 0 up to 127 milliseconds Ab Primo_V2_006 lib uiValue UINT
100. Manual PMCprimo SoftPLC channel x 1 14 Function library primo lib Description Delay time for demand signal Not available With SSI encoder 1ms see FS 7 frequency see FSO Referencing not possible see FS 8 frequency Depending for CAN cycle Referencing not possible 100kHz Accuracy reference inputs time Transmission with the next synchronisation message 1 2 or 4ms see FS18 Depending for CAN cycle time 1 2 or 4ms see FS18 Referencing not possible see FS18 Hardware register PMCtendo DDA 1us see FS18 Hardware register PMCtendo DDA 1us see FS18 Referencing not possible see FS18 Hardware register PMCtendo DD4 lt 1us see FS18 Hardware register PMCtendo DD4 lt 1us see FS18 Referencing not possible User Manual PMCprimo SoftPLC 19 PMC tendo DD4 demand velocity and actual position Relative position 20 PMCtendo DD4 demand velocity and actual position Absolute position 21 PMCtendo DD4 demand position Relative position and positive reference signal PMCtendo DD4 demand position Relative position and negative reference signal PMCtendo DD4 demand position Absolute position See FS21 but with following error and actual current See FS22 but with following error and actual current See FS23 but with following error and actual current Number of synchronous CAN messages PScope can display motor current Drive and channel x 1 Yes
101. Markerlnput PMCprimo command DZ Define zero marker input on off Function library Encoder Description With this function block the zero marker of the encoder can be defined as reference signal If 1 is indicated the zero marker of the encoder is used by PMCprimo as a reference signal Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiDefine USINT 1 zero track is defined 0 zero track is switched off Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Factory setting 0 not activated Examples Declaration INST DefineZeroMarkerlnput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiDefine 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiDefine 1 bVarBool2 Inst bDone Example in FBD INST DiefinezeraMarkerlnput bYarBOOL 4bExecute bDone BvarBOooL 0 usiMode hErrar 1 4usichannal iErrarMurnbaer 1 qusiDefine User Manual PMCprim
102. NT The number of the Bytes 1 to 4 diValue DINT The value to be written Note The number of the Bytes must coincide with the object library of the CAN unit Output variables bDone BOOL Value was written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions GetCanSDO User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetCanSDO bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL 1 usiCanNode 4 uilndex 8192 usiSubindex 0 usiBytes 4 diValue 5 LD INST bDone ST bVarBOOL2 ST diValue Example in ST Inst bExecute bVarBOOL1 usiCanNode 4 uilndex 1622000 usiSubindex 0 usiBytes 4 diValue 5 bVarBool2 Inst bDone Example in FBD INST aetcanspbo bYarBOOL1 4beExecute bVarBOOL dusiMade UusiC antletwork iErrar lumber 4usiCantode B8192 uilndex dusiSubindex i lusiBvtes 5divalue User Manual PMCprimo SoftPLC Page 51 14 8 14 Function library primo lib Display Various values from the control can be read into the SoftPLC with the display function and further processed there DisplayActualPosition Page 52 PMCprimo command DP Display actual position Function library Display Description The actual position of the selected axis is read in
103. Node 0 usiChannel 1 uiGain 4000 bVarBOOL2 Inst bDone Example in FBD INST SetintegralGain bYarBOOL1 4bExecute bVarB00L2 qQusiMade 1A4usiChannal iErrarMumhbhear 4000 uiGain User Manual PMCprimo SoftPLC Page 187 14 Function library primo lib SetErrorOptionsWord PMCprimo Command EW Set error options word Page 188 Function library Positioncontrol Description With this function block the user can determine the behaviour of PMCprimo in case of an error Bit 0 stands for input or output on the right and Bit 7 on the left Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system usiControlword USINT The error options word with following meaning Bit O Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Reaction of PMCprimo when exceeding the monitoring time of reference inputs see also SetReferenceErrorLimit page 280 0 In case of an error PMCprimo gives a signal 1 In case of an error PMCprimo gives a signal and switches off the controller release Reaction of PMCprimo when recognising a reference input outside the permissible range see also SetReferenceTimeout page 262 0 In case of an error PMCprimo gives a signal
104. OOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 10 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 10 bVarBool2 Inst bDone Example in FBD INST SetvelocitvAveraging Time bYarBOOL1 4bExecute bVarBOOLZ 0 usiNode 1H4usiChannel ierrorMumber 1 usivalue User Manual PMCprimo SoftPLC Page 65 14 Function library primo lib 14 9 Drive DriveCommand 469 PMCprimo command Function library Drive Description With the function block DriveCommand ASCII Commands can be executed for the current control loop and speed controller of the drive These commands are explained in a separate description A possible application would be for example to modify the speed control parameters during operation in order to compensate changing mass moment of inertias However the complete parameterisation of the controller can also be executed Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system sCommand String The PMCtendo DD4 ASCII Command Output variables bDone BOOL Value has been written True or it is still under
105. OOL1 usiNode 0 usiChannel 1 usiValue 8 bVarBool2 Inst bDone Example in FBD INST setFeedbackEncoder bYarBOOL1 4bExecute bDone byarBOOLzi 0 usiMode bEmorn gt 1 Ausichannal iErrarMumbear ously alle User Manual PMCprimo SoftPLC 14 Function library primo lib SetNumberOfBits 6 PMCprimo command NB Set number of bits for SSI encoder Function library Encoder Description With this function block the number of the data bits can be set for every axis when using a SSI Hiperface or CAN open encoder As a result SSI Hiperface and CAN open encoder types of simple 12bit Singleturn up to 25bit Multiturn models can be used Special feature with Hiperface For Hiperface encoder always 12 Bit of the NB value are reserved for the number of the revolutions The remaining Bits indicate the resolution per revolution For NB28 for example the motor runs 65 536 increments per reveolution Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The number of the entire Bits Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False n
106. Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DefineReferencelnput Factory setting 0 switched off Examples Declaration INST SetReferenceHoldoffTime bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 5 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 5 bVarBOOL2 Inst bDone Example in FBD INST agetReferenceHaldaffTimae BpvarBooL1 BExecute BpvarBOOoLZ 0 4usiNode 1 4usichannal ierrorMumber 5 usiv alue User Manual PMCprimo SoftPLC Page 269 14 Function library primo lib SetReferenceMode PMCprimo Command RM Set continuous reference mode on off Function library Referencing Description Permissible values for n 0 and 1 Factory setting 0 This function block effects that with SetReferenceMode 1 the zero track as reference input with function block DefineZeroMarkerlnput page 69 defined all defined reference inputs with DefineReferencelnput page 251 defined and all position snapshots of the encoder position of the inputs defined with the DefinePositionSnapshot page 249 are registered in every cycle Input variables bExecute BOOL The mode is set in c
107. PLC according to the IEC 61131 standard It can be used as a supplement to the separate CoDeSys user manual which describes the general programming and operation Please carefully read this user manual Reference manual for all commands is the german version PMCprimo motion control systems are available in different types and can control more than 700 axes in a network The coordination of the separate axes in PMCprimo is realized over the host level Every PMCprimo device can be used as a host system PMCprimo is programmed in a high level language or IEC 61131 3 CoDeSys Central communication medium is a terminal software see user manual Motion Control Tools on your PC that will be connected via a RS232 or Ethernet interface All parameterisations and user programs can be saved in flash memory or a Compact Flash Card Software functions for movement of servo axes With the described PMCprimo commands the parameters will be set and functions for the respective task will be programmed The wide range of commands allows the realization of complex applications PMCprimo has axis spanned commands this means that a separate command can affect several axes Reference commands allow the automatic initialisation and a reference error correction at a running machine The reference error can be compensated variable for example with defined ramp or time functions By this divergences in product or machine parameters can be corrected flexibl
108. ST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diLimit 1000 bVarBOOL2 Inst bDone Example in FDB INST SetAnaloguelnputLowLimit BvarBOOoL1 BExecute bDone bYarBOOLzi 0 4usiNode hErrar 1 Ausichannel ierrorMumber 10004 di LIMIT User Manual PMCprimo SoftPLC Page 297 14 Function library primo lib SetAnaloguelntegralGain Page 298 PMCprimo Command AI Set analogue integral control gain Function library Tension Description With this function module the integral factor of the control algorithm of the analogue control is set When using an integral factor PMCprimo integrates the control deviation by adding the actual error to a consecutive overall error The integral factor is mainly used for winding and unwinding applications with web tension control If the integral component is used you have to observe that during standstill of the axis this one is switched off with the function module SetAnalogueControlWord as otherwise it is started with an incorrect transmission ratio when restarting and the material to be unwinded is damaged Input variables bExecute BOOL The value is set in case of a change from O to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiGain UINT The control f
109. ST bExecute bVarBOOL1 usiNode 0 usiChannel 1 iSetPoint 2 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 iSetPoint 100 bVarBOOL2 Inst bDone Example in FDB INST setAnaloguecoantralsetPoint bVarB00 1 qbExecute barboa Il HusiMade 1 4usichannal 1004iSetPoint User Manual PMCprimo SoftPLC Page 291 14 Function library primo lib SetAnalogueControlWord PMCprimo Command AW Set analogue control options word Function library Tension Description With this function module the behaviour of the analogue control is defined Bit 0 is the right and bit 7 the left one Bit 0 This Bit determines the behaviour of the slave axis with activation of a position allocation with Execute Map 0 The slave axis immediately goes into the condition of the active position allocation under use of the software clutch SetClutchTime to the transmission ration specified by the web tension 1 The slave axis drives with the jog speed set with SetSlowSpeed until the web tension achieves the web tension setpoint value and afterwards goes into the condition of the active position allocation Bit 1 Reserved Bit 2 This Bit determines the mode of operation of the integral factor The web tension depends on the movement of the master and slave axes as the output of the control loop of the velocity ratio is between both axes If the master axis stands then also the slave
110. SlaveToMaster page 104 and as slave of a second master axis differential axis with the function MapLinkSlaveToDifferentialMaster page 102 The Bits 4 6 of the function SetMapLinkOptionsWord page 201 determine how the slave axis evaluates the positions of the master axis and Bit 0 of the function SetMapLinkOptionsWord determines if the master or the differential axes transmit their demand or actual positions to the slave axis User Manual PMCprimo SoftPLC Page 87 Page 88 14 Function library primo lib The status of the master axis is arbitrary as far as the definitions as slave axis are correctly executed Additionally it is important that the settings with the LW command at the master and slave axes have been carried out before executing the function MapLinkSlaveToMaster Modifications at the LW command are only effective after unlink and new link to the master channel Master axis Slave axis Slave axis LWOOT 10000 Slave axis Illustration 14 Example for softwaredifferential complex The different parameters for the execution of a position allocation can be summarised into the following equation All parameters are to be set at the slave axis except it is referred explicitly to the master axis User Manual PMCprimo SoftPLC 14 Function library primo lib ExecuteMap PosName Slave demand position Table Masterposition MB x SM MF SM MB MF Dl LW Bite LW Bit 0 at the Master Illus
111. SoftPLC The maximum possible position SB SM is greater than the position limit of ld command lt c c gt The predefined map LINEAR can t be changed Page 210 User Manual PMCprimo SoftPLC 14 Function library primo lib Input variables bExecute BOOL The error value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system Output variables bDone BOOL bError BOOL iErrorNumber diValue DINT e Value has been read True or module is still under operation False True an error has occurred False no error INT Indicates the exact error cause see GetError page 203 Error message according to Table Lo n NA See also GetStatus Examples Declaration INST GetError bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST biValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST GetError User Manual PMCprimo SoftPLC Page 211 GetStatus Page 212 14 Function library primo lib PMCprimo Command Sx x Function library Positioning Description This function block restores the actual status of an axis
112. Summary of all Codes which PMCprimo restores depending on the status of the axis 0 Position control loop closed EnablePositionControl 8 Position control loop open motor off MotorOff 66 Axis waits on the coupling at the beginning of a position allocation out of C 67 Axis executes a coupling process at the beginning of a position allocation out of C 68 Axis executes a compensating movement for the beginning of a position allocation A 256 X Execution of an endless positioning or velocity control MoveConstantVelocity 512 Axis executes a Positioning Command MoveToAbsolutePosition MoveRelativePosition 2048 Positioning allocation 7 Map active ExecuteMap 4096 Axis executes a Stop command StopMotor 8192 Initialisation runs InitialisePosition InitialisePositionBounds Input variables bExecute BOOL The status is read in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT Error message according to Table See also GetError User Manual PMCprimo SoftPL
113. The reference position bound indicates the position at which PMCprimo expects a reference signal If zero is set then PMCprimo expects a reference signal at the cycle limit set with the function block SetPositionBound page 133 Application example The position bound of the machine amounts to 10 000 increments and the reference position bound is set with 2 500 increments As a result PMCprimo corrects 4 times a reference error within a position bound of the machine Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The value of 0 to 4 000 000 increments 0 switched off As of version 2 004 new range 0 to 2 000 000 000 Output variables bDone BOOL Value is written True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetPositionBound Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetReferenceRepeatLength bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1
114. UINT The time from 4 up to 10 000 milliseconds As of version 2 006 new range of values 0 to 1000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Factory setting 4 milliseconds Examples Declaration INST SetMapPositionTimeout bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 6 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 6 bVarBOOL2 Inst bDone Example in FBD INST SethiapPositian Timeout bYarBOOL1 4beExecute bDone bVarB00L2 0 4usiNode hErrar 1A4usiCchannel ierrorMumber BUY alue User Manual PMCprimo SoftPLC Page 131 14 Function library primo lib SetMapScaleFromBounds PMCprimo Command BR Set map scale factor from bounds ratio Function library Mapping Description With this function block the transmission ratio SetScaleMapping page 136 can automatically be calculated from the specified position bounds of the master and slave axes The calculated transmission ratio is equal to the value SetScaleMapping slave SetScaleMapping master Input variables bExecute BOOL The transmission ratio is calculated in case of a change from O to 1 0 resets the function block and the output
115. ValuesC ADR diValuesC Motion pdiValuesW ADR diValuesW Motion pdiValuesX ADR diValuesX Motion pdiValuesY ADR diValuesY Motion pdiValuesZ ADR diValuesZ iCount 1 END IF Motion bDone Motion bDone bError Motion bError iErrorNumber Motion iErrorNumber END IF IF bExecute FALSE THEN iCount 0 Motion bExecute FALSE Motion Reset FB User Manual PMCprimo SoftPLC Page 107 14 Function library primo lib bDone Motion bDone bError FALSE iErrorNumber 0 END IF This function block can be changed in such a way that for example single sections can be modified via variables For that the function block generated by Pmotion must only be extended in a minimum way in CoDeSys For that a new input variable is declared and this variable overwrites then the reserved value into the Arrays Extension for a further input variable Declaration FUNCTION BLOCK Motion2 VAR INPUT bExecute BOOL diEndposition DINT END VAR further Code not modified Implementation IF bExecute TRUE AND bDone FALSE THEN Motion bExecute TRUE IF iCount 0 THEN Set Variables Motion sMapName sMapName Motion iSteps iSteps Motion iNumberElements iNumberElements diSlavepos 1 diEndposition Motion pdiMasterpos ADR diMasterpos Motion pdiSlavepos ADR diSlavepos Motion pdiFunction ADR diFunction Motion pdiValuesA ADR diValuesA Motion p
116. a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The value from 1000 up to 2 000 000 000 increments second Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 166 Connected functions StopMotor MoveToAbsolutePosition MoveRelativePosition InitialisePosition and InitialisePositionBounds Factory setting 100 000 increments second Page 232 User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST SetDeceleration bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 1000000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 1000000 bVarBOOL2 Inst bDone Example in FBD INST SetDeceleration BvarBooOL1 b5Execute hvarBOooOoL7 0 zusiMode 1HusiChannel ierrorMumbher 1000000HKudi alue User Manual PMCprimo SoftPLC Page 233 14 Function library primo lib SetMoveOptionsWord PMCprimo Command ZW Set move position control word Function library
117. a driving master axis The software clutch functions as a mechanical fixed point clutch which couples point exactly while driving The slave axis waits in the instantaneous position until the master axis achieves the driving position For a velocity synchronous operation a value for n 0 should be specified for connecting the running master at the slave axis for SetClutchTime The value n 20000 represents the longest and the value 0 the shortest clutch time The clutch time is indicated in milliseconds V D gt aos e c A Dw BS DS om E az dea e EM z V 9 A S9 Da 2 z B v Slave m eo clutch time T 16ms Illustration 17 Behaviour software clutch User Manual PMCprimo SoftPLC Page 113 14 Function library primo lib Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiClutchtime UINT The coupling time in milliseconds Range of values 1 to 20 000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapOptionsWord and S
118. actor from 0 to 65535 Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueDifferentialGain SetAnalogueProportianalGain und SetAnalogueControlMode Factory setting 0 switched off Examples INST SetAnaloguelntegralGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 50 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 50 bVarBOOL2 Inst bDone Example in FDB INST cetAnalogquelntegralGain BVvarBOoOL1 B5Execute bvarBOOL2 0 4usiNode bEmoan OO 1 4usichannal ierrorMNumber 50 uiGain User Manual PMCprimo SoftPLC 14 Function library primo lib SetAnalogueMasterRangeDistance PMCprimo Command MM Define master axis analogue range distance Function library Tension Description This function module determines the distance between the upper and lower limits of the master axis called master analogue distance It allows to specify the value of the analogue distance for a master axis Input variables bExecute BOOL The value is set in case of a change from O to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node
119. al measured reference position and offset obtains the reference error to be corrected see DisplayReferenceError page 58 The set value is also used for the function blocks InitialisePosition and InitialisePositionBounds In this case the position counter is set to the value of the reference offset when recognising the reference signal Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue DINT The reference offset in the range of 4 000 000 increments Output variables bDone BOOL Value is written True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DisplayReferenceError InitialisePosition and InitialisePositionBounds Factory setting 0 increments Examples Declaration INST SetReferenceOffset bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 1000 bVarBOOL2 Inst bDone Example in FBD INST SetReferenced
120. allocation and couples then If the master runs a speed which is smaller equal to 500Incr sec the slave also couples without software clutch The master speed should be brought to an average for that with the function SetMapBaseAdvanceTimeConstant page 119 2 Activation with moving master axis The activation of the position allocation with moving master axis must be executed by the aid of the software clutch Bit 1 SetMapOptionsWord The execution of the function block ExecuteMap with activated web tension control with SetAnalogueControlMode is influenced by the Bits 4 and 5 of the function SetAnalogueControlWord page 292 For a speed allocation Bit 4 command SetMapOptionsWord only linear Maps ExecuteMap LINEAR are allowed Page 92 User Manual PMCprimo SoftPLC 14 Function library primo lib Input variables bExecute BOOL The position allocation is started in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system sMapname STRING The name of the Map Output variables bDone BOOL Position allocation active True or coupling process or transient drive is not finished False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected
121. als which can get lost from 0 switched off to 255 Output variables bDone BOOL Value is written True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetErrorOptionsWord and SetFilterOnReference Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetReferenceTimeout bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 4 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 4 bVarBOOL2 Inst bDone Example in FBD INST cetReferenceTimeout bYarBOOL1 4bExecute bDone bV arBOOLZ 0 usiMode hErrar 1 4usichannal ierrorMumbetr 4 Uusiv alue User Manual PMCprimo SoftPLC Page 281 Undefinelnput Page 282 14 Function library primo lib PMCprimo Command UI Undefine input definition Function library Referencing Description With this function block the user resets a defined input function in PMCprimo independent of the fact which input function was defined up to now Input variables bExecute BOOL The input function is reset in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT T
122. alse bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DefineAuxiliaryOutput SetMonitorOutputFunction and SetMonitorOutputGain Factory setting 0 Example Declaration INST SetMonitorOutputOffset bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL Inst bExecute bVarBOOL 1 usiNode 0 usiChannel 1 iValue 100 LD Inst bDone ST bVarBOOL2 Example in ST Inst bExecute bVarBOOL1 usiNode 0 usiChannel 1 iValue 100 bVarBool2 Inst bDone Example in FBD Inst SetMonitorOutputoffiset bVarBO00L1 bExecute bDone bvarBOOLZ qQusiMade hEmor gt 1 Ausichannal iErrarMumber 100 i value Page 40 User Manual PMCprimo SoftPLC 14 Function library primo lib 14 6 BusVariables The BusVariables serve as interface to external units as for example control units The variables are set via Modbus CAN Profibus DP Slave and Ethernet interface The various Bussystems take all hold of the same variables If several Bussystems are used simultaneously the last transmission decides which value the variable finally has GetBusVariable PMCprimo command B1 B108 Function library BusVariables Description With this function block the actual value of a BusVariable can be read in the PLC Input variables bExecute BOOL The variable is set in case of a change from 0 to 1 0 places the function block back
123. alue has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapOptionsWord and SetClutchTime Factory setting 1000 increments User Manual PMCprimo SoftPLC Page 111 14 Function library primo lib Examples Declaration INST SetClutchLength bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 diValue 1000 bVarBOOL2 Inst bDone Example in FBD INST aatCclutehLength bYarBOOL1 4bExecute bDone BvarBOooOLb 0 4usiNode hErrar 1 4usichannal iIErrar lumber 1000 4diV alue Page 112 User Manual PMCprimo SoftPLC 14 Function library primo lib SetClutchTime PMCprimo Command CT Set clutch time Function library Mapping Description The software clutch time is only active if Bit 5 is set to 0 by SetMapOptionsWord page 101 If Bit 5 is set to 1 the software clutch length SetClutchTime page 113 is active This function block indicates the acceleration ramp as time slot pattern for the function of the software clutch The function software clutch is activated with Bit 0 to the function block SetMapOptionsWord The software clutch function is designed for connecting the slave axis to
124. ample in FBD INST celllaxReferenceCorrection bYarBOOL1 4bExecute BvarBOooL AusiMade 14usichannal ierroriJumbetr 1000 4uiValue Page 256 User Manual PMCprimo SoftPLC 14 Function library primo lib SetReferenceAcceleration PMCprimo Command RC Set reference error adjustment acceleration Function library Referencing Description The adjustment of a reference error results in a new setpoint position for the slave axis PMCprimo can determine the acceleration ramp for obtaining the adjustment velocity by the aid of the function block The parameter is indicated in increments second The parameter is to be set at the slave axis The value 0 means a jump of the compensation velocity Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The value from 0 to 2 000 000 increments s Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceCorrectionVelocity Examples Example in IL Declaration INST SetReferenceAcceleration bVarBOOL1
125. ample in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 150 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 150 bVarBOOL2 Inst bDone Example in FBD INST ServelocitFeedForwardGain BvarBOOL1 BbExecute BvarBOoO0LZ 04usilode 1 A4usichannel ierrorMumber 150HuiGain User Manual PMCprimo SoftPLC Page 197 14 Function library primo lib SetVirtualMotorMode Page 198 PMCprimo Command VM Set virtual motor mode Function library Positioncontrol Description This function block is used in order to declare an axis to a virtual axis In a virtual mode an axis acts without motor and encoder as the actual position is internal calculated from the demand position Application of the virtual mode e Test of functions and programs without being connected to the machine e Simulation of a master axis Input variables bExecute BOOL The motor is set in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiMode USINT 0 The axis is a real axis A motor is operated with a position control and the encoder input is the actual value acceptance signal 1 The axis is a virtual axis The drive is not released by the axis The s
126. an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DefineAuxiliaryOutput SetMonitorOutputFunction and SetMonitorOutputOffset Factory setting 1 Example Declaration INST SetMonitorOutputGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL Inst bExecute bVarBOOL 1 usiNode 0 usiChannel 1 iValue 100 LD Inst bDone ST bVarBOOL2 Example in ST Inst pExecute bVarBOOL1 usiNode 0 usiChannel 1 iValue 100 bVarBool2 Inst bDone Example in FBD inst SetMonitorOutputGain bVarBO0L1HbExecute BvarBOOoLZ 0 usiNode 1 4usiChannel User Manual PMCprimo SoftPLC Page 39 14 Function library primo lib SetMonitorOutputOffset PMCprimo command OM Set monitor output offset Function Auxiliary Description The analogue auxiliary output can be provided with a firm voltage level Offset with this function block Offset in mV 4 88 mV SetMonitor OutputOffset Input variables bExecute BOOL In case of a change from 0 to 1 the setting is executed 0 places the function block back and the output variables are set to False or O usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system iValue INT The voltage level Offset Output variables bDone BOOL The function was executed True or it is still under operation F
127. an output can be set for the time for which a reference error correction is executed against the driving direction This means that the axis must get slower in case of a reference error correction so that the defined output is set to true Input variables bExecute BOOL The output is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual 1 to 20 adjustable with CD command PMCprimo 16 1 to 10 adjustable with CD command PMCprimo Drive2 usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity 0 positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetReferenceMode DefineReferenceForwardOutput DefineReferenceOutput and DefineReferencelnput The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defined User Manual PMCprimo SoftPLC Page 153 Page 154 14 Function library primo lib Examples Declaration INST DefineReferenceBackwardOutput bVa
128. and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Transmission ratio calculated True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueRangeDistance and SetAnalogueMasterRangeDistance User Manual PMCprimo SoftPLC Page 285 Page 286 14 Function library primo lib Examples Declaration INST CalculatelnitialRatio bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FDB INST CalculatelnitialFatio bVarb00L1HbExecute bDone bvarBOOL2 I Hu siMade bErrar 1 A4usichannal iErrarumbaer User Manual PMCprimo SoftPLC 14 Function library primo lib ExecuteAnalogueDistancelnit PMCprimo Command XR Execute analogue range distance initialisation Function library Tension Description The function Initialisation of the transmission ratio with analogue distances can manually be started The measuring results are registered in the SetAnalogueRangeDistance parameter The command is al
129. ange RS 232 configuration Change RS 422 configuration 16 Change startup delay k H Ul 17 Change display mode 18 Change usage RS422 for PLC Choice Return ESC exits menu 4 New IP address 192 168 0 6 New Netmask 255 255 255 0 The IP address can be changed without restart of the system If the netmask is changed then a restart is necessary Serial The CoDeSys programming tool connects itself locally per TCP IP with the program PTerm This program undertakes the data transfer to the control Simultaneously also the other programmes as PMotion PScope etc can take hold of the control via the serial interface Important The program PTerm must always be started and there must be a serial connection open to the control Since version 2 005 Now it is possible to use the Pilz control panels of the PMI series directly in CoDeSys Therefore the PMCprimo configuration command CD 18 must set to 1 in order the RS422 interface ist set for SoftPLC The control panel can direcrtly access to variables of SoftPLC It is defined an array of 1023 global variables and named with g iModbusData A modbus protocol is not necessary therefore The boud rate is set to 38400 8 bits 1 stopbit and no parity Motorola byteorder must be set If the RS422 interface is set for PLC also the programming must be done with this interface because the connection with Pterm is deactivated localhost in CoDeSys if CD18 is set to 1 It is also pos
130. ange travel velocity during a move End of movement with ST Command Cooperation of the commands after detecting a reference signal Figure 34 Cooperation of the commands reference error correction Illustration 35 Illustration 36 User Manual PMCprimo SoftPLC Reference error correction with factor Limit values for the evaluation reference input 13 13 15 22 27 27 29 31 34 84 85 86 87 88 89 89 113 133 167 201 214 216 218 222 223 223 221 232 236 238 240 242 247 248 260 264 Page 5 4 Abbreviations and symbols 4 Abbreviations and symbols Abbreviation Meaning Description PMCprimo Registered trade mark Pilz GmbH amp Co KG PMCtendo Registered trade mark Pilz GmbH amp Co KG Registered trade mark Max Stegmann GmbH Symbols Meaning Description This symbol indicates the possibility of imminent danger to life and limb Failure to observe these warnings can lead to serious or life threatening injury the connected system This symbol indicates application tips and information of an especially useful nature These will help achieve the optimal use of all the available functions This symbol indicates important instructions for the correct operation of the Is drive Failure to observe these instructions can lead to failures of the drive or Page 6 User Manual PMCprimo SoftPLC 5 Introduction 5 Introduction This manual describes the specialties and the functional library of the Soft
131. ase of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The switch for referencing 0 or 1 Output variables bDone BOOL Mode activated True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DefineZeroMarkerlnput DefineReferencelnput and DefinePositionSnapshot Factory setting 0 switched off Examples Declaration INST SetReferenceMode bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 1 bVarBOOL2 Inst bDone Example in FBD INST agtReferenceMade BvarBOoOL1 bDone BvarBOoOLb T i bError 1 4usichannal iErrarurmber 1 4usivalue Page 270 User Manual PMCprimo SoftPLC 14 Function library primo lib SetReferenceOffset PMCprimo Command RF Set reference offset Function library Referencing Description With this function block a reference offset can be set This is the position at which PMCprimo expects a reference signal The difference between the actu
132. aviour This chapter describes the commands and therefore the possibilities which PMCprimo offers the user regarding the referencing Reference function blocks include the basic function of the initialisation after power on as it is integrated in every positioning system but also the possibility of the cyclic referencing which allows the user to adjust fluctuations and inaccuracies of the practical position bound to the theoretical specification of the position bound The encoder position is stored immediately when recognising a reference input This stored position is compared with an expected reference position cycle limit SBn 0 SBn see function block SetPositionBound The resulting difference is defined as reference error and the absolute position can if required be corrected by this difference amount PMCprimo supports 2 kinds of reference signals A The zero track of the encoder is connected with a fast reference input which recognises itself pulses with a length of 60ns This reaction time is short enough in order to recognise itself the zero track in case of high resolution encoders with their maximum velocity definition gt zero track is reference input with function DefineZeroMarkerlnput B Digital inputs as reference inputs The inputs 1 to 4 or 1 to 2 with PMCprimo Drive can be defined with the function block DefineReferencelnput as reference inputs With this reference inputs external switching elements can
133. axes are switched off in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 Output variables bDone BOOL All motors are switched off True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function MotorOff Examples Declaration INST GlobalOff bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 bVarBOOL2 Inst bDone Example in FBD INST Globalt bVarBOOL1 4bExecute BvarBooOL7 Page 177 GlobalStop Page 178 14 Function library primo lib PMCprimo Command GS Global stop Function library Positioncontrol Description All axes decelerate with their corresponding ramp given by SetDeceleration This function block is an all axes global StopMotor Function page 242 Input variables bExecute BOOL All axes are stopped in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 Output variables bDone BOOL All axes are stopped True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function StopMotor Exampl
134. bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1 bVarBOOL2 Inst bDone Example in FBD INST SetvelocityOutputhystere sis bVarB00L1HbExecute bDone BhvarBOooL7 Il HusiMade hbErrar 1 4usiChannel iErrarMurnbaer 1 Auivalue User Manual PMCprimo SoftPLC 14 Function library primo lib UndefineOutput PMCprimo Command UO Undefine output definition Function library Output Description With this function block the user cancels a defined output function in PMCprimo independent which function was defined before Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 2 PMCprimo Drive 2 2 is virtual 1 to 3 PMCprimo 2 2 3 is virtual 1 to 3 PMCprimo 16 3 is virtual usiOutput USINT The output number from 1 to 8 Output variables bDone BOOL Definition was cancelled True or function block is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203
135. bVarb00L14bExecute BpvarBOooOL I 1usiMade 1 4usichannal iErrarMurnbaer iap0i K sMaphName di value User Manual PMCprimo SoftPLC Page 101 14 Function library primo lib MapLinkSlaveToDifferentialMaster Page 102 PMCprimo Command NL Map link slave axis to differential master axis Function library Mapping Description With this function block the instantaneous axis is defined as the slave axis of a 2 master differential The value indicates the requested differential master axis This command must be used before activation of a position allocation if a differential master is necessary Software differential also refer to the function on page 125 Input variables bExecute BOOL The value is read in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiLinkNode USINT The node number of the master axis usiLinkChannel USINT The axis number of the master axis Output variables bDone BOOL Definition closed True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapLinkOptionsWord Factory setting No master axis defined User Manual PMCprimo SoftPLC 14 Funct
136. be used with a minimum pulse length of 10 us for the referencing Page 246 User Manual PMCprimo SoftPLC 14 Function library primo lib Initialization Fast input is active 10 Limitation of 20 the reference DisplayActualPosition is set to signal SetReferenceOffset Initialise Position 4 O Latch actual motor position SetReferenceFalseHighLimit SetReferenceFalseLowLimit SetReference TrueHighLimit SetReferenceTrueLowLimit Zero marker input Define ZeroMarker E Input Set Reference Referencing is active 1 Set Position Bound 1 Calculaltion O of reference error MoveTo Absolute Position O Set Reference RepeatLength Reference Offset J SetReference RepeatLength gt 0 Display Reference error SetMove Reference is set to DisplayReferenceErrort OptionsWord Error Bit 2 lo o Define j Re signal for reference Moving RejectOutput A error is set ve reference signal If DisplayReferenceError gt SetFilterOnReference the reference error is ignored Set FilterOn Reference Reference error limit is checked Set ReferenceError Refernce error is reduced to the maximum value SetError Reference Output pulse for valid reference signal Reference AcceptedOutpu O Correction of reference error Illustration 33 Cooperation of the commands a
137. block back and the output variables are set to False or O iNumber INT The number of the variable from 1 to 108 The variables 101 to 108 are linked to virtual inputs in PMCprimo diValue DINT The new value of the variable Output variables bDone BOOL The function was executed True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Arguments Connected functions GetBusVariable Examples Declaration INST SetBusVariable bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 iNumber 2 diValue 1000 LD INST bDone ST bVarBOOL2 Example in ST Inst bExecute bVarBOOL1 iNumber 2 diValue 1000 bVarBool2 Inst bDone Example in FBD Inst SetBusvariable bvarBOoL1 10004diV alue iErrar lumbar User Manual PMCprimo SoftPLC Page 43 DIIZ 14 7 Page 44 14 Function library primo lib CAN Net and CAN open As of version 2 000 multiple CAN networks per device are supported by PMCprimo The CAN net in which all PMCprimo devices are connected with each other is called CAN Net The CAN net which connects a PMCprimo device with some servo drives PMCtendo DD4 is called CAN Open CAN Net CAN Open vx z i 43 Te IB 5 User Manual PMCprimo SoftPLC 14 Function library primo lib CANPositionControlDrive and
138. block must always run on the slave axis The position table must be tranferred to the axis with the command TransferMapData On the axis MapLinkSlaveToMaster must be done Input variables bExecute BOOL The value is read in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system sMapname STRING The name of the Map Output variables bDone BOOL Value has been read True or is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The determined alignment move Connected function SetMapOptionsWord MapLinkSlaveToMaster SetScaleMapping SetMapBaseOffset und SetSlaveMapOffset User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST LengthOfAlignmentMove bVarBOOL1 BOOL bVarBOOL2 BOOL diValue DINT Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Map01 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Map01 bVarBOOL2 Inst bDone diValue Inst diValue Example in FBD INST LengihofAlignmentioyve
139. ched off Examples Declaration INST SetEncoderScaling bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 2 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 2 bVarBool2 Inst bDone Example in FBD INST SetEncaderscaling b varBOOLt User Manual PMCprimo SoftPLC Page 73 14 Function library primo lib SetEncoderTimeout Page 74 PMCprimo Command TO Function library Encoder Description Set timeout With this function block a timeout for the encoder signal is set Depending on the pre setting by Bit 6 of the function SetcontrolWord page 182 the parameter is interpreted in a different way Bit 6 of the Function SetControlWord is 0 After the start of a movement an encoder signal must be received by PMCprimo within the set monitoring time If PMCprimo does not receive any encoder signal before the monitoring time has passed PMCprimo switches off the controller release motor is de energised The input of the monitoring time for encoder signals is made in the unit milliseconds Bit 6 of the Function SetControlWord is 1 After the start of a movement an encoder signal must be received by PMCprimo within the set path demand value specification If PMCprimo does not receive any encoder signal within the set path PMCprimo switches off the controller release motor is de
140. cluded in the function editor CFC editor These function blocks combine the functionality of PDrive and PMotion with CoDeSys Examples Motor PDrive Parameter 1 bvarExecute Eee ud NR aD A mile a usivarChannel LE iErrorMumber ivarerroriMumbe usivarcanMade pou usivarcanMetwark a usivarvalueFeedbackEncader usivalueFeedbackEncoder hapSeguence Piotion_MapSeguence_Map_01 bExecute bDone diVarMasterpos1 diasterposi bError _Varslavenosi T NE ivarDone re diSlaveposi EmrorNumber VarErrorNumbert MET E E e strlapName div aluesA1 udiMasterzyklus udivarMasterzyklus diVaralueBt JdivaluesBt divaWalueC1 divaluesci divaWwaluext divaluesxi divaWaluevi divaluesvi avstuesz Motors Phiotion MapTable T hvarExecute bExecute RL E pvarDone fs hvarErrar HError Cau ivarErrorNumbere Li stMapName strvarmapiName Ts udiWasterzwklus udivarWasterzwyklus The function blocks of the primo tools lib library are described in a separate manual CoDeSys and Motion Control Tools data exchange via primo dll IS User Manual PMCprimo SoftPLC Page 311 16 Cross reference list PMCprimo Commands SoftPLC Functions 16 Cross reference list PMCprimo Commands SoftPLC Functions PMCtendo DD4 Command __ DriveCommand sSetModbusAddress BO __ DefineBoundOverflow
141. crements Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The actual demand position Also refer to DisplayActualPosition und DisplayFollowingError Example Declaration INST DisplayDemandPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayDemandPosition bYarBOOL1 4beExecute bDone bVarBOOLZ qQusiMade hErrar 1 Ausichannal ierrorMNumber divalue diValue Page 54 User Manual PMCprimo SoftPLC 14 Function library primo lib DisplayFollowingError PMCprimo command FE Display following error Function library Display Description The actual following error of the selected axis is read in a variable with this
142. ct list of a CANopen unit in the network is possible Furthermore a PMCtendo DD4 can be defined as PMCprimo axis Display Function blocks for a feedback of demand and actual positions and other values from the control Drive A function block for communication with the cascade PMCtendo DD4 with PMCprimo Drive Encoder Function blocks for setting the measuring system Here the kind incremental SSI or similar and the resolution can be set Mapping Function blocks for the Master Slave relations with the appropriate parameters Output Function blocks for definition of outputs which are directly operated in a 1 ms cycle by PMCprimo These are for example cams error outputs reference outputs etc Positioncontrol Function blocks for setting of the position control Here the basic pre settings are possible as for example contouring error limits or position control parameters Positioning Function blocks for easy moving commands Here speeds accelerations and targets are given Referencing Function blocks for the cyclic reference correction The reference error correction is also executed in the background without using PLC This kind of operation is activated and parameterised by calls Tension Function blocks for setting of the web tension control There the web tension control can be activated Furthermore the control parameter can be changed for it Wait Function blocks for special wait functions PMCprimo
143. ction LINEAR is available in PMCprimo as tabular position allocation The gear ratio master slave can be set with the SM command The tabular position allocation is used for more complex applications It also counts the more entries in the table the more exact the master slave allocation becomes as PMCprimo carries out a linear interpolation between the various table positions Mechanical gear functions as curve gears or valve tappets on a camshaft can be simulated with the tabular position allocation and easily be replaced by the definition of a position allocation Slave position ZZ 1 1 mapping i LTT Nonlinear mappi 1 2 mapping gt Master position Illustration 10 Simple position allocations Page 84 User Manual PMCprimo SoftPLC 14 Function library primo lib If master and slave axes move within a given range e g XY table a position allocation must be carried out for the required range The position bound needs not to be set in this case factory setting of SetBound can be maintained as the motors do not continuously run in the same direction The following picture shows a typical tabular position allocation The slave axis is for example a cutting tool and the master axis is for example the material transport The speed of the master axis shall vary so that the material speed within the machine remains constant The slave axis always runs to the corresponding demand position by the usage of a tabular p
144. ction library Encoder Description With this function block the type of the encoder can be set for every axis The following selectable possibilities for every axis are available Incremental feedback encoder SetFeedbackEncoder 0 2 SSI or Hiperface feedback encoder SetFeedbackEncoder 5 8 11 18 CANopen feedback encoder SetFeedbackEncoder 9 10 Transmission of feedback encoder values with CANopen for PMCtendo DD4 SetFeedbackEncoder 19 20 With transmission of the demand positions with CANopen for PMCtendo DD4 the position control is done by PMCtendo DD4 SetFeedbackEncoder 21 26 Encoder o fee ee ee 8 eens sue poston ge ORE s CT O O oS 11 SSI Hiperface relative position with high resolution as of version 1 009 12 SSI Hiperface absolute position with high resolution as of version 1 009 Hiperfache SSI relative position binary 100kHz Hiperfache SSI relative position gray code 100kHz Hiperfache SSI absolute position binary 100kHz User Manual PMCprimo SoftPLC 14 Function library primo lib Hiperfache SSI absolute position gray code 100kHz PMCtendo DD4 relative position chose the PMCtendo DD4 with pd and consider the reference PMCtendo DD4 absolute position chose the PMCtendo DD4 with pd and consider the reference CANopen demand position relative evaluation positive reference signal as of version 2 000 chose the PMCtendo DD4 with pd consider the reference CANopen
145. d PMCprimo Command FW Set reference filter options word Function library Referencing Description With this function block the options are pre set for a reference filter of PMCprimo Bit 0 stands for input or output on the right and Bit 7 on the left side Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiControlword USINT The setting with following meaning Bit 0 This Bit activates the parameter SetReferenceFalseLowLimit SetReferenceFalseHighLimit SetReferenceTrueLowLimit und SetReferenceTrueHighLimit 0 Parameter not active 1 Parameter active Bit 1 This Bit determines the reference position of the function SetReferencePosition page 274 in PMCprimo 0 PMCprimo uses the relative position to the reference signal 1 PMCprimo uses the absolute position of the position counter Bit 2 not occupied Bit 7 not occupied Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceFalseLowLimit SetReferenceFalseHighLimit SetReferenceTrueLow
146. d of movement with AB Command The function block has only an effect on the momentary selected axis Input variables bExecute BOOL The axis is braked in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system Output variables bDone BOOL Axis has be braked True or function block is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetAbortDeceleration User Manual PMCprimo SoftPLC Page 201 14 Function library primo lib Examples Declaration INST AbortMotor bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST Aborthotor bVarBQ0L1HbExecute bVarB Q00L2 04Uusihkode 1H4usiChannel ierrorMumber Page 202 User Manual PMCprimo SoftPLC 14 Function library primo lib GetError PMCprimo Command Fx x Function library Positioning Description This function block returns the actual error value of the axis The following error signals can be returned Int
147. demand position relative evaluation negative reference signal as of version 2 000 chose the PMCtendo DD4 with pd and consider the reference RF page 271 as of version 2 000 chose the PMCtendo DD4 with pd and consider the reference CANopen demand position relative evaluation positive reference signal The actual following error and the actual current is received as of version 2 004 chose the PMCtendo DD4 with pd and consider the reference CANopen demand position relative evaluation negative reference signal The actual following error and the actual current is received as of version 2 000 chose the PMCtendo DD4 with pd and consider the reference CANopen demand position absolute evaluation offset set with command RF page 271 The actual following error and the actual current is received as of version 2 000 chose the PMCtendo DD4 with pd and consider the reference CANopen demand position absolute evaluation offset set with command i In case of modifications of for example 4096 to 2048 increments revolutions the position control parameters change too In this case the factors will be double Enhancement as of version 1 009 SetFeedbackEncoder 11 and 12 Hiperface relative and absolute In comparison with SetFeedbackEncoder 5 6 or 7 8 a higher resolution for the interchange of the demand values is used User Manual PMCprimo SoftPLC Page 77 14 Function library primo lib Enhancement as of
148. diValuesB ADR diValuesB Motion pdiValuesC ADR diValuesC Motion pdiValuesW ADR diValuesW Motion pdiValuesX ADR diValuesX Motion pdiValuesY ADR diValuesY Motion pdiValuesZ ADR diValuesZ iCount 1 END_IF further Code not modified Of course it depends on the required modification how many and which variables shall additionally be added and overwrite the specified values The PMotion supplies only the basic structure in this case in order to simplify the first programming Page 108 User Manual PMCprimo SoftPLC 14 Function library primo lib SetAlignmentAcceleration PMCprimo Command AA Set map base offset scale factor adjustment acceleration Function library Mapping Description The modification introduction of a Positionoffset SetMapBaseOffset and SetSlaveMapOffset page 123 or of the transmission ratio SetScaleMapping page 109 results in a new soft position for the slave axis PMCprimo can determine the acceleration ramp for achieving the alignment velocity by the aid of the parameter The indication of the parameter is made in increments seconds The parameter is to be set at the slave axis If the parameter is O it is accelerated with a jump The equation velocity is set with the function SetMapAdjustmentVelocity Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNod
149. e Page 302 14 Function library primo lib With the wait command it is possible to wait for a specific motor status or position PMCprimo Command WE Wait end state Function library Wait As of version 2 004 available Description This command ends the current wait state as completed normally This allows the user to escape from a wait state Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL No more waiting True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Examples INST WaitEndState bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FDB INST VwaltEnd State bYvarBOOL1 4bExecute bYarBOOL I AusiMade 1Ausichannel ierror4lumber User Manual PMCprimo SoftPLC 14 Function library primo lib WaitForAbsolutePosition PMCprimo Command WA Wait for absolute position Function library
150. e USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diAcceleration DINT The alignment acceleration As of Primo V2 006 lib diAcceleration UDINT Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True An error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapBaseOffset SetSlaveMapOffset and SetMapAdjustmentVelocity Factory setting 0 jump to alignment velocity User Manual PMCprimo SoftPLC Page 109 14 Function library primo lib Examples Declaration INST SetAlignmentAcceleration bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diAcceleration 100000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diAcceleration 100000 bVarBOOL2 Inst bDone Example in FBD INST aatAliqnment amp cceleratian bYarBOOL1 4beExecute bDone bYarBOOL 0 4usiMode hErrar 1 Ausichannal ierrorNumber 100000 4diAcceleration Page 110 User Manual PMCprimo SoftPLC 14 Function library primo lib SetClutchLength PMCprimo Command CL Set clutch length Function library Mapping Description The software clutch length is only active if Bit 5 of SetMapOptionsWord page 127
151. e an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetPositionBound Examples Declaration INST SetPositionCounter bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 200 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 200 bVarBOOL2 Inst bDone Example in FBD INST SetPositionZCounter BvarBOoOL1 bDone BvarBOoOLb2 T hErrar 1 4usichannael ierroriMumber 2004diValue User Manual PMCprimo SoftPLC Page 193 14 Function library primo lib SetTimeoutForWindow PMCprimo Command Til Set Tlmeout for Window Function library Positioncontrol As of version 2 004 available Description The check of SetWindow is made after the time SetTimeoutForWindow The commands MoveToAbsolutePosition and MoveRelativePosition are after the adjusted time ready Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiValue UINT The timeout from 0 to 65535 ms Output variables bDone BOOL Value has been written True or it is still under operati
152. e cycle based Free definable master slave relationships allow the user to define any speed profiles for motors The usage of jerk less movement flow for example modified sine reduces the mechanical load at the machine as much as possible PMCprimo can fit motors with electronic gear functions just by software The relation between motor positions can be defined freely by the user additionally to the electronic gear function linear and non linear correlation with a tabular position assignment There are multiple of VDI defined movement kinds for your choice Tabular position assignments can replace mechanical cams and mechanical gearboxes When needed PMCprimo can generate new maps with the internal motion generator during machine operation Product dependent machine changeovers can be done by the push of a button Beside several possibilities to synchronize machine axes there are also many commands for absolute relative or endless positioning of power transmissions available All axes can operate in virtual mode electronic master axis for example for initial operation or as help axes User Manual PMCprimo SoftPLC Page 7 5 Introduction Hardware functions PMCprimo is intended for use with digital incremental position encoders which provide two signals in quadrature This allows the system to measure both the distance and direction of motion of the motor thus providing the closed loop feedback information for the channel Th
153. e if it is calculated from the Mapgenerator a new Input variables bExecute BOOL usiNode USINT usiChannel USINT The position table is transmitted in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 The node number in the linked system O if only one unit or Host The axis number from 1 to n depending on the system sMapname STRING The name of the Map Output variables bDone BOOL bError BOOL iErrorNumber INT Table transmitted True or it is not finalised False True an error has occurred False no error Indicates the exact error cause see GetError page 203 Connected functions ExecuteMap Examples Declaration INST TransferMapData bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Name LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Name bVarBOOL2 Inst bDone Example in FBD INST TransfermapData BpvarBooL1 BExecute BvarBOoOoLZ I usiMade 1qusiChannel ierrorMNumber Mame YsMapname User Manual PMCprimo SoftPLC Page 139 14 Function library primo lib UnlinkSlaveToMaster PMCprimo Command UL Unlink slave axis from master axis Function library Mapping Description With this function block the instantaneous slave axis becomes a single axis again The defini
154. e 130 14 Function library primo lib Examples Declaration INST SetMapOptionsWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 101 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 101 bVarBOOL2 Inst bDone Example in FBD INST Sethian CptionsvVvord bYarBOOL1 4bExecute bDone BvarBOooL AusiMade hErrar 1 A4usichannal ierrorMumber 2 1014HusiGontrolword User Manual PMCprimo SoftPLC 14 Function library primo lib SetMapPositionTimeout PMCprimo Command MT Masterposition timeout Function library Mapping Description If master values are transmitted in a linked system it is executed in a cycle of 4 milliseconds This position is interpolated for the cycle time of one milliseconds For monitoring the transfer of the master position via the CANopen network a monitoring time can be adjusted by this function block If the master values are not received within the adjusted time an error message is signalled and the motor is switched off Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue
155. e 35 Arguments bExecute BOOL Setting is executed with a change from 0 to 1 0 sets the function block back and the output variables are set to False or O usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The number of the function Value Function no function demand speed actual speed contouring error speed error absolute demand position absolute actual position average actual speed speed master axis average speed master axis demand value web torque control reference error encoder moment receiver demand speed including reference error correction Velocity ratio of master slave Therefore the average velocities VT page 65 and BT page 121 are used The ratio is calculated as follow Output DV KM DV master OM CON OO BR WN CO ue wuerde pb ON Oo Output variables bDone BOOL The function was carried out True or is still under operation False bError BOOL True an error has occurred False No error iErrorNumber INT Indicates the exact error reason see GetError page 203 Connected functions DefineAuxiliaryOutput SetMonitorOutputGain and SetMonitorOutputOffset Factory setting 0 no function User Manual PMCprimo SoftPLC Page 37 14 Function library primo lib Examples Declaration INST SetMonitorOutputFunction bVarBOOL1 BOOL bVarBOOL2 BOOL
156. e command ping from windows example ping exchange gt result 10 10 1 20 The mail server is different in every company It s possible to use free mail servers in the internet if a firewall is not used to prevent the access port 25 After bExecute is set TRUE the email will be send Input variables bExecute BOOL Avter change from 0 to 1 the email will be send 0 resets the function module and the output variables are set to False or 0 sServer STRING mail server address sFromAddress STRING sender of email sToAddress STRING reciever of email sSubject STRING subject text sMessageText STRING message text Output variables bDone BOOL Mail was send successfully True or mail sending still in progress False bError BOOL True an error occured False no error iErrorNumber INT Gives the excact error cause see GetError page 203 User Manual PMCprimo SoftPLC Page 307 Page 308 Example INST SendMail bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL 14 Function library primo lib CAL INST bExecute bVarBOOL1 sServer 10 10 1 20 sFromAddress maschine gpilz de sToAddress hilfe pilz de sSubject z Test sMessageText Hello World LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 sServer 10 10 1 20 sFromAddress maschine gpilz de sToAddress hilfe pilz de sSubject Test sMessageText Hello World bVarBOOL2 Inst bDone
157. e encoder input interface circuit multiplies the resolution of the encoder by four such that each complete cycle of the encoder signals represents four counts PMCprimo includes full isolation of the encoder input signals and are designed for use with encoders having differential line driver outputs This is get best performance and noise rejection in an industrial environment You can also use SSI Hiperface or CANopen encoder instead of incremental position encoders PMCprimo has digital input and digital output lines the number depends to the type of PMCprimo which may be used in various ways Additional has PMCprimo analogue inputs and outputs All digital input lines gives with a change of their state an interrupt The user defines what happens with the interrupt The state of the input line or the value of the analogue input could be checked in sequences The state of the outputs is also controlled by sequences Outputs may be explicitly set and cleared and can be used to control external relays or valves or just for status indication The inputs and outputs can be used as an interface to a PLC The digital input and output lines are fully isolated and are compatible with 24 V logic signals For comfortable communication with a PLC or any other host computer a RS232 interface MODBUS several field bus systems or Ethernet are available The analogue outputs give signals ranging from 10 V to 10 V Applications Typical application
158. e factor A position modification is not aligned with a single non sequential demand value change in case of a modification introduction of positionoffset transmission ratio with a factor 0 The alignment velocity is indicated in percentage starting from the actual demand velocity If the actual demand velocity is 0 the alignment is executed with the velocity on the basis of the function SetSlowSpeed The modification of the scale map ratio with an active position allocation at the slave axis also requires a velocity modification The function acts in this case exactly as with the modification of a position offset The value is to be given at the slave axis Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiPercent USINT The velocity from 1 to 200 percent 0 jump Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetAlignmentAcceleration SetSlowSpeed SetScaleMapping SetMapBaseOffset and SetSlaveMapOffset Factory setting 0 jump to a new position User Manual
159. e in Flash Buffer for storing reference position is full 230 Direction has changed The buffer with reference position must delete Possible baudrates 9600 19200 XOn XOff 38400 XOn XOff 234 To many PLC tasks active TD d d is not defined Parameter lt ld gt for command lt c c gt out of range if bit 4 of RW is set Parameter lt ld gt for command lt c c gt out of range if bit 4 of RW is not set Paramater lt ld gt for command lt c c gt out of range if bit 6 of RW is set Paramater lt ld gt for command lt c c gt out of range if bit 6 of RW is not set ne 249 Drive error Commutation error 250 Variable s d is not defined Node number not defined command lt c c 52 Node number d is already in use command lt c c No CAN device found Cannot execute drive command because buffer overflow 255 Warning SRam battery low LLOLLL MN CELLE CECI User Manual PMCprimo SoftPLC Page 209 2 2 2 2 2 2 2 2 53 54 55 56 57 58 59 14 Function library primo lib Error Cannot execute lt XM gt while motor is running Command QAO CAN Adr can only done on the host The analog output lt ld gt is not available command lt c c gt 263 Reserved for Soft SPS Mr 0rr1 Reserved for Soft SPS Reserved for Soft SPS Reserved for Soft SPS Reserved for Soft SPS Reserved for Soft SPS Node d Drive command not completed Battery buffered memory is used by
160. e monitor function SF may be defined for the current channel at any time The AO command is not available on different nodes The auxiliary output channel may be set for a particular analogue output only when its channel is in the motor off or virtual motor modes If the channel is in any other state then the analogue output is not available for use as a monitor output Conversely if the analogue output has been allocated to a channel as a monitor signal then this channel cannot be taken out of motor off or virtual mode To return analogue output channel to normal operation use AOO on the channel where the auxiliary output is defined Note that it is also possible to have the auxiliary output signal allocated to the current channel when it is in virtual mode the signal does not have to be defined on a different channel s output This may be useful in open loop control applications In PMCprimo Drive the command AO4 enables a limitation of the torque PMCtendo Version 3 55 is required and the parameter DILIM must be set to 1 after this change it must done SAVE and COLDSTART The value 3280 is equal to the IPEAK value Input variables bExecute BOOL In case of a change from 0 to 1 the function is activated 0 sets the function block back and the output variables are set to False or 0 usiNode USINT The node number in the linked system if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiOut
161. e unit or Host usiChannel USINT The axis number from 1 to n depending on the system sMapname STRING The name of the Map Output variables bDone BOOL Value has been read True or is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The determined slave position Connected function SetMapOptionsWord MapLinkSlaveToMaster SetScaleMapping SetMapBaseOffset and SetSlaveMapOffset User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST ExecuteMapVirtual bVarBOOL1 BOOL bVarBOOL2 BOOL diValue DINT Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Name LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Name bVarBOOL2 Inst bDone diValue Inst diValue Example in FBD INST ExecuteMapVirtual BvarBOoOL1 B5Execute d4usiNode 1 4usiCchannal ame 41sMaphame 14004diFosition User Manual PMCprimo SoftPLC Page 95 14 Function library primo lib GetMappedMasterBound Page 96 PMCprimo Command GM Get mapped master axis bound position Function library Mapping Description With this function block the position bound which has been passed over from the master axis to the slave axis can be read out This c
162. eToAbsolutePosition MoveRelativePosition MoveConstantVelocity and StopMotor 1 Sinusoidal velocity curve for the commands functions MoveToAbsolutePosition MoveRelativePosition MoveConstantVelocity and StopMotor Bit 3 Behaviour in case of motor errors 0 Axis is immediately switched off MotorOff 1 Axis brakes with the brake ramp and switches off the motor Bit 4 Defines the sign setpoint output 0 Setpoint sign normal i e if the encoder counts in a positive direction the sign of the setpoint is negative 1 Setpoint sign inverted i e if the encoder counts in a positive direction the sign of the setpoint is also positive User Manual PMCprimo SoftPLC Page 183 14 Function library primo lib Bit 5 Defines the counting direction of the encoder 0 Counting direction normal i e if track B follows on track A the position counter of PMCprimo counts in a positive direction 1 Counting direction inverted i e of track B follows on track A the position counter of PMCprimo counts in a negative direction Bit6 Function SetEncoderTimeout for encoder monitoring 0 SetEncoderTimeout defines a monitoring time 1 SetEncoderTimeout defines a way for monitoring Bit 7 Defines if the factor of the function SetIntegralGain is always or only during standstill active 0 The factor is always active 1 The factor is only active in case of a standing drive Output variables bDone BOOL Value has been written True
163. ecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diCounter DINT The count of a counter Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetPositionCounter Factory setting 0 Examples Declaration INST SetPositionOverflowCounter bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diCounter 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diCounter 0 bVarBOOL2 Inst bDone Example in FBD INST aetPosition c werflawC aunter BvarBaoL1 B5Execute bDone BvarBooLZ I 1usiMade bErrar 1 4usiCchannal ierrorNumber I 1dicaunter User Manual PMCprimo SoftPLC Page 135 14 Function library primo lib SetScaleMapping Page 136 PMCprimo Command SM Scale mapping Function library Mapping Description With this function block the transmission ratio can be adjusted between the master and slave axes The adjustment of the transmission ratio is executed at t
164. ed User Manual PMCprimo SoftPLC Page 157 14 Function library primo lib Examples Declaration INST DefineReferenceOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DefineReterencedQutput bYarBOOL1 4beExecute bDone BvarBOOoLZ usiMode hErrar usiChannel ierrorMumber usiBank usiOutput usiPalarity ao ms A Page 158 User Manual PMCprimo SoftPLC 14 Function library primo lib DefineReferenceRejectOutput PMCprimo Command RR Define reference reject output Function library Output Description With this function block a digital output can be defined as reference error output A reference error is measured with each reference signal The measured reference error is compared with the value of SetMaxReferenceCorrection In case the measured reference error is within the specified limits the reference error output is set as incorrectly In the contrary case when the measured reference error exceeds the specified limits the reference error output is set as true The signal level of the reference error output is specified with the argument polarity The signal level is kept so long until a new comparison
165. ed to the switching points hence the output is not constantly switched on and off during stoppage if for example the actual position varies by 1 increment The set value is either added to the cam position or subtracted from it The value can be used for all outputs on this axis Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The hysteresis for all cams on this axis Ab Primo_V2_006 lib udiValue UDINT Output variables bDone BOOL Output has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function DefinePositionTriggerOutput Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetPositionOutputHysteresis bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1 bVarBOOL2 Inst bDone Example in FBD INST SetPositionQutputHys
166. en the upper and lower limits of the analogue input of the instantaneous selected axis called analogue distance It allows to specify the value of the analogue distance for a slave axis Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiDistance UINT The distance at the slave from 0 to 65535 increments Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueMasterRangeDistance und SetAnalogueControlMode Factory setting 256 increments Examples INST SetAnalogueMasterRangeDistance bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiDistance 6000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiDistance 6000 bVarBOOL2 Inst bDone Example in FDB INST SetAnaloqueRangeDistance BvarBOOL1 B5bExecute bVvarBOOL2 oHusiNode era 1 4usichannal iErrorMumber 6000 uiDistance User Manual PMCprimo SoftPLC Page 301 14 17 Wait WaitEndStat
167. ence signals and the execution of the necessary corrections resulting from them Each complete position bound limit value exceeding is counted in an overflow counter This counter can be cancelled or set with the function SetPositionOverflowCounter page 135 A typical application for the usage of position bounds is a cyclic or rotating movement where only the position within one rotation or cycle is important Position indications outside of the selected position bound with travelling commands are possible at any time however the actual position can never be bigger than the position bound subtraction of the adjusted value from the position counter The overflow counter includes the number of the completely driven cycles Direction of motion erat s Positions without bounds total distance 0 250 500 750 1000 1250 1500 Positions with bounds set to one turn 71000 0 250 500 750 0 250 500 V Move relative 1500 Illustration 18 position bound User Manual PMCprimo SoftPLC Page 133 14 Function library primo lib Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The position bound from 1 to 4 000 000 increments As of version 2 004 new range 1
168. end the outputs are updated and the cycle starts again PMCprimo MN EE listeners mig sitomar Motion generator 0 1 2 3 time ms Illustration 6 time response SoftPLC with Motiongenerator Is additionally the Motiongenerator active the SoftPLC carries out its standard calculation cycle and after the outputs have been updated the SoftPLC stops for 2 milliseconds enabling the processor to carry out the Task for the Motiongenerator As soon as the curve has been calculated the Task for the Motiongenerator is finished and there is no pause User Manual PMCprimo SoftPLC Page 27 13 SoftPLC in PMCprimo As of version 2 006 defintion of new tasks Now it is possible to add 4 tasks inside the SoftPLC with high priority For this a new file taskkonfig xml is necessary In the task configuration the type triggered by an external event is available The cycle time is set with the input in the cyclic type First the type has to be set to cyclic and the time typed in and then the type has to be changed to triggered by an external event Then the task TASK_T01 can be chosen The four tasks are executed with a higher priority directly in the system The normal PLC task is therefore interrupted and it is possible to react faster on some inputs Important Because the fast tasks can interrupt the normal PLC_PRG task care must be taken with the outputs 13 6 PMCprimo programs A complete application with the S
169. erScaling PMCprimo command MS encoder scaling Function library Encoder Description With this function block the determined position can be scaled The position is multiplied by pum This possibility achieves an increase of the resolution of the measuring system with the function block SetEncoderFilterTime It is required if a Slaveaxis with a high transmission ratio should follow this Masteraxis In case of a ratio of 10 1 the Slave must run 10 increments with each increment of the Master It is noticeable at the motor by noises and increased temperature development In case the position is graduated and averaged the transmission ratio is decreased and this effect is reduced Typical values are 2 for the graduation and 8 for the information Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue UINT Set graduation multiplication with 2 0 no graduation maximum 8 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Also refer to SetEncoderF ilterTime Factory setting 0 swit
170. ernal program error i Peron ct as a paa Eana The target position is outside of the defined software end positions SIC The command MA cannot be executed as motor runs already ECT T o re command MR camot e executed morae The command VC cannot be executed as motor runs already Attempted division by means of zero 13 Before calling a program you have to switch over to the sequential command sequence 14 Overfow of the data stack Overflow of the data stack ai rois ot demos e courao O OO O25 Input cannot be defined as reset input roerne oooO ar Tre mrogram lt gt camere strega rune sei User Manual PMCprimo SoftPLC Page 203 14 Function library primo lib Error when reading the encoder ICT TT s4 Toomich ime was reaurea tor o sip errato ML must be executed before BR C aO se ine eeance oror count e coneaea mace The reference error has been reduced to the maximum value E a2 Veny acaton ony possibi whaler Man The output has already been defined as electronic cam The input is not defined as limit switch oo EnorMotongenrtor Vai Sn as rot veon densi oe ine parameter ae lt gt is rot permise forie command s31 oe Eror moton generation vare Sin smaller han tne Reus vali ___ 60 iputcanotbe semeda une O Page 204 User Manual PMCprimo SoftPLC 14 Function library primo lib lt PC gt cannot be executed as analogue auxiliary output is defined TT E ze F
171. es Declaration INST GlobalStop bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 bVarBOOL2 Inst bDone Example in FBD INST GlobalStop bvarBQ0L1 bExecute bVarB 00 2 User Manual PMCprimo SoftPLC 14 Function library primo lib InitialiseDemandOffset PMCprimo Command ID Initialise Demand Offset Function library Positioncontrol As of version 2 004 available Description Under normal conditions there may be some constant offset in the demand signal analogue output amplifiers which causes the motor to settle at a position slightly different to the required position The InitialiseDemandOffset command sets the system up to correct for this assumed constant offset in all subsequent position control operations lt must be used every time the system is powered on when the system is in the position control mode to set the actual position as close as possible to the required position This is particularly necessary when the final position outside the final position window and at the end of a move command it returns the error message failed to reach target position The InitialiseDemandOffset command actually controlling the position and it has no effect if the motor is not driving the system Note that friction in the mechanical system can also cause a position offset after a move command is executed
172. es Declaration INST SetMapBaseAdvanceTimeConstant bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 50 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 50 bVarBOOL2 Inst bDone Example in FBD INST SetMapBaseAdvanceTimeConstant BvarBooL1 bDone bVarB00L2 T hErrar 1 iErrar lumber 50 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMapBaseOffset PMCprimo Command MB Set map base offset for master map positions Function library Mapping Description This function block allows the introduction of an offset to influence the position allocation between master and slave axis The value is subtracted from the position of the master axis it is the resulting position when using a softwaredifferential This effects a shifting of the position allocation line The position allocation line normally runs between the zero and final points If the value changes during a position allocation an alignment is executed with the velocity defined over the SetMapAdjustmentVelocity and the alignment acceleration SetAlignmentAcceleration page 109 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or
173. es are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiBank USINT 1 to 4 3 and A is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative diValue DINT Value for timerfunction O bis 65535 usiModus USINT Modus of Timerfunction see above Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function DefineBoundOverflowOutput and DefinePositionTriggerOutput The function block UndefineOutput is available for cancellation of the output definition Factory setting no timer defined User Manual PMCprimo SoftPLC 14 Function library primo lib Example Declaration INST DefineTimerOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in AWL CAL INST bExecute bVarBOOL1 usiNode 0 usiBank 1 usiOutput 5 usiPolarity 0 diValue 20 usiModus 4 LD INST bDone ST bVarBOOL2 Example Beispiel in ST NST bExecute bVarBOOL1 usiNode 0 usiBank 1 usiOutput 5 usiPolarity 0 diValue 20 usiModus 4 bVarBOOL2 Inst bDone Example in FUP INST Define TimerOutput bYarBOOL1 4beExecute bYarBOOL d4usiNode 1 4usiBank ierrorNumber S usiQuiput I AusiPalarity 2 divalue
174. ese data which has one start input bExecute and internally carries out all required initialisation Input variables bExecute BOOL The table is calculated in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 corresponds to MSTART sMapName STRING Name of the generated table corresponds to MNAME iSteps INT Number of the supporting points corresponds to MNPT iNumberElements USINT Number of the segments pdiMasterpos PDINT Pointer to the master positions corresponds to MMx pdiSlavepos PDINT Pointer to the slave positions corresponds to MSx pdiFunction PDINT Pointer to the relation functions corresponds to MFx pdiValuesA PDINT Pointer to the marginal parameter corresponds to MAx pdiValuesB PDINT Pointer to the marginal parameter corresponds to MBx pdiValuesC PDINT Pointer to the marginal parameter corresponds to MCx pdiValuesW PDINT Pointer to the marginal parameter corresponds to MWx pdiValuesX PDINT Pointer to the marginal parameter corresponds to MXx pdiValuesY PDINT Pointer to the marginal parameter corresponds to MYx pdiValuesZ PDINT Pointer to the marginal parameter corresponds to MZx Output variables bDone BOOL Table has been calculated True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203
175. ess of the defective unit is indicated in Byte 2 Value Meaning Removal 0 No failure Function in nodes is not available Check if unit is compatible to the Profibus DP standard or if the correct GSD was used No response data Check bus cable 17 No feedback of the slave node Check bus cable and bus address of the slave node 18 The unit is not integrated in the Check the highest station address of Tokenring the Profibus Master User Manual PMCprimo SoftPLC Page 17 Page 18 11 Control configuration Byte 3 Failure cause with internal failure Byte 2 is 255 I RN 55 Defective parameter value for the master Contact company Pilz configuration No configuration for the removed node Check the configuration Defective parameter value for the removed Contact company Pilz nodes Diagnostic Bytes of the Profibus DP Slave A Profibus DP Slave also writes diagnostic data in the diagnostic address range The address can be determined but not set in the control configuration as the required storage range is determined from the GSD file The first 6 Bytes are standard and have the following meaning Byte 0 Slave does not respond is internally located by the DP Master Slave is in a high running position parameter and configuration is evaluated Configuration failure Ext Diag Data are available from Byte 6 on Function is not supported False response from the Slave is internally located by the DP Master Pa
176. et to the value of SetReferenceOffset The return to the reference signal can be prevented with the function block SetReferenceOptionsWord page 272 The function block SetReference Timeout page 280 also acts with the execution of this function block reference signal Thy reference signal lt return to reference signal Illustration 21 Initialisation with return to the reference signal User Manual PMCprimo SoftPLC 14 Function library primo lib Input variables bExecute BOOL The initialisation is started in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system bDirection BOOL The rotational direction 0 negative 1 positive Output variables bDone BOOL Initialistion completed True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 See also InitialisePositionBounds Examples Declaration INST InitialisePosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bDirection 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bDirection
177. etClutchLength Factory setting 1000 milliseconds Examples Declaration INST SetClutchTime bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiClutchtime 200 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 uiClutchtime 200 bVarBOOL2 Inst bDone Example in FBD INST SsetClutch Time BvarBiooL1 BvarBOoL2 0 1 4usichannel ierroriNumber 200HuiGlutchtime Page 114 User Manual PMCprimo SoftPLC 14 Function library primo lib SetClutchWindow PMCprimo Command CI Set clutch window Function library Mapping Description This command defines a window for software clutch If SetClutchWindow 0 and the way for alignment is lower than Cl the slave makes an alignment move If SetClutchWindow z 0 and the way for alignment is higher than CI the slave is using software clutch Bit 1 of the function block SetMapOptionsWord is ignored But bit 2 and 3 is used for the clutch window If the master is moving the clutch window is ignored The clutch window can t used in speed mapping bit4 of SetMapOptionsWord and in tension control Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis nu
178. etpoint signal is not defined and therefore a motor should not be connected to a virtual axis sein The actual value acceptance signal is internally simulated Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Factory setting 0 Axis real User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetVirtualMotorMode bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiMode 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiMode 1 bVarBOOL2 Inst bDone Example in FBD INST Setvirualliotormode bYarBOOL1 4beExecute bDone bVarB00L2 04 usiNode hErrar 1 4usiChannel iErrarMumber 1 4usiMade User Manual PMCprimo SoftPLC Page 199 SetWindow Page 200 14 Function library primo lib PMCprimo Command SW Set window Function library Positioncontrol Description This function block is used to specify the permissible target window in increments PMCprimo signals position achieved if the motor is within the window target after the braking action Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the
179. fter detecting a reference signal 0 Moving back to the reference signal User Manual PMCprimo SoftPLC Page 247 14 Function library primo lib Start position correction SetReference OptionsWord Bit 2 Set Reference Position SetReference Correction Velocity Demand velocity 0 LJ Calculate the value SetReference i of correction Set Reference Acceleratio Correction of Only correction of motorposition position counter SetReference OptionsWord Bit 6 Way of acceleration Figure 34 Cooperation of the commands reference error correction Page 248 User Manual PMCprimo SoftPLC 14 Function library primo lib DefinePositionSnapshot PMCprimo Command PS Define position snapshot input Function library Referencing Description With this function block an encoder position snapshot can be stored with a digital input The stored value can be read with the function block DisplaySnapshotPosition see page 63 Only fast inputs for the definition can be used The encoder position snapshot is only executed when the reference function is activated with SetReferenceMode The stored value of the encoder position snapshot is independent from a reference offset set with SetReferenceOffset It is not possible to define additionally a position snapshot at this axis if a reference signal function block DefineReferencelnput or DefineZeroMarkerlnput is already been defi
180. function SetMapOptionsWord MapLinkSlaveToMaster SetScaleMapping SetMapBaseOffset and SetSlaveMapOffset Examples Declaration INST ExecuteMap bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sMapname Name LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 sMapname Name bVarBOOL2 Inst bDone Example in FBD INST ExecuteMap BvarBOOL1 BbExecute BvarBOoOLZ qdusiMade 1 Ausichannal ierrorMumber Name sMapname User Manual PMCprimo SoftPLC Page 93 14 Function library primo lib ExecuteMapVirtual Page 94 PMCprimo Command XV execute map virtual Function library Mapping Description With this function block a slave position can be determined with the specified master position and the position table Name As a result the slave position can be read for example in a variable without coupling All settings SetMapBaseOffset SetSlaveMapOffset etc are observed analogue to ExecuteMap page 94 The position table must have been transmitted before with TransferMapData to the axis MapLinkSlaveToMaster must have been executed at the axis Input variables bExecute BOOL The value is read in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system O if only on
181. g time or 1 millisecond cannot be measured and give a wrong value Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The length of the reference signal Also refer to DisplayReferenceLengthFalse User Manual PMCprimo SoftPLC Page 61 Page 62 14 Function library primo lib Examples Declaration INST DisplayReferenceLengthTrue bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST LisplayFeferenceLengthTrue bVarb00L1HbExecute bVarBOOL 04usiNode 1HusiChannel User Manual PMCprimo SoftPLC 14 Function library primo lib DisplaySnapshotPosition PMCprimo command DS Display snapshot position data Function library Display
182. gative direction there are different behaviour with different versions The output and the axis must be on the same network participant Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1to4 3and4is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity 0 positive 1 negative diPostion1 DINT The initial position 4 000 000 diPostion2 DINT The final position 4 000 000 Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetPositionBound SetPositionOutputHysteresis and SetPhaseAdvanceFactor The function block UndefineOutput is available for cancelling the output definition Factory setting No output defined User Manual PMCprimo SoftPLC Page 149 Page 150 14 Function library primo lib Examples Declaration INST DefineMotorErrorOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput
183. h OV with the PMCprimo 2 2 16 and the relay of the axis opens This relay should be used as controller or drive release The relay simultaneously damps the setpoint output with OV In case the motor controller is locked with the relay the motor coasts freely This function can also be used as alternative Stop Command With the function GlobalOff see page 177 the function MotorOff can be executed at all axes at the same time Input variables bExecute BOOL The motor is switched off in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Motor is switched off True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function MotorOff und GlobalOff Examples Declaration INST MotorOff bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST Motor otf bYVarBOOL1 4bExecute bvarBooOL7 I HusiMade 1 Ausichannal ierrorMumber User Manual PMCprim
184. he included CoDeSys licence label must be attached at the unit in case of a subsequent activation Note The PMCprimo commands are described in a separate programming user manual Additionally the programming tool CoDeSys Controller Development System is necessary which is always required for a programming This tool serves for a programming in the various IEC 61131 languages IL LD ST FBD etc and directly generates an assemble code at the processor of the control unit Without this program it is not possible to carry out modifications When installing the CoDeSys program additionally a so called target information data is installed which describes the characteristics of the PMCprimo control Change since version 2 001 The RAM memory is now allocated dynamically from the PLC This means the PLC program is not limited to 256 KB or 2MB The PLC program can be as big as free memory is available User Manual PMCprimo SoftPLC 8 News in PMCprimo firmware version 2 005 8 News in PMCprimo firmware version 2 005 Function block PMCprimo News Change Page command SetAlignmentAcceleration SetMapBaseAdvance SetMonitorOutputGain SetClutchWindow SetReferenceErrorLimit SetClutchLength SetReferenceFalseHighLimit SetReferenceFalseLowLimit SetReference TrueHighLimit SetReferenceTrueLowLimit SetPositionOutputHysteresis SetReferenceCorrectionVelocity SetReferenceHoldOffTime SetVelocityOutputHysteresis New primo lib Change of limits of s
185. he next bound position positive or negative direction Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL No more waiting True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Examples INST WaitForBoundPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FDB INST WaitForBaundPasitian bVarB00L1HbExecute bDone bVarB 002 04usikode bErrar 1 Ausichannal iErrar lumbar Page 304 User Manual PMCprimo SoftPLC 14 Function library primo lib WaitForRelativePosition PMCprimo Command WR Wait for relative position Function library Wait Available as of version 2 000 Description This function block tells PMCprimo to wait until it reaches the specified position relative to some previous position The position is specified in increments The function block WaitForRelativePosition starts a position
186. he node number in the linked system O if only one unit or Host usiBank USINT The input group from 1 to 3 usilnput USINT The input from 1 to 8 Output variables bDone BOOL Definition reset True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DefinePositionSnapshot and DefineReferencelnput User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST Undefinelnput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiBank 1 usilnput 3 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiBank 1 usilnput 3 bVarBOOL2 Inst bDone Example in FBD INST Undefinelnput bVarBO0L1HbExecute bvarBOOLZ o usiNode berrore 14usiBank iErrarMumhbhear 3 1usilnput User Manual PMCprimo SoftPLC Page 283 14 16 Tension Control Page 284 14 Function library primo lib With the web tension control tension winding up processes can be realised for example The value of the analogue input is decisive for the control loop of the web tension The value of the analogue input is read at regular intervals real time and from that a transmission ratio between the master and slave axes is calculated The algorithm for this calculation is i
187. he slave axis The absolute Slave Position is multiplied with the counter and divided with the denominator In case the transmission ratio changes with an active position allocation the velocity for the equation with the parameter SetMapAdjustmentVelocity page 117 and the acceleration with the value of the parameter SetAlignmentAcceleration page 109 is determined in case of the change over of the position at the slave axis Example transmission ratio 1096 361 The actual demand position of the slave axis is the demand position from the position allocation multiplied with the factor 1096 361 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiCounter UINT The counter 0 up to 65535 As of version 2 005 new Factory setting 400 000 uiDivider UINT The denominator 1 up to 65535 As of version 2 005 new Factory setting 400 000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetMapAdjustmentVelocity and SetAlignmentAcceleration Factory setting counter 1 denomi
188. he value of the analogue input exceeds one of the adjusted limit value the error output changes its logical condition The logical condition of the output is in case of an error this one which has been specified with the sign If the value of the analogue input returns to the permissible range the status of the error output changes back again Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnaloguelnputHighLimit and SetAnaloguelnputLowL imit The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defined User Manual PMCprimo SoftPLC Page 141 Page 142 14 Function library primo lib Examples Declaration INST DefineAnalogueLimitErrorOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example i
189. ibrary primo lib The input and output variables are adapted to the Hungarian notation As a result an easy connection between variable names and value ranges is possible C qua 0 Li 000 dE double int 2147483648 up to 2147483647 LEE 14 1 Versions of Primo lib In the directory Target Primo different libraries are stored Depending to the firmware version a corresponding version of library has to be used If the wrong version is used then new function can t be used To use the right version either rename or copy the file to primo lib or use the library manager in CoDeSys to replace library primo lib by the right version Released versions Primo V1 0OO8 lib For firmware version 1 008 and also for 1 009 first version Primo V1 010 lib For firmware version 1 010 new function blocks With this versions the maximum numbers of POU is 512 The version 1 008 can also used with firmware version 1 010 if the new function blocks are not needed It is not possible to use the library 1 010 with the firmware version 1 008 or 1 009 because there will be error messages while downloading the project Primo V2 OO0 lib For firmware version 2 000 up to 2 002 new function blocks and some changes Primo V2 003 lib For firmware version 2 003 Primo V2 OO4 lib For firmware version 2 004 Use this version if the firmware version 2 004 is in PMCprimo Don t use another library From version 2 000 the maximum numbers of POUs is 4096 If there is an error
190. imo lib SetMapBaseAdvanceTimeConstant PMCprimo Command BT Set base advance time constant Function library Mapping Description This function block is effective when using the module SetMapBaseAdvance The value specifies a period during which PMCprimo determines the averaged velocity of the axis This average velocity uses PMCprimo instead of the actual velocity for calculating the phase shifting of a Offset of the master position at the slave axis PMCprimo does not determine any averaged velocity of diValue 1 The velocity brought to an average is also used in order to notice if the master drives with the function ExecuteMap see page 92 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The time from 1 to 10 000 milliseconds Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapBaseOffset and SetMapBaseAdvanceTimeConstant Factory setting 1 millisecond User Manual PMCprimo SoftPLC Page 121 Page 122 14 Function library primo lib Exampl
191. in 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 1 bVarBOOL2 Inst bDone Example in FBD INST SetaccelerationF eedForwardGain bVarBO00L1HbExecute hvarBOooL7 I HusiMade 14usiChannel 1 00000 uiGain User Manual PMCprimo SoftPLC Page 181 14 Function library primo lib SetControlWord PMCprimo Command CW Set control word Function library Positioncontrol Description With this function block the user can determine the counting direction of the encoder the velocity curve for moving commands and the sign of the setpoint output of each axis Bit 0 stands with inputs and outputs on the right and Bit 7 on the left Attention The counting direction of the encoder and the sign of the setpoint output should only be modified with an open position control loop This inverting functions are used for simplification of the initial start up of the motor saves rewiring and allows an adaptation of the direction of motion of PMCprimo to the definition of the direction of motion of the user Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system usiControlword USINT The control word with following mea
192. independent master positions determine the demand position of the slave axis 0 Function Softwaredifferential closed 1 Function Softwaredifferential released Bit 5 This Bit determines if the demand position of the slave axis for the function Softwaredifferential is the sum or difference of the Masterpositions 0 The Masterposition are added 1 The position of the 2 Master axis is subtracted from the 1 Master axis Bit6 This Bit determines if the sign for the demand position of the slave axis is negated for the function Softwaredifferential 0 The polarity sign is not negated 1 The polarity sign is negated Bit 7 not occupied User Manual PMCprimo SoftPLC Page 125 14 Function library primo lib Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function MapLinkSlaveToMaster and MapLinkSlaveToDifferentialMaster Factory setting 0 Examples Declaration INST SetMapLinkOptionsWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 101 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 101 bVarBOOL2 Inst bDone Example in FBD INST SetMapLinkOptions Wortd ba
193. ion library primo lib Examples Declaration INST MapLinkSlaveToDifferentialMaster bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiLinkNode 0 usiLinkChannel 2 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiLinkNode 0 usiLinkChannel 2 bVarBOOL2 Inst bDone Example in FBD INST hapLinkSlaveToDifferentialaster bYarBOOL1 4beExecute bDone bYarBOOL Il 1usiMade hErrar 1 Ausichannel iErrorMumbear 04UusiLinkusiNode 2Z4UusiLinkusiChannel User Manual PMCprimo SoftPLC Page 103 14 Function library primo lib MapLinkSlaveToMaster Page 104 PMCprimo Command ML Map link slave axis to master axis Function library Mapping Description With this function block the instantaneous axis is determined as slave axis The arguments indicate the requested master axis This command must be used before activation of a position allocation in any case as PMCprimo cannot execute a position allocation without definition of a master axis Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiLinkNode USINT The node number of the master ax
194. ions are defined by pre setting of the web tension with the function module SetAnalogueControlWord The Bits 0 1 and 4 of the module SetMapOptionsWord are compulsory set to 1 by the release of the web tension control It is a must for the function of the software clutch and the velocity ratio in the web tension control circuit In case Bit 4 or Bit 5 of SetAnalogueControlWord are set to 1 PMCprimo automatically initialises the transmission ratio before the position allocation is activated for the web tension control PMCprimo measures the distance between both positions where the limit values for the analogue input are exceeded or fall below by moving the master slave axes The transmission with these measured values obtains a good estimation for the transmission ratio with an activation of the web tension control This values allows PMCprimo to achieve the transmission ratio to be driven considerably faster than using the pre set transmission ratio SetScaleMapping especially then when the machine does not start from the initial position Winding up or unwinding is an example for this application Normally the machine starts with a full or empty coil and the initial transmission ratio is specified by the function module SetScaleMapping A restart after an interruption takes place smoothly as a transmission ratio determined at last is used for the start If the machine however is started with partially winded or unwinded coils with unknown dia
195. is usiLinkChannel USINT The axis number of the master axis Output variables bDone BOOL Definition closed True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapLinkOptionsWord Factory setting no master axis defined User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST MapLinkSlaveToMaster bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiLinkNode 0 usiLinkChannel 2 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiLinkNode 0 usiLinkChannel 2 bVarBOOL2 Inst bDone Example in FBD INST hapLinkSlaveTomaster BvarBooOoL1 bVarB00L2 i U4usilinkusiNode usiLinkusichannel User Manual PMCprimo SoftPLC Page 105 14 Function library primo lib Motiongenerator PMCprimo Command M Function library Mapping Description With this function block a table allocation can be calculated by the internal motion generator The program PMotion can be used for generation of a pre manufactured function block with 6 all necessary variables The definition is essentially facilitated by this program as the curve lt position is carried out graphically A function block can be exported from th
196. is During the input of absolute positions for the slave axes each value represents the demand position of the slave axis in connection to the master axis The associated master positions result from the position bound number positions The table positions are centrally stored Therefore position allocations which are used in several axes must only be set once The data of the position allocation are transmitted to the particular axis with the function TransferMapData page 139 This function must be uniquely executed before the first execution of the function ExecuteMap to the corresponding axis The first position of the master is always 0 during the enter of position allocations Only the entered table values are stored The values between the table positions are determined by linear interpolations if the table step range is bigger than 1 This enables the user to prepare easily a position allocation with relatively few table values over a big allocation range without occupying much memory space Position allocations can internally be generated with the option Motiongenerator if the option is released with the SK command The software function differential allows the synchronisation of a drive in such a way that it can follow both the sum and the difference of the positions of two master drives This takes place analogue to a differential gear unit The slave axis must be defined as slave of a master axis with the function MapLink
197. l It is not necessary to call the function blocks SetBusVariable and GetBusVariable for this variables The variables can be accessed from address 1000 to 2034 at the Modbus side e g PrimoData It is possible to add the elements PMCprimo Global Variables in the PLC configuration module PMCprimo Here it is possible to access different data without using the corresponding function blocks Then the global array g_ PrimoData 1 20 can be used e STRUCT diDemandPosition DINT diActualPosition DINT diFollowingError DINT diActualSpeed DINT iActualError INT iActualState INT diReserved ARRAY 0 2 OF DINT END STRUCT Note to keep the CAN bus load low only data from the host is available Informations from the node are not stored in this global structure Therefore the function blocks for example DisplayActualPosition has to be used Change as of version 2 006 e Now the array g iModbusData accepts 2048 0 2047 values The variables can be accessed from address 1000 to 3047 at the Modbus side User Manual PMCprimo SoftPLC 14 Function library primo lib 14 4 The subdivision The function blocks are listed in table of contents to explain the affiliation Auxiliary Funtion modules for definition and setting of the analogue auxiliary output BusVariables Function blocks for writing and reading of the bus variables to PMCprimo CAN Function blocks for writing and reading of SDO data As a result an access to the obje
198. ldbus Change offset for Fieldbus Enable channel 5 CAN encoder CO nD UV A W NO L O CAN Cycle time 9 CAN node number 10 Flashmemory for SoftPLC 14 Change RS 232 configuration 16 Change startup delay Choice Return ESC exits menu 10 Flashmemory for SoftPLC 0 123KB 1 192KB 2 256KB 128KB 192 All data will be deleted Are you sure Y N Y Restore in Flash necessary Please exit menu with ESC to save parameters and then reboot system User Manual PMCprimo SoftPLC Page 25 13 SoftPLC in PMCprimo 13 3 Working storage The available RAM storage is dynamically distributed among all tasks 16MB storage are sufficient for all thinkable programs 13 4 Battery back up storage PMCprimo Drive No battery back up available PMCprimo 2 2 In case of the PMCprimo 2 2 7392 Bytes are available for the PLC as battery back up storage If the version is less then 2 004 then 2048 bytes are available This storage can take up variables which are marked with the keyword RETAIN The computer automatically files these variables into this special storage range PMCprimo 16 In case of the PMCprimo 2 2 124 KBytes are available for the PLC as battery back up storage This storage can take up variables which are marked with the keyword RETAIN The computer automatically files these variables into this special storage range PMCprimo Drive2 If the optional expansion board is mounted then 7382 Bytes are available 13 5 Integ
199. length of the reference signal Also refer to DisplayReferenceLengthTrue User Manual PMCprimo SoftPLC Page 59 Page 60 14 Function library primo lib Examples Declaration INST DisplayReferenceLengthFalse bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST Display eferenceLengthFalse BpvarBOoL1 b5Execute bDane bVarBOOL d usiMode beate 14usichannal iErrorMumber divalue_ div alue User Manual PMCprimo SoftPLC 14 Function library primo lib DisplayReferenceLengthTrue PMCprimo command ZY Display length reference signal true Function library Display Description The length measured before is read with this function block over which the reference signal had the condition TRUE This indication is only made when Bit 0 of SetReferenceFilterOptionWord page 267 is set to 1 In case Bit 0 of the SetReferenceFilterOptionWord is set to 0 then automatically ZX is also set to zero Note To be able to measure the length of the reference signal the edge to be recognised is always changed internally The time for the reprogramming is the debouncing time Function SetReferenceHoldoffTime page 269 Signals which are shorter than the debouncin
200. ller a constant following error can be obtained during driving with constant velocity By specifying a factor the following error can be reduced against zero or even brought to the negative range The factor is added to the required velocity so that the measured actual velocity is equal to the calculated setpoint velocity For the PMCprimo Drive the value can be determined by the following formula KF 15360 1000 resolution per revolution Example resolution 4096 increments revolution gt KF 3750 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiGain UINT The control factor from 0 to 65535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetAccelerationFeedForwardGain SetDifferentialGain SetlntegralGain SetProportionalGain und SetVelocityFeedbackGain Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetVelocityFeedForwardGain bVarBOOL1 BOOL bVarBOOL2 BOOL Ex
201. lseLowLimit With an indication of uiValue 0 at all four parameters an inspection of the limit values does not occur Summary A reference input is evaluated as such if e SetReferenceTrueLowLimit lt distance with reference input DefineReferencelnput true lt SetReferenceTrueHighLimit and e SetReferenceFalseLowLimit lt length of travel with reference input DefineReferencelnput untrue lt SetReferenceFalseHighLimit FH F N UN 20 gt ZL ZX x ZY high low distance Illustration 36 Limit values for the evaluation reference input This possibility is used to be able to filter a valid reference signal from a spectrum of signals of the reference sensor This filter characteristic is especially suitable for printing and registration applications These functions are enabled with the function blocks SetReferenceFilterOptionWord Bit 0 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 User Manual PMCprimo SoftPLC 14 Function library primo lib 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The value from 0 to 65535 increments As of version 2 004 new range 2 000 000 000 Ab Primo V2 006 lib udiValue UDINT Output variables bDone
202. ly one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue DINT The absolute target position in increments in the range of 4 000 000 Output variables bDone BOOL Target position has been achieved True or movement is still not completed False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAcceleration SetVelocity SetDeceleration SetSlowSpeedMode SetLowPositionLimit SetHighPositionLimit SetMoveOptionsWord and SetSlowSpeed Examples Declaration INST MoveToAbsolutePosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 2000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 2000 bVarBOOL2 Inst bDone Example in FBD INST MoveToAbsolutePosition bYarBOOL1 4bExecute bDone BvarBOooL 0 usiMode bError 1 4usichannal ierrorMumber 20004div alue Page 224 User Manual PMCprimo SoftPLC 14 Function library primo lib ResetError PMCprimo Command Fx x 0 Function library Positioning As of version 1 010 available Description With this function block a channel error is erased and also the error message at the LCD display is cleared Input variables bExecute BOOL The error is cleared in case of a change fr
203. made by relative position The actual position in PMCprimo is still present The behavior is the same like an incremental encoder As of version 2 004 6 This extension operates only with PMCtendo DD4 version 5 15 and higher New settings SetFeedbackEncoder 24 to 26 As with SetFeedbackEncoder 21 to 23 the demand position is sent to PMCtendo DD4 and the internal position loop of the PMCtendo DD4 is used The referencing with INMODE2 26 is also available The difference is that the actual following error and the actual current is received To get the right value the drive commands PGEARI and PGEARO are changed automatically from PMCprimo to 1048576 if PRBASE is 20 or 65536 if PRBASE is 16 The setting of the following error PEMAX inside PMCtendo DD4 has to be adjusted by the customer The function should be only for service or adjusting If the machine is finished then the SetFeedbackEncoder should be set to SetFeedbackEncoder 21 to 23 to decrease the bus load Page 78 User Manual PMCprimo SoftPLC 14 Function library primo lib Overview FS settings and technical data Description Delay time for demand Accuracy reference inputs signal Incremental encoder PMCprimo Drive Hardware register lt 1us Channel x 1 At the end of the 1ms X4 multiplication PMCprimo Drive Interrupt Depending of channel x 1 4096 processor load 200 300us increments turn Analogue output In the 1ms inter
204. mber from 1 to n depending on the system diValue UINT position window Ab Primo V2 006 lib uiValue UINT Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetMapOptionsWord Factory setting 0 increments User Manual PMCprimo SoftPLC Page 115 14 Function library primo lib Examples Declaration INST SetClutchTime bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiClutchtime 200 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 uiClutchtime 200 bVarBOOL2 Inst bDone Example in FBD INST setClutchy vind oy bYarBOOL1 4bExecute bYarBOOL dusiMade 1 4usiChannel ierrorMNumber 2004diValue Page 116 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMapAdjustmentVelocity PMCprimo Command AV Set map base offset scale factor adjustment velocity Function library Mapping Description The modification introduction of the map base offset or map offset SetMapBaseOffset and SetSlaveMapOffset page 138 or the scale map SetScaleMapping page 136 provides a new demand position for the slave axis PMCprimo can limit the maximum velocity during the alignment by the aid of th
205. mber in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The value from 0 to 65535 As of version 2 005 new range 65 535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetVelocityAveragingTime Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST SetReferenceAdvanceFactor bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 100 bVarBOOL2 Inst bDone Example in FBD INST aetRefterenceAdvanceF actor BvarBOO0L1 BExecute bDone BvarBOOoLZ dusiMade hErrar 1 4usiCchannel ierrorNumber 1004uiValue User Manual PMCprimo SoftPLC Page 259 14 Function library primo lib SetReferenceCorrectionVelocity PMCprimo Command RV Set reference correction velocity Function library Referencing Description The correction of a reference error requires a temporary velocity modification during the execution of a movement PMCprimo can limit the maximum velocity duri
206. message while compiling the project then change in the target setting the maximum number of POUs Page 30 User Manual PMCprimo SoftPLC 14 Function library primo lib 14 2 Example of a program In the following example there is a program which calls the function block MoveToAbsolutePosition PLC_PRG PRG FBD DOM PROGRAM PLC PRG Einschalten1 EnablePositionControl usiNode USINT 2 usiChannel USINT 1 Zeitverzoegerung TON Geschwindigkeit Setvelocity Position1 MoveToAbsolutePosition Einschalten1 EnablePositionControl i O4bExecute bDone usiNode usiNode bError usiChannelusiChannel iErrorNumber Geschwindigkeit Setvelocity Illustration 8 Example of a function block Positioni MoveToAbsolutePosition The program switches the axis 1 to the node in a position control as soon as the input 1 is energised with 24V Afterwards a time delay of 20 ms runs enabling the servo control to overtake this information and to build up the torque Afterwards the demand speed is set and an absolute positioning is executed When this movement is completed the output bDone of the function block position 1 TRUE is resignalled User Manual PMCprimo SoftPLC Page 31 14 Function library primo lib 14 3 Global variables Page 32 With version 2 004 additional global variables are available e g iModbusData 0 1023 OF INT With the array it is possible to access directly 1024 variables with the Modbus protoco
207. meters the transmission ratio normally specified is not suitable for the new coil diameter The machine can be started by this automatic initialisation of the transmission ratio at the beginning of the web tension control without a big settling process of the web tension control circuit of the pre set ratio to the actually required transmission ratio User Manual PMCprimo SoftPLC Page 289 Page 290 14 Function library primo lib Input variables bExecute BOOL The mode of operation is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiMode USINT The mode of operation 0 switched off 1 switched on Output variables bDone BOOL Mode of operation set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueControlWord and ExecuteMp Factory setting 0 switched off Examples Declaration INST SetAnalogueControlMode bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiMode 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiMode
208. mo SoftPLC 14 Function library primo lib Examples Declaration INST SetReferencePosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 2000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 2000 bVarBOOL2 Inst bDone Example in FBD INST oetkeferencePosition 11 bvarBooOL1 bExecute bDone bVarBOOL2 E 04usiNode hErrar 1HusiChannel ierrorMumber 20004 di alue User Manual PMCprimo SoftPLC Page 275 14 Function library primo lib SetReferencePositionAtOtherPosition Page 276 PMCprimo Command RK Function library Referencing Description This function block effects that the reference error correction of the actual axis is executed at the position of another axis The actual axis waits until the other axis has reached the specified position and starts only then with the reference error correction The function block SetReferencePosition page 274 is not effective any more on the actual axis Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiAtNode USINT The node number in the linked system
209. n IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST Diefine amp nalagueLirmitErrar output BvarBOoOL1 bDone BvarBOoOLbZ bErrar ierror umber D n a Se User Manual PMCprimo SoftPLC 14 Function library primo lib DefineBoundOverflowOutput PMCprimo Command BO Define bound overflow output Function library Output Description With this function block a pulse output can be activated in case of exceeding the position bound If the selected axis exceeds the cycle limit PMCprimo gives a pulse of 1ms to the defined output Input variables bExecute BOOL The output is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT
210. n a cyclic way and therefore this task is never in an idle running condition this one has the second lowest priority Only the task for the Motiongenerator software option has still a lower priority As soon as the Motiongenerator must generate a curve the PLC task is not started with each cycle for 2 milliseconds This means the minimum cycle time has 2ms plus the operating time If the Motiongenerator is not active the PLC task is restarted immediately It depends on the size of the PLC program which cycle time is completely to be realised Example With PMCprimo 16 5000 IL instructions needs approx 0 5 ms gt When Motiongenerator active cycle time 0 5 ms 2 ms 2 5 ms In case the Motiongenerator is not active the cycle time amounts to 0 5 ms In case of this example the inputs are memorised and processed every 0 5 ms and then the outputs are updated This time can be extended if tasks with a higher priority as for example the servicing of the program for PMCprimo programs require processor time To be able to measure the cycle time the global variable g diCycleTime has been implemented This variable reproduces the cycle time without possible 2 ms pause when the Motiongenerator is active 13 1 Start of the system During start of the system information as to the PLC program are indicated The information of the project stored last is indicated which generate in CoDeSys with the function Bootproject and secured in Flash
211. n constant KF velocity feed forward gain constant KA acceleration feed forward gain constant ei position error demand position measured position dj demand position pj measured position The dynamic behaviour of the drive depends on these constant factors and on the mechanical behaviour of the driven machines The setting of these factors is essential for obtaining an optimum control behaviour The following connection between the following error and setpoint issue is valid Vso error KP 256 10 2048 PMCprimo offers additional functions for tuning the control loop At the analogue output e g master axis is not position controlled different information can be shown at an oscilloscope or at another recording unit Block circuit diagram of the position control dx dx demand position measured position E ncoder User Manual PMCprimo SoftPLC Page 175 14 Function library primo lib EnablePositionControl PMCprimo Command PC Enter position control mode Function library Positioncontrol Description This function block activates the position control of the motor In case of an active position control loop a relay per axis is controlled with the PMCprimo 2 2 with which the control unit is released for the drive The position control is deactivated in case of a motor error The active position control signals PMCprimo with the sign gt at the serial interface or at the LED Display signal see
212. n library Positioning Description The motor stops at the specified position with the instantaneours velocity and the deceleration ramp specified with the function block SetDeceleration page 232 The command SetMotorToPosition can be used with every movement PMCprimo signals S during this process The target position must be lt SetPositionBound value Enhancement as of version 2 004 In the past the command stop to position example diPosition 0 with mapping the active map was only kept until the deceleration was started Then a linear ramp ramp depending from SetClutchTime or SetClutchLength was used to stop the slave If the master was stopped in that time then the slave still moved to the target position because the master slave link was already opened The slave moved therefore sometimes more than the master Now with SetMapOptionsWord bit 6 it is possible to maintain the master slave link also while decelerating until the final target position is reached This means that the slave is stopping as the master and then waiting until the master is moving again until the slave reaches the position The setting of CL is always used This means the bit 5 of SetMapOptionsWord SetClutchTime SetClutchLength setting see page 127 is ignored because with command SetClutchTime it is not possible to reach the target position Input variables bExecute BOOL The axis is stopped in case of a change from O to 1 0
213. nReference It can be determined with Bit 1 of the function block SetErrorOptionsWord page 188 if the motor shall be switched off additionally to this error signal Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UINT The reference error limit from 0 switched off to 65535 Increments Ab Primo V2 006 lib uiValue UINT Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetErrorOptionsWord Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetReferenceErrorLimit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 500 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 500 bVarBOOL2 Inst bDone Example in FBD INST setReferenceErrorLimit bYarBOOL1 4bExecute bDone bVarB00L2 0 usiNode hErrar 1 4usiChannel iErrarMumhbhear 5004
214. nate wrong reference signals which are located far away from the position to be expected or allows a cyclic referring although the reference signals do not coincide with the set position bound If PMCprimo recognises a reference signal the reference error is calculated as difference between the zero point defined with the zero point and the zero position or the position bound In case the reference error is within the set value and Bit O of SetReferenceOptionsWord page 272 is 1 the reference error is corrected at the motor In case the reference error is outside of the set limit value the action depends on PMCprimo on Bit 1 of the function SetReferenceOptionsWord and the value of the function SetFilterOnReference page 253 In case Bit 1 is set from SetReferenceOptionsWord 0 and SetFilterOnReference to 0 the reference error is not corrected and the error message The reference error limit has been exceeded is not issued The reference error is completely ignored In case Bit 1 of SetReferenceOptionsWord 1 and SetFilterOnReference is unequal to 0 the value of SetMaxReferenceCorrection is aligned as error maximum at the motor Is the reference error bigger than SetMaxReferenceCorrection the value of the function block SetRefereneErrorLimit page 262 zero and Bit 1 of SetReferenceOptionsWord 1 or SetFilterOnReference unequal zero the error signal The reference error limit has been exceeded is issued It the value of SetReferenceErro
215. nator 1 User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetScaleMapping bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiCounter 1 uiDivider 2 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diCounter 0 uiDivider 2 bVarBOOL2 Inst bDone Example in FBD INST SetscaleWlapping bYarBOOL 4bExecute bYWarBOOoL I 4usiMade 1 usichannal ierrorMumber 1quiCounter z uibivider User Manual PMCprimo SoftPLC Page 137 14 Function library primo lib SetSlaveMapOffset Page 138 PMCprimo Command MF Set slave map position offset Function library Mapping Description This function block allows the introduction of an offset for influencing the position between master and slave axes The value is added to the demand position of the slave axis allowing a shift of the position allocation line relative to the position of the master axis The position allocation line normally runs between the zero and final points If the value changes during a position allocation an alignment with the velocity defined via the function SetMapAdjustmentVelocity and the alignment acceleration SetAlignmentAcceleration page 109 is executed Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables a
216. nction block an output can be set for the time to true for which a reference error correction is executed With the function blocks DefineReferenceBackwardOutput and DefineReferenceForwardOutput an output for a certain correcting direction is defined With this function block an output signal is executed in both correcting directions Change as of version 1 008a The output is set for 1 millisecond to 1 also the reference error is O In older versions the output was not set in this case Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetReferenceMode DefineReferenceBackwardOutput DefineReferenceForwardOutput and DefineReferencelnput The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defin
217. ned Input variables bExecute BOOL The input is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT The input group only 1 possible usilnput USINT The input 1 to 2 PMCprimo Drive 1 to 4 PMCprimo 2 2 1 to 4 PMCprimo 16 usiPolarity USINT 0 falling edge 1 rising edge Output variables bDone BOOL Input has been defined True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions DisplaySnapshotPosition and SetReferenceMode Factory setting Input not defined User Manual PMCprimo SoftPLC Page 249 14 Function library primo lib Examples Example in IL Declaration INST DefinePositionSnapshot bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usilnput 2 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diPosition 3000 usiBank 1 usilnput 2 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DefinePositionSnapshot bYarBOOL1 4bExecute bDone Bva
218. ng an overshoot Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiGain UINT The control factor from 0 to 65535 Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueDifferentialGain SetAnaloguelntegralGain und SetAnalogueControlMode Factory setting 10 000 Examples INST SetAnalogueProportianalGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGain 1000 bVarBOOL2 Inst bDone Example in FDB INST setAnalogueProportianalGain bYarB00L1 bExecute bDone bVarBOOL2Z usiMadae ee 0 0 SEIS 1qusiChannel iErrorNumber 1000HuiGain Page 300 User Manual PMCprimo SoftPLC 14 Function library primo lib SetAnalogueRangeDistance PMCprimo Command AR Define analogue range distance Function library Tension Description This function module determines the distance betwe
219. ng the correction of a reference error The correction of a reference error is executed as step function when indicating zero The velocity is indicated in 9o of the actual demand velocity If a reference error is detected with on a stopped axis the error is compensated with the velocity of SetSlowSpeed page 236 Following connection is valid for values unequal O Velocity modification instantaneous velocity x set value 100 If PMCprimo recognises a reference signal before the existing reference error has been aligned PMCprimo signals reference correction overrun This error can occur if SetMapAdjustmentVelocity is too small and very short position bounds If Bit 2 of the function block SetErrorOptionsWord page 188 is set PMCprimo switches off the motor in case of an error The acceleration for executing a reference error Illustration picture below can be set with the function block SetReferenceAcceleration Velocity Reference signal Reference error SV Set Bound Time Illustration 35 Reference error correction with factor Page 260 User Manual PMCprimo SoftPLC 14 Function library primo lib Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n
220. ng the function Softwaredifferential can be released and determined With an active function the demand position is achieved from the sum or difference of two master axes The 2 master axis must be defined with the function block MapLinkSlaveToDifferentialMaster page 102 The function can released and determined with the Bits 4 to 6 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiControlword USINT Each Bit has the following meaning Bit 0 This Bit determines if the slave axis shall follow the demand or actual values of the master axis 0 The slave axis follows the demand positions of the master axis 1 The slave axis follows the actual positions of the master axis Bit 2 New function as of version 2 000 In speed mapping it is possible to restrict the slave velocity to a maximum value of SetVelocity and a minimum value of SetSlowSpeed The bits 2 and 3 of SetMapOptionsWord for definition of direction are active in this case 0 Function speed limit is not active 1 Function speed limit is active if bit 4 of MW is set to 1 Bit 2 not occupied Bit 3 not occupied Bit4 This Bit releases the function Softwaredifferential The sum or the difference of two
221. ning Bit 0 Program abort with a motor error 0 Axle programs which wait for an execution of a moving command are stopped 1 Axle programs are not stopped due to motor errors Bit 1 Storing of positions in the battery backed SRAM This function is only available in the PMCprimo 2 2 16 O Positions are not stored in SRAM 1 Actual position is permanently kept in SRAM This Bit cannot be stored If the last position shall be read in by SRAM after switching on the Bit must be set in the start up program The data are reflected in SRAM and checked after switching on In case of a failure an error message is signalled axle specific Attention This bit may only set when all commands affecting the position are set command SetFeedbackEncoder SetNumberOfBits SetEncoderScaling SetPositionBound If the bit is set too early then the position in the ram may be wrong Enhancement as of version 2 004 If a motor is moved to a negative position and then PMCprimo is switched off and on then the position is calculated to a negative position In former versions the position was calculated to a positive position It is important that the motor is not moved more than the half bound length manually when the system is switched off Page 182 User Manual PMCprimo SoftPLC 14 Function library primo lib Bit 2 Definition of the velocity curve for accelerations and braking actions 0 Trapezoidal velocity curve for the functions Mov
222. nsient SIDIAO B siii ine 25 139 Wokna SION R 26 19 4 Battery back up storage ici ciaisicvinivesrsdaracesetecisbuiolaisnduiaciemniatecmoiecisiinataiandeiselannatade 26 13 5 Integration of the SoftPLC in PMCprimoO 26 13 6 PMCprimo programs ei 28 2 Contents 14 Function library primo lib ii 29 14 1 Versions of Primo lib e 30 14 2 Example of a program iii 31 14 3 Global variableS iii 32 14 4 ThesubaIiVISIODlsssstascos ee euEE CRX UE EREXSEU ONERE ES EVER UFuE UREE e EX NA aN IRANESE UrFE Nx KUrERO xi nES da 33 14 5 A Auxiliary ii 34 eS MEE UIS lel m 41 14 7 CAN Net and CAN cpen i 44 i Dpr 02 14 9 D aE lulu 66 00 EM OUO RR RR RR RAR RNA 69 14 11 Mapping ii 84 X Pe Ual 141 14 13 Positioncontrol e 175 4004 Fr OSIM acetate eurenica S T 201 14 15 Referencing i 246 14 16 Tension eiue 284 14 17 Wait ie 302 15 Function library primo tools lib 311 16 Cross reference list PMCprimo Commands SoftPLC Functions 312 EM odum 315 Page 4 User Manual PMCprimo SoftPLC 3 Contents of illustrations Contents of illustrations Illustration 1 target system Illustration 2 m
223. nts seconds and a value of 500 This factor can also be considered as set time A value of 1 corresponds to 15 625 microseconds A phase shifting of 64 therefore corresponds to 1 millisecond and therefore to the way this axis moves in this time Is the delay in time for example of the connected valve known the factor can be calculated quite easily For the calculation the averaging actual velocity is used The time base can be set with the function block SetVelocityAveraging Time User Manual PMCprimo SoftPLC 14 Function library primo lib Electric cam without speed depending phase shift level output n 500 800 Position Electric cam with speed depending phase shift at a speed of v 1000 inc s and a phase shift SetPhaseAdvanceFactor 2560 level output n 500 800 Position Electric cam with speed depending phase shift at a speed of v 5000 inc s and a phase shift SetPhaseAdvanceFactor 2560 level output n 500 800 Position Illustration 19 Speed depending phase shift User Manual PMCprimo SoftPLC Page 167 Page 168 Input variables bExecute BOOL usiNode USINT usiChannel USINT usiBank USINT usiOutput USINT usiPolarity USINT Output variables bDone BOOL bError BOOL iErrorNumber INT Connected function 14 Function library primo lib The value is written in case of a change from O to 1 0 resets the function block and the output variables are set
224. nual PMCprimo SoftPLC Page 57 14 Function library primo lib DisplayReferenceError PMCprimo command DF Display reference error Function library Display Description The last reference error of the selected axis is read in a variable with this function block The unit is increments Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL The value has been read True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The last reference error Also refer to DisplayActualPosition and DisplayDemandPosition Examples Declaration INST DisplayReferenceError bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayReferenceErrar bYarBOOL1 4bExecute bDone bvarBo0oLz 0 usiMode hErrar 14usichannal iErrorMumber divalue
225. o SoftPLC 14 Function library primo lib SetAccelerationFeedForwardGain PMCprimo Command KA Set acceleration feed forward gain constant Function library Positioncontrol Description With this function block the acceleration factor of the control loop algorithm is set The factor uses the set acceleration contrary to the actual acceleration and helps if the axis is driven with a very high acceleration The following error can be minimised in the acceleration phase by the aid of the factor Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiGain UINT The control factor from 0 to 65535 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetProportionalGain SetDifferentialGain SetlntegralGain SetVelocityFeedbackGain und SetVelocityFeedForwardGain Factory setting 0 switched off Examples Declaration INST SetAccelerationFeedForwardGain bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiGa
226. o SoftPLC Page 69 14 Function library primo lib SetEncoderFeedbackChannel Page 70 PMCprimo command FC Feedback change encoder Function library Encoder Description With this function block an encoder input which is normally determined for another axis can be deviated to the indicated axis Shall for example an incremental encoder be connected with PMCprimo Drive on axis 1 is this only possible with the command FC An encoder is for example a possible application which is fitted after a gearbox and shall be used as the actual value source for the motor The encoder is connected at the free encoder input and is allocated to the axis 2 with PMCprimo Drive Axis 1 motor axis can take over the positions of the axis 2 with this function and therefore the position control is calculated by this actual value The transport of goods which can slip is for example a further application An additional encoder acquires the actual position of the product A reference input or the encoder zero marker must be defined at the axis the SetFeedbackChannel SetFeedbackEncoder and NumberOfBits command refers to Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT 0 n
227. o encoder information from another axis 1 up to n depending on the system encoder information from the indicated axis Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Factory setting O switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST SetEncoderFeedbackChannel bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 2 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 2 bVarBool2 Inst bDone Example in FBD INST setEncoderFeedbackChannel bVarBOOL 4bexecute DvarBOOLZ Il HusiMade 14usiChannel ierrorMumber J usivalue User Manual PMCprimo SoftPLC Page 71 14 Function library primo lib SetEncoderFilterTime PMCprimo command PT encoder filter Function library Encoder Description It is possible to set the received encoder signals to an average via the set period In case unsmooth encoder signals are received these ones can get smooth herewith This function block can only be used at an uncontrolled axis In case a torque peak is available with a master axis and with a certain position this interference can also be seen a
228. o error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetFeedbackEncoder Factory setting 24 Examples Declaration INST SetNumberOfBits bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 26 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 26 bVarBool2 Inst bDone Example in FBD INST aatNurmberOfBits bvarBOoOL1 bDone bVarBOOLZ beate 1 jusiChannel iErrorMumber 264usiValue User Manual PMCprimo SoftPLC Page 83 14 Function library primo lib 14 11 Mapping Generation and execution of tabular position allocations Map or software gear functions between axes in the Master Slave Operation An associated position of the slave axis is defined for every position of the master axis by a tabular or linear position allocation The master axis can control an input however it is also possible that the master axis only works as receiver of encoder pulses e g transmission shaft vertical shaft or as virtual axis e g speed controlled indexing function If a position allocation is activated the corresponding position from the table is allocated to the slave axis as demand position It is sufficient in simple cases to define a linear allocation as software gear between master and slave axis This software gear fun
229. odule PLC PRG Illustration 3 Renamed inputs Illustration 4 Log in in the control Illustration 5 time response SoftPLC Illustration 6 time response SoftPLC with Motiongenerator Illustration 7 PMCprimo Function library Illustration 8 Example of a function block Illustration 9 Analogue auxiliary output Illustration 10 Illustration 11 Illustration 12 Illustration 13 Illustration 14 Illustration 15 Illustration 16 Illustration 17 Illustration 18 Illustration 19 Illustration 20 Illustration 21 Illustration 22 Illustration 23 Illustration 24 Illustration 25 Illustration 26 Illustration 27 Illustration 28 Illustration 29 Illustration 30 Illustration 31 Illustration 32 Illustration 33 Simple position allocations Position allocation for a defined range position allocation for a cyclic machine effects positionoffset Example for softwaredifferential complex Position allocation as equation Position allocation with differential as equation Behaviour software clutch position bound Speed depending phase shift end of movement with AB Command Initialisation with return to the reference signal Initialisation position and position bound Move with constant velocity Trapezoidal velocity profile Positions course with trapezoidal velocity profile Triangle velocity profile Higher and low acceleration value Set brake ramp positioning with creep speed Velocity steps SetVelocity SetSlowSpeed Ch
230. of course only one axis can be used for this exact position determination The definition is cancelled with the value O and the connection is disconnected via CAN Enhancement as of version 2 000 The function block CANNetworkPositionControlDrive was implemented addionally to access the second can controller of a PMCprimo 16 or a can expansion card For that another input variable parameter usiCanNetwork was defined which differs between the CAN net and CAN open Enhancement as of version 2 000 On the PMCprimo 16 the command can be used on a maximum of 16 axes The cycle time for the CAN bus transmission is depending on the number of PMCtendo DD4 in the CAN net User Manual PMCprimo SoftPLC Page 45 Page 46 14 Function library primo lib With value 0 the definition is cancelled and the connection via CAN is disconnected PMCprimo Drive PMCprimo Drive2 PMCprimo 2 2 PMCprimo 16 Cycle time 2 3 2 just CAN 2 10 4 8 per CAN Netz 1 4 4 till version 2 004 as of version 2 005 In the main network mode standalone the cycle time can be adjusted with the CD command In mode Host Node the cycle time is always 4 ms In an extended CAN network the cycle time is always choosen automatically according to the following table Input variables bExecute BOOL usiNode USINT usiChannel USINT usiCanNode USINT Output variables bDone BOOL bError BOOL iErrorNumber INT Connected
231. oftPLC 14 Function library primo lib SetVelocityAveragingTime PMCprimo command VT Set velocity averaging time constant Function library Display Description This function block is effective when using the function block DisplayVelocity and DefinePositionTriggerOutput The set value specifies a period over which PMCprimo determines the averaged speed of the selected axis This averaged speed uses PMCprimo instead of the actual speed for the calculation of the phase displacement with electronic cams For n 1 PMCprimo does not determine the average speed The determined average speed can be indicated with the function block DisplayVelocity or displayed at the analogue output Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The set period from 1 to 255 ms Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Also refer to DisplayVelocity and DefinePositionTriggerOutput Factory setting 1 millisecond Examples Declaration INST SetVelocityAveragingTime bVarB
232. oftPLC is possible however the processing is completely carried out in the Host i e every moving command is started in the Host PMCprimo programs are possible as up to now These programs can be started by the PLC and be processed in a parallel way Here the distribution Host and nodes remains existing Herewith a faster processing with the change of an input is possible There are two possibilities in order to start PMCprimo programs from the PLC Access to the bus variables These variables can be defined as trigger variables under PMCprimo and then start a pre selected program A program can directly be started via a function block For that the program name must be indicated in the PLC Example for a PMCprimo program ES MOVE CH1 1 SV100000 SA500000 DC500000 MA10000 NS This program is locally processed on the node 1 The program can directly be started from an input on this node for example with the command DI1 1 2 MOVE In this case the movement is carried out with a positive impulse of the input 2 without loading the PLC It is processed within a millisecond as the performance is carried out directly on the node The program can be carried out with the function block ExecuteSequence Move by the PLC However the processing is more slowly The time is determined by the communication speed and size of the PLC program Page 28 User Manual PMCprimo SoftPLC 14 Function library primo lib 14 Function library primo lib
233. ol1 must be equal to TRUE during the command is executed Input variables bExecute BOOL The value is set in case of a change from O to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue UINT Motor status for waiting Output variables bDone BOOL No more waiting True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Example INST WaitForStatusMotor bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 0 bVarBOOL2 Inst bDone Example in FDB INST WaitFarstatusMatar bvarBoOL1 bDone bvarBOooL7 hErrar 1 Ausichannel ierror4umber 04di Value Page 306 User Manual PMCprimo SoftPLC 14 Function library primo lib SendMail PMCprimo command is not available Function library Tension As of version 2 000 available Description With this function block an email can be send The system has to be connected with Ethernet to the internet and the IP address of the mail server has to be known This is possible with th
234. om 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The brake ramp of 1000 to 2 000 000 000 increments second Output variables bDone BOOL Error was cleared True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Examples Declaration INST ResetkError bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST FReseterror bYarBOOL1 4bExecute bYVarBOOL 04usiMode 1HusiChannel ierror4umber User Manual PMCprimo SoftPLC Page 225 14 Function library primo lib SetAbortDecelaration PMCprimo Command XA Set deceleration for AB command Function library Positioning Description This function block is used to specify the brake ramp for the abort command in increments second The deceleration ramp can be modified at any time The smallest adjustable ramp is 1000 This deceleration ramp is only used with the abort function AbortMotor page 201 Input variables bExecute BOOL The value is
235. ome function blocks diAcceleration DINT to udiAcceleration UDINT ulPhase UINT to diPhase DINT iValue UINT to diValue DINT diValue DINT to uiValue UINT udiValue UDINT to uiValue UINT diValue DINT to udiValue DINT uiValue UINT to udiValue UDINT uiValue UINT to udiValue UDINT uiValue UINT to udiValue UDINT uiValue UINT to udiValue UDINT uiValue UINT to udiValue UDINT usiValue USINT to udiValue UDINT usiValue USINT to uiValue UINT uiValue UINT to udiValue UDINT asma nes A eane Senes CS I eem DU NENNEN Definition of new tasks Number of the global variables g iModbusData 21 increased from 1024 to 2048 DisplayPositionOverflowCounter Display of the position overflow counter DisplayPositionBound Display of the actual position bound SetMapOptionsWord MW Now it is possible to interrupt speed mapping with stop 127 to position SetScaleMapping New range of values for uiCounter and uiDevider 400 000 DefineTimerOutput Definition of a timer counter output SetReferenceAdvanceFactor New range of values 65 535 WaitForRelativePosition New range of value 2 000 000 000 User Manual PMCprimo SoftPLC Page 11 9 Installation of the software 9 Installation of the software The included CD for the CoDeSys programming tool is self installing In case the Autoplay Option is switched off on the computer you must manually start the installation under CoDeSysV2 3 Setup exe All required componen
236. on False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetWindow MoveToAbsolutePosition und MoveRelativePosition Factory setting 0 switched of f Examples Declaration INST SetTimeoutForWindow bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 100 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 100 bVarBOOL2 Inst bDone Example in FBD Fehler Es ist nicht moglich durch die Bearbeitung von Feldfunktionen Objekte zu erstellen Page 194 User Manual PMCprimo SoftPLC 14 Function library primo lib SetVelocityFeedbackGain PMCprimo Command KV Set velocity feedback gain constant Function library Positioncontrol Description With this function block the actual value factor of the control algorithm is set The actual value factor scales the motor velocity resulting from the measured position The use of the factor can be compared with the effect from a tachometer sensor The factor has a damping effect and allows a higher KP factor and improves the reaction velocity of the axis therefore Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The
237. ontrol function of the GM command can be used to determine if the position allocation behaves as scheduled The calculated value can be displayed with the command GM If mapping is not active the SetPositionBound value page 133 is displayed Input variables bExecute BOOL The value is read in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The position bound of the master axis Connected function SetMapOptionsWord MapLinkSlaveToMaster SetScaleMapping SetMapBaseOffset and SetSlaveMapOffset User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST GetMappedMasterBound bVarBOOL1 BOOL bVarBOOL2 BOOL diValue DINT Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone diValue Inst diValue Example in FBD INST GetMappedMasterBound
238. ools appears a further entry in the context menu For the Profibus DP Master you must set the speed of the Profibus Standard 9 6 kBits s under the Bus Parameters For the Profibus DP Slave units the used inputs outputs are to be set exactly in such a way as the Hardware is configurated If you use for example 64 inputs 8 Bytes must be set as input Byte If the number does not coincide the Profibus cannot be started and a communication cannot take place Diagnosis Bytes of the Profibus DP Masters The Profibus DP Master writes diagnosis data into the diagnosis range This address can also be determined in the control configuration for the Master The first address for example MB8 is determined 4 Bytes are written by the Profibus Master which have the following meaning Byte 0 Globale Bits Example MB8 0 OK 1 Parameterisation failure 0 OK 1 At least one node does not exchange any data or signals failure 0 OK 1 unit went to Auto Clear Modus as there is an error on the removed unit User Manual PMCprimo SoftPLC 11 Control configuration Byte 1 Master und Network status example MB9 Byte 2 Failure of removed nodes example MB10 o pe NN 1 254 Address of the smallest node which indicates a failure detailed failure cause see Byte 3 255 Internal failure in the Master detailed failure cause see Byte 3 Byte 3 Failure cause with external failures Byte 2 from 1 up to 254 The node addr
239. operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT A possible value from the servo controller depending on the used command Examples Declaration INST DriveCommand bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sCommand 12T LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 sCommand I2T bVarBool2 Inst bDone Example in FBD INST DriveCommantd BvarBOO0L1 BExecute BpvarBiooLZ 0 4usiNode 1 4usichannal iIErrarumber TT SCommand di value di value Page 66 User Manual PMCprimo SoftPLC 14 Function library primo lib ASCIITODrive PMCprimo command QA Function library Drive Description With the function block ASCIIToDrive you can open an ASCII channel to communicate with a PMCtendo DD4 drive With the parameter usiCanNetwork the CAN Net is selected The parameter usiCanNode specifies the address of the PMCtendo DD4 It can communicate on the actual channel with the drive commands described before The command is channel specific so you can communicate on every channel command with a different PMCtendo DD4 Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except
240. ortis es an encoder ae consumption has aready ben anes Input is not a fast input The fast input is already defined Da fsi o2 Command 6 not posti as anis ai nto Command LW cannot be executed as allocation as slave via Slave ML is already made The output is defined and can therefore not be manually switched 26 re opta ty ean ded as o output ort anager em Fria toner zaro vaccis aresay Goad Lm For ine aasan iout et as cera consumi es __ ente remi upper int ot ZSV has bre cede se Pe aci th vey ma ote hanged ue o men Ls mesemoRemereeeca emere E User Manual PMCprimo SoftPLC Page 205 14 Function library primo lib Error Motiongenerator Variable MBnn has not been defined Error Motiongenerator Variable MCnn has not been defined Error Motiongenerator Segment No nn Sum of the percentage indication must result in 100 BUS Variable is not defined The input is defined for encoder torque consumption Ta Position table Map lt gt is not available 4 Mestre is rot avata in a postion i Me a Page 206 User Manual PMCprimo SoftPLC 14 Function library primo lib It is not possible to run more than 8 master axes via the CAN Bus Attention data are cancelled as incorrect check sum calculation cM T 14400 19200 38400 57600 115200 A value for A value for recording has not been selected 00 has not been selected If monitoring runs TW must not be modified User Manual PM
241. osition allocation independent on the current speed of the master axis the cutting tool always remains in the correct position to the material transport Slave position Map position relationship Slave position range Master position range Master position Illustration 11 Position allocation for a defined range The position allocation which is shown in Illustration 11 can also refer to the application in which the master axis behaves itself like a transmission shaft and the slave axis follows the shown position profile with every rotation of the transmission shaft 7 vertical shaft For this application the position bound of the master must be set to one rotation of the transmission shaft with the function SetPositionBound page 133 In case the master and or slave axis behaves itself in a cyclic way the position bound must be set on every axis The tabular position allocation must be defined in such a way that the position transitions at the cycle limits runs continuously In case of intermittent transitions at the cycle limits sharp changes of the speed can occur at the slave axis In case the transition of the position values at the cycle limit of the slave axis is not continuous the difference between the actual position bound and demand position bound effects a relative misalignment between slave and master axis This error adds up over several cycles of the machine and behaves as constant drift of the slave axis
242. ositive Output variables bDone BOOL Movement started True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 See also SetAcceleration SetVelocity SetSlowSpeedMode and SetSlowSpeed Page 218 User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST MoveConstantVelocity bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bDirection 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bDirection 0 bVarBOOL2 Inst bDone Example in FBD INST hoveConstantv elocity BvarBOOL1 BbExecute bDone BvarBOoOL 0 4usiNode hErrar 14usichannal iIErrar lumber UbDirection User Manual PMCprimo SoftPLC Page 219 14 Function library primo lib MoveRelativePosition PMCprimo Command MR Move units relative to current position Function library Positioning Description The motor drives the specified relative position The motor moves from its instantaneous position by the set increments The movement follows to trapezoidal or sinusoidal velocity profiles Illustration 24 The motor accelerates and stops with the acceleration values which have been specified with the function blocks SetAcceleration and SetDeceleration The travelling speed is defined
243. ot used HostOutput1 Word is provided for 8 digital and 8 virtual outputs HostOutput2 Word is not used From version 2 004 Hostlnput1 Word corresponds to 12 digital inputs the remaining 4 Bits are not used Hostlnput2 Word presents 16 virtual inputs HostOutput1 Word is provided for 8 digital and the first 8 virtual outputs HostOutput2 Word is provided for 16 virtual outputs For compatibility the first 8 virtual outputs are accessible with HostOutput1 and HostOutput2 For new projects the HostOutput2 shall be used for virtual outputs 11 2 PMCprimo 2 2 Hostlnput1 Word corresponds to 16 digital inputs Hostlnput2 Word presents 8 virtual inputs the remaining 8 Bits are not used HostOutput1 Word is provided for 16 digital outputs HostOutput2 Word corresponds to 8 virtual outputs again the remaining 8 Bits are not used again 11 3 PMCprimo 16 Hostlnput1 Word corresponds to 16 digital inputs Hostlnput2 Word presents 16 virtual inputs HostOutput1 Word is provided for 16 digital outputs HostOutput2 Word is provided for 16 virtual outputs 11 4 PMCprimo Drive2 Hostlnput1 Word corresponds to 12 digital inputs the remaining 4 Bits are not used Hostlnput2 Word presents 16 virtual inputs HostOutput1 Word is provided for 8 digital and the first 8 virtual outputs HostOutput2 Word is provided for 16 virtual outputs For compatibility the first 8 virtual outputs are accessible with Ho
244. output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system uiWindow UINT The target window from 0 to 65535 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function MoveRelativePosition and MoveToAbsolutePosition Factory setting 100 increments Examples Declaration INST SetWindow bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiWindow 200 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiWindow 200 bVarBOOL2 Inst bDone Example in FBD INST aevindow bYarBOOL1 4bExecute bYarBOOL qQusiMade 14usichannal iErrorMumber 2004uiWindow User Manual PMCprimo SoftPLC 14 Function library primo lib 14 14 AbortMotor Positioning PMCprimo Command AB Abort emergency stop Function library Positioning Description The motor brakes with the brake ramp SetAbortDeclaration page 226 up to the velocity 0 This function block can be used with each movement AB command actual velocity demand velocity Illustration 20 en
245. output__ 143 BR SetMapScaletromBounds 132 DA DC DE DF DP DisplayActualPosition 52 DZ DefineZeroMarkerinput 69 EM DeinMap 90 Page 312 User Manual PMCprimo SoftPLC 16 Cross reference list PMCprimo Commands SoftPLC Functions GM GetMappedMasterBound 96 178 GW J GetWrapAroundoffset 98 B InitiatisePositionBounds 216 D J hi aliseDemandOfset 179 SetMonitorOutputGain MS oR____ DefineReferenceOutputt 157 PP Ghthemenresttnconeibive CANNetworkPositionControlDrive PD JCANPosiioContoDre 45 PO j DefimePosiionTriggerOuput 149 QR j GetCanSD 48 RR DefineReferenceinput 251 User Manual PMCprimo SoftPLC Page 313 16 Cross reference list PMCprimo Commands SoftPLC Functions RN SetReferenceAdvanceFactor 258 RR DefineReferenceRejecOuput 159 RT A SetRefereneTimeut Rv SeetReferenceCorrectionVelocity RW A SetReferenceOptionsWord SA Setceleraion 2 SB SetPostionBoud _ SC SE SF SSM SRO SRO SS Co o 74 WIN hO SetCreepDistance SetMaxPositionError 192 280 260 2 230 37 SetMonitorOutputFunction SetScaleMapping 136 SetMaxReferenceCorrection 255 262 SetReferenceErrorLimit SetSlowSpeed 236 RN RT RV RW SA SB SC SE SF SM SR SR SS SV SW T TM TO Ul UL UO VC VH VJ VM VO
246. pilz more than automation safe automation PMCprimo SoftPLC 1 1 1 2 1 3 1 General conditions General conditions Copyright Copyright 2005 Pilz GmbH amp Co KG All rights reserved No part of this document may be reproduced print photocopy microfilm or any other format or modified duplicated or distributed by electronic means without written authorisation by Pilz GmbH amp Co KG Notes Pilz GmbH amp Co KG reserves the right to make amendments to this document at any time The examples given serve only as illustrations No guarantee is given for their suitability in particular applications Although the utmost care has been taken in the production of this document no liability can be accepted for any mistakes that it may contain We welcome any suggestions for the improvement of our products or documentation We reserve the right to make technical changes which lead to the improvement of the product Previous editions V1 18 02 2003 First edition Valid from PMCprimo software version gt 1 008 V2 15 05 2003 Valid from PMCprimo software version gt 2 000 V3 30 04 2004 Valid from PMCprimo software version gt 2 004 V4 10 02 2005 Valid from PMCprimo software version gt 2 005 V5 07 06 2005 Valid from PMCprimo software version gt 2 006 V6 05 12 2005 Revision User Manual PMCprimo SoftPLC 2 Contents User Manual PMCprimo SoftPLC Contents 1 Generalcondilions nia
247. possible when the slave and master axes are in a linked system on different controls 0 The automatic initialisation of the transmission ratio with the upper and lower limit value is not released at the master axis 1 The automatic initialisation of the transmission ratio with the upper and lower limit value is released at the master axis Bit6 This Bit determines the starting direction of the web tension setpoint value when Page 292 User Manual PMCprimo SoftPLC 14 Function library primo lib Bit 0 is set to 1 and the web tension control is released 0 The starting direction is the same as the sign of the web tension distance 1 The starting direction is opposite the sign of the web tension distance Bit 7 This Bit determines the sign of the analogue control 0 An increase of the error signal web tension distance effects a voltage rise the setpoint output 1 An increase of the error signal web tension distance effects a voltage reduction at the setpoint output Input variables bExecute BOOL The value is set in case of a change from O to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiControlword USINT The control word for setting the behaviour Output variables bDone BOOL Setpoint set True or module is still under ope
248. put USINT The output number from 1 to 8 0 cancels the definition Output variables bDone BOOL The function has been executed True or is under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact reason of error see GetError page 203 Connected functions SetMonitorOutputFunction SetMonitorOutputGain and SetMonitorOutputOffset Factory setting No output defined User Manual PMCprimo SoftPLC Page 35 14 Function library primo lib Examples Declaration INST DefineAuxiliaryOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL Inst bExecute bVarBOOL 1 usiNode 0 usiChannel 1 usiOutput 1 LD Inst bDone ST bVarBOOL2 Example in ST Inst DExecute bVarBOOL1 usiNode 0 usiChannel 1 usiOutput 1 bVarBool2 Inst bDone Example in FBD Inst D efineAuxiliany Output BvarBOoOoL1 hExecute boone bvarBOOL2 d4usiNode hErrar 1 4usichanrnael iErrarMurnbar 1 Ausiutput Page 36 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMonitorOutputFunction PMCprimo command SF Set monitor output function Function list Auxiliary Description The output function analogue auxiliary output can be set with this function block It facilitates for example the setting of the control parameter of the corresponding axis For the output of the analogue values an analogue output momentary not used is taken with the DefineAuxiliaryOutput pag
249. r page 203 Connected functions MoveToAbsolutePosition MoveRelativePosition SetSlowSpeed und SetSlowSpeedMode Factory setting 0 switched off User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST SetCreepDistance bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1000 bVarBOOL2 Inst bDone Example in FBD INST cetlCreepDistance BvarBOaOLb1 B5Execute BvarBOooL I AusiMade 1 4usichannal ierroriJumbetr 10004uiValue User Manual PMCprimo SoftPLC Page 231 14 Function library primo lib SetDeceleration PMCprimo Command DC Set deceleration for ST command Function library Positioning Description This function block is used to specify the deceleration ramp in increments second The deceleration ramp can be changed at any time The smallest adjustable deceleration ramp is 1000 The deceleration ramp is used with the function blocks StopMotor MoveToAbsolutePosition MoveRelativePosition InitialisePosition and InitialisePositionBounds A separate deceleration ramp can be set with SetAbortDecelaration for the abort command AbortMotor Stop command v t Illustration 28 Set brake ramp Input variables bExecute BOOL The value is written in case of
250. rBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DefineReterenceBbackwardOutput bYarBOOL1 4bExecute bDone BVvarBOoOLZ usiNade hbErrar usichannal iErrarMumbear usiBank usiOutput usiPalarity ao ms Ii User Manual PMCprimo SoftPLC 14 Function library primo lib DefineReferenceForwardOutput PMCprimo Command JF Reference adjustment forwards output Function library Output Description With this function block an output can be set for the time for which a reference error correction is executed in the driving direction This means that the axis must get faster in case of a reference error correction so that the defined output is set to true Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual 1 to 20 adjustable with CD command PMCprimo 16 1 to 10 adjustable with CD command PMCprimo Drive2 usiOu
251. rBOoOLb AusiMade bErrar 14usichannal iErrarurmber 1 4usiBank z jusilnput AusiPalarity Page 250 User Manual PMCprimo SoftPLC 14 Function library primo lib DefineReferencelnput PMCprimo Command DR Define reference input Function library Referencing Description With this function block a digital input can be defined as a reference input The axis can also be virtual As a result this input is determined for the cycle reference correction Input variables bExecute BOOL The input is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT The input group only 1 possible usilnput USINT The input 1 to 2 PMCprimo Drive 1 to 4 PMCprimo 2 2 1 to 4 adjustable with CD command PMCprimo 16 1 to 4 adjustable with CD command PMCprimo Drive2 usiPolarity USINT 0 falling edge 1 rising edge Output variables bDone BOOL Input has been defined True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceMode Undefinelnput Factory setting Input not defined User Manual PMCprimo SoftPLC Page 251 14 Function library primo
252. rLimit is unequal to O this error signal is issued when the reference error is bigger than the value of SetReferenceErrorLimit With Bit 1 of the function block SetErrorOptionsWord page 188 it can be determined if the motor shall be switched off additionally to this error signal User Manual PMCprimo SoftPLC Page 255 14 Function library primo lib Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The value is written from 0 to 65 535 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceOptionsWord SetReferenceErrorLimit and SetFilterOnReference Factory setting 0 switched off Examples Example in IL Declaration INST SetMaxReferenceCorrection bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 1000 bVarBOOL2 Inst bDone Ex
253. rametric failure Slave is in a data exchange with another Master is internally located by the Profibus DP Master Byte 1 Bit 0 Slave must be brought in a new parametric condition Bit 1 Slave has static diagnosis Bit2 1 Bit 3 DP Watchdog is active Bit 4 Slave is in a Freeze Mode Bit 5 Slave is in a Sync Mode Bit 6 Reserved Bit 7 Slave is de activated is internally located by the DP Master Byte 2 Bit 0 6 Reserved Bit 7 Too many Ext Diag Data Byte 3 Station address from the Master carried out with the data exchange Byte 4 5 Ident Number Is the Bit 3 located in the Byte O there are further diagnosis data available These are stored from the 6 Byte on and depend on the manufacturer Therefore the meaning is to be determined in the documentation of the manufacturer User Manual PMCprimo SoftPLC 11 Control configuration 11 7 Profibus Slave If the module Anybus S PDP is added to the PLC configuration then the SoftPLC communicates direct with the Profibus board inside of the PMCprimo 2 2 or PMCprimo 16 For the settings different additional inputs are required The setting of the station address is ignored because this is done with the switches on the board With the inputs and outputs the number of inputs and outputs have to be adjusted This must exactly correspond to the configuration inside the Profibus master Important notice the inputs are from the view of the master This means outputs in CoDeSys Q
254. rary primo lib SetBacklashDistance PMCprimo Command BL Set backlash compensation distance Function library Positioning Description This function block allows the compensation of a mechanical backlash After every change of the direction of the motor the distance defined in increments is added to the actual position This backlash compensation acts only with the execution of MoveToAbsolutePosition or MoveRelativePosition Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The compensation from 0 to 65 535 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions MoveToAbsolutePosition MoveRelativePosition Factory setting 0 switched off Examples Declaration INST SetBacklashDistance bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 20 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 20
255. ration False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnalogueControlMode and ExecuteMap SetScaleMapping SetClutchTime and SetSlowSpeed Factory setting 0 User Manual PMCprimo SoftPLC Page 293 Page 294 14 Function library primo lib Examples Declaration INST SetAnalogueControlWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlWord 2 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlWord 2 1 bVarBOOL2 Inst bDone Example in FDB INST SetAnaloqueControl ord BvarBOO0L1 BExecute bVarBOOLZ 0 4usiMode 1 A4usichannel ierrorMumber 241 qusicantralvard User Manual PMCprimo SoftPLC 14 Function library primo lib SetAnalogueDifferentialGain PMCprimo Command AD Set analogue differential control gain Function library Tension Description With this function module a differential factor of the control algorithm of the analogue control is set This factor uses the differential of the actual value distance which shows the control deviation of the system This factor is useful with very fast modifications of the control deviation and acts in a damping way on the analogue control Input variables bExecute BOOL The value is set in case of a change
256. ration of the SoftPLC in PMCprimo The installed function library adds function blocks to the SoftPLC Independent actions can be started in PMCprimo with these function blocks PMCprimo undertakes this action and independently carries them out without further function calls of PLC If for example a positioning shall be started the accelerations and speed can be set with one module each and then the positioning can be started with the function block MoveToAbsolutPosition PMCprimo independently undertakes now the complete setting value calculation and positioning control It is not necessary for PLC to do anything else for the positioning Each function block has an output bDone with which the complete performance is re signalled This means for example with MoveToAbsolutePosition that the target position was achieved and the axis has braked again to the speed O Page 26 User Manual PMCprimo SoftPLC 13 SoftPLC in PMCprimo PMCprimo position control etc read inputs read inputs sa nine ar set outputs set outputs 0 1 2 3 time ms Illustration 5 time response SoftPLC The PMCprimo task is executed in every millisecond and undertakes the setting value calculation positioning control etc In case the setting value calculation requires a longer working time the PLC Task can be interrupted several times When starting the PLC program the inputs are registered and then the actual PLC program is executed At the
257. re set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue DINT The Offset to be adjusted 4 000 000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetMapAdjustmentVelocity and SetAlignmentAcceleration Factory setting 0 switched off Examples Declaration INST SetSlaveMapOffset bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 1 bVarBOOL2 Inst bDone Example in FBD INST SetSlavellapOrts at bYarBOOL1 4bExecute bDone BvarBOoOL 0 4usiNode hErrar 1 4usichannal iErrorMumber 14diValue User Manual PMCprimo SoftPLC 14 Function library primo lib TransferMapData PMCprimo Command TM Transfer map data Function library Mapping Description With this function block a prepared position table is transferred from the Host to the selected axis The position table itself is transferred in the flash of the Host and must be transferred to the axis again if required This is the case for exampl
258. reference error In case the value is zero then PMCprimo immediately executes the correction of the reference error The position which can be specified with this command must be activated with Bit 2 of the pre adjustment of the reference behaviour SetReferenceOptionsWord page 272 Only a positive position may be indicated In case a value is specified n times bigger than SetPositionBound page 133 or SetReferenceRepeatLength page 278 if used the reference error correction is executed displaced by n cycles Bit 1 of SetReferenceFilterOptionWord page 267 must be set to 1 as a relative position indication does not make any sense in this case Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diValue DINT The reference position in the range of 4 000 000 increments Output variables bDone BOOL Value is written True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceOptionsWord SetPositionBound SetReferenceRepeatLength and SetReferenceFilterOptionWord Factory setting 0 Increments User Manual PMCpri
259. resis The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defined User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST DefineVelocityOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 diSpeed1 20000 diSpeed2 30000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 diSpeed1 20000 diSpeed2 30000 bVarBOOL2 Inst bDone Example in FBD INST DetinevelocitvOutput BvarBOO0L1 BbExecute bDone bYarBOOL usiNode hErrar 1 4usichannal iErrar lumber 1 4usiBank 5 usiQutput usiPolarity 200004diSpeedi 300004diSpeed2 User Manual PMCprimo SoftPLC Page 165 14 Function library primo lib SetPhaseAdvanceFactor Page 166 PMCprimo Command PA Set phase advance scale factor Function library Output Description With this function block an electronic cam of an axis can be provided with a phase shifting depending on the velocity This phase shifting can be arranged separately for each output Phase shifting output velocity 256 X PA 256 The velocity of the axis is indicated in increments second for example a phase shifting of 153 increments is obtained with a velocity of 20 000 increme
260. rflow counter Function library Display Description The actual position overflow counter of the selected axis is read in a variable with this function block The unit of the actual position is increment Input variables bExecute BOOL _ The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact the error cause see GetError page203 diValue DINT The actual value of position overflow counter Also refer to DisplayDemandPosition und DisplayFollowingError Examples Declaration INST DisplayActualPosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayPositionOQverlowt ounter bYarBOOL1 4bExecute bDone barbod qQusiMade hErrar 1 Ausichannal ierrorMumber di value di value Page 56 User Manual PMCprimo SoftPLC
261. rimo Command VJ Set slow velocity mode Function library Positioning Description With this function block it is switched over between the velocity values SetVelocity and SetSlowSpeed With SetSlowSpeedMode 0 the axis moves with SetVelocity page 240 With SetSlowSpeedMode 1 the axis moves the velocity set with SetSlowSpeed The adjustment of a creep speed function block SetCreepDistance page 230 is only valid with SetSlowSpeedMode 0 V SV SS Illustration 30 Velocity steps SetVelocity SetSlowSpeed In case of a switchover between SetVelocity and SetSlowSpeed during the execution of MoveToAbsolutePosition or MoveRelativePosition the specified value for SetSlowSpeed must always be smaller than the value for SetVelocity as otherwise the deceleration ramp cannot be calculated correctly deceleration ramp very steep Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The velocity step 0 or1 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions
262. rioa boone bYarBOOL T i bErrar ierrorMumber 23 1 01 4usiControlword Page 126 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMapOptionsWord PMCprimo Command MW Set map options word Function library Mapping Description With this function block the behaviour of the position allocations is preset at the slave axis Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiControlword USINT Each Bit has the following meaning Bit O This Bit determines the behaviour of the slave axis when activating a position allocation 0 Software clutch not active i e the slave axis drives to the demand position assigned to it when activating a position allocation 1 Software clutch active i e the slave axis waits until the master axis takes the associated position and afterwards accelerates to the required velocity within the set time SetClutchTime in order to comply the position allocation Enhancement as of version 2 002 With speed mapping bit 4 of command SetMapOptionsWord must set it is possible now to go in mapping without software clutch Therfore the velocity of master must be lower than 500 increments per second This
263. rorNumber INT Indicates the exact error cause see GetError page 203 Factory setting 0 Examples Example in IL Declaration INST SetMoveOptionsWord bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 10 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiControlword 2 10 bVarBOOL2 Inst bDone Example in FBD INST aaetaveoptianswward BvarBOaoL1 BExecute bivarB0 02 0 4usiNode 1 A4usichannal ierrorMumber 2 10HUusiControlwyord User Manual PMCprimo SoftPLC Page 235 14 Function library primo lib SetSlowSpeed PMCprimo Command SS Set slow speed Function library Positioning Description With this function block the velocity of the creep speed is specified in increments second The velocity of the creep speed is the travel velocity of the axis when SetSlowSpeedMode page 238 is set to 1 The value for the execution of positioning command must be smaller than the value SetVelocity page 240 6 The velocity SetSlowSpeed is also used with a reference equalising travel when the axis should stand Additionally it is also used for an adjustment of SetMapBaseOffset SetSlaveMapOffset and SetScaleMapping with a stopped master SV area creep distance SS Illustration 29 positioning with creep speed Input variables bExecute BOOL The value is
264. rupt after calculation of the position loop Depending of processor load 200 300us 1 Incremental encoder see FSO Hardware register lt 1us X2 multiplication PMCprimo Drive channel x 1 2048 increments turn 2 Incremental encoder see FSO Hardware register lt 1us X1 multiplication PMCprimo Drive channel x 1 1024increments turn SSI encoder see FSO If PMCprimo Drive relative position channel x 1 binary code Hardware register lt 1us With SSI encoder PMCprimo Drive ims channel x 1 Hiperface resolution with NB changeable relative position SSI encoder see FSO If mcD channel x 1 relative position Hardware register lt 1us With SSI encoder ims Gray code PMCprimo Drive channel x 1 Hiperface resolution with NB changeable relative position SSI encoder see FSO Referencing not possible absolute position binary code PMCprimo Drive User Manual PMCprimo SoftPLC synchronous CAN PScope can Following Use of display error position motor current available in loop of PMCprimo PMCtendo DD4 Yes with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and channel x 1 14 Function library primo lib Description Delay time for demand Accuracy reference inputs Number of
265. s 269 SetReferenceMode 270 SetReferenceOffset uisus srl tte cetcaesneedcemies 271 SetReferenceOptionsWord 272 SetReferencePosition 274 SetReferencePositionAtOtherPosition 276 Page 316 17 Index SetReferenceRepeatLength 278 SetReferenceTimeout n 280 SetReferenceTrueHighLimit 266 SetReferenceTrueLOWLImMIt ees 266 SetScaleMapping 136 SetSlaveMapOffset i 138 SetSlowSpeed i 236 SetSlowSpeedMode n 238 SetTimeoutForWindoW 194 SetVelocity nene 240 SetVelocityAveragingTime 65 SetVelocityFeedbackGain 195 SetVelocityFeedForwardGain 196 SetVelocityOutputHysteresis 172 SetVirtualMotorMode 198 S1 gt AYA 1016 0 iii 200 SIODMOLOE sanas Gerade ner E DUE 242 StopMotorToPositioN 244 T tension CONtrol sees 289 TransferMapData 139 Trapezoidal velocity profile 222 U Undetinelnput ERROR 282 UndefineOutput eeeeeeeesseeeeeeeeerreeee 17
266. s for PMCprimo motion control systems are e Packaging machinery e Modular machines e Printing and paper machineries Handling systems Page 8 User Manual PMCprimo SoftPLC 6 Manufacturer s declaration Safety Instructions 6 1 6 2 IS Please note Manufacturer s declaration Safety Instructions Manufacturer s declaration Controls are not machines within the scope of the Machinery Directive 98 37 EG but components for installation into machines An initial start up is prohibited until it has been noticed that the electrical equipment or machinery in which the controls are incorporated correspond to the requirements of the EG regulations Safety Instructions Warning Do not touch live mains and components potentially fatal During initial operation it has to be assured that there will be no danger to personnel and damage to machinery or equipment For this reason the following safety precautions must be taken Only qualified and well trained specialists should work on the units to avoid any injury to personnel or damage to machinery Warning As a general principle electronic appliances are not failure free The Installation and Operating Instructions must be read carefully and all safety regulations observed before installation and initial operation as incorrect handling can cause injury to personnel and damage to machinery e Only qualified and well trained specialists who are familiar with the transporta
267. sible to access the global data g iModbusData from CAN With SDO the index 0x3001 to 0x3008 it is possible to access 128 elements with sub index 0 to 127 integer 16 2 bytes of the array Therefore all 1024 array elements are accessible with SDO Since version 2 006 The number of global variables g iModbusData was increased from 1024 to 2048 The index for CAN is 3001 hex to 3010 hex and the subindex is O to 127 User Manual PMCprimo SoftPLC Page 21 12 2 Page 22 12 Communication with the control Setting of a new connection First of all a new entry is generated in the CoDeSys programming tools under the menu Online gt communication parameter and a name to be selected freely is allocated for this connection and then the corresponding list entry is modified The following parameter must be set With Ethernet the address of the control with serial interface localhost or 127 0 0 1 1200 Standard value Motorola Byteorder Yes Standard value No double click changes the value 128 Standard value Afterwards the connection to the control can be checked with the menu Online gt Log in The following window should appear then x No program on the controller Download the new program Mein Abbrechen Illustration 4 Log in in the control The window only appears when the module PLC PRG includes an executable network and the project could successfully be compiled If this window is indicated it means tha
268. st possible acceleration value is 1000 Illustration 27 Higher and low acceleration value Input variables bExecute BOOL The value is written in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The value of 1000 to 2 000 000 000 increments second Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions MoveToAbsolutePosition MoveRelativePosition and MoveConstantVelocity Factory setting 100 000 increments second User Manual PMCprimo SoftPLC Page 227 14 Function library primo lib Examples Declaration INST SetAcceleration bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 1000000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 1000000 bVarBOOL2 Inst bDone Example in FBD INST SetAcceleration bYarBOOL1 4bExecute BvarBOoOLb 0 4usiNode 14usichannal iErrarMurmber 10000004udiY alue Page 228 User Manual PMCprimo SoftPLC 14 Function lib
269. stOutput1 and HostOutput2 For new projects the HostOutput2 shall be used for virtual outputs It is the same usage as for PMCprimo Drive and therefore projects are compatible with both hardware versions Page 14 User Manual PMCprimo SoftPLC 11 Control configuration Therefore always 2 words for the inputs and 2 words for the outputs are used with all systems The name Hostlnput and HostOutput can be changed at any time double click on the name If additionally there are nodes in the network those must be advised to the PLC For this new sub elements must be added to the control configuration First click Module primo Slot in the list with the left mouse button and then press the right mouse button A context menu appears to which a sub element can be added The module PMCprimo indicates the configuration of the control i e here it is set how many nodes are available in the network primo Node Input Output adds the information for a further node The global variables are called Nodelnput and NodeOutput The holding is identical as with the Host In case further nodes are added you have to observe that the variables Nodelnput und NodeOutput are not named as otherwise the same variable names refer to different memory ranges and then an error message is indicated during compiling fff PLC Configuration PLC Configuration Module Primo sLOT J mt O Primo Host Input Output SLOT i Hostinputt AT IVWO WORD Bank 1 2
270. ster bound and its scale map The actual bound can be displayed with function GetMappedMasterBound page 96 Enhancement as of version 2 000 If the axis is not moving in mapping an automatic bound correction is possible with this command Therefore the bound set by SB is multiplied with the scale map SetScaleMapping With an odd gear transmission a reference sensor is no longer necessary Example SB4096 SM1 3 The bound for it is 1365 33 Therefore a drift of one increment every 3 bound would happened With correction the bound set two cycles to 1365 and one cycle to 1366 Special case In case Bit 0 and Bit 2 are set simultaneously this defines the following behaviour The slave couples immediately As a result a misalignment arises which is stored as Offset for the slave The misalignment can be compensated by SetSlaveMapOffset O later on Enhancement as of version 2 006 If position mapping is set then the offset through the change of map ratio SetScaleMapping is stored as Offset for the slave User Manual PMCprimo SoftPLC 14 Function library primo lib Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError Connected functions MapLinkSlaveToMaster and MapLinkSlaveToDifferentialMaster Factory setting 0 User Manual PMCprimo SoftPLC Page 129 Pag
271. t e Motor position outside the software limts SetHighPositionLimit and SetLowPositionLimit e Errors which can be released with SetErrorOptionsWord to an axis error Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetMaxPositionError SetEncoderTimeout SetHighPositionLimit SetLowPositionLimit and SetErrorOptionsWord The function block UndefineOutput is available for cancelling the output definition Factory setting No output defined User Manual PMCprimo SoftPLC Page 145 14 Function library primo lib Examples Declaration INST DefineMotorErrorOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL
272. t the communication could be built up and the PLC program can be downloaded User Manual PMCprimo SoftPLC 12 Communication with the control In case a failure message appears it might be that the IP address is not correctly configurated Remark The following pictures are given from a german windows system First off all try tte Command PING under the Start gt Execute A CAWINNT System32 command com Microsoft R Windows DOS CG gt Copyright Microsoft Corp 19980 1999 C gt ping 192 168 0 3 Ping wird ausgef hrt f r 192 168 0 3 mit 32 Bytes Daten Antwort von 192 168 0 3 Bytes 32 Zeit lt 1B9ms TTL 64 Antwort von 192 168 0 3 Bytes 32 Zeit lt 1B9ms TTL 64 Antwort von 192 168 0 3 Bytes 32 Zeit lt 1B9ms TTL 64 Antwort von 192 168 0 3 Bytes 32 Zeit lt 1iB9ms TTL 64 Ping Statistik f r 192 168 0 3 Pakete Gesendet 4 Empfangen 4 Verloren z Verlust Ca Zeitangaben in Millisek Minimum ms Maximum ns Mittelwert ms In this case a connection could be established however a IP address may be used twice and a acknowledge message has been signalled back from a different PC 9 5 Ausw hlen C WINNT System32 command com G gt ping 192 168 0 19 Ping wird ausgef hrt f r 192 168 80 180 mit 32 Bytes Daten Zeitiiberschreitung der Anforderung schreitung der Anforderung chreitung der Anforderung schreitung der Anforderung Ping Statistik f r 192 168 0 10 Pakete Gesendet 4
273. t the slave axis The influence can be removed or decreased by this filter It can only be reacted on the speed changes at the uncontrolled axis later by the information Additionally they cause a static misalignment of the averaged position Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT 0 no filter 1 up to 10000 Milliseconds Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Also refer to SetEncoderScaling Factory setting 0 switched off Examples Declaration INST SetEncoderFilterTime bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 50 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 50 bVarBool2 Inst bDone Example in FBD INST setencaderFilterTime bvarBQ0L1 bDone bvarBooLzi i bError 14usichannal iIErrar lumber 5D uivalue T User Manual PMCprimo SoftPLC 14 Function library primo lib SetEncod
274. ter velocity can be averaged in speed mapping with the command SetMapBaseAdvanceTimeConstant Damping of rapid movements of the master is possible with it Enhancement as of version 2 005 Now it is possible to interrupt speed mapping with stop to position In this case bit 6 of command SetMapOptionsWord is ignored Bit 5 Coupling can be executed via a set time or via a set clutch length 0 Coupling is executed with the set clutch time SetClutchTime page 113 Coupling is executed with the set clutch length SetClutchLength page 111 Enhancement as of version 2 004 When StopMotor is used the map is still active when decelerating The setting of SetClutchLength is always used This means the bit 5 of SetMapOptionsWord SetClutchTime SetClutchLength setting is ignored because with SetClutchTime it is not possible to reach the target position It is possible to uncouple with MoveToAbsolutePosition or MoveRelativePosition The velocity can be selected for that 0 It is driven with the actual slave velocity 1 Itis driven with the velocity set by SetVelocity page 240 Enhancement as of version 2 004 Clutching out with StopMotor the map is done until stop if the bit is set Only the clutch length SetClutchLength is used bit 5 of command SetMapOptionsWord has no relevance As of version 1 006a Activate an automatic bound correction The slave bound is set automatic to the slave position at the ma
275. teresis bYarBOOL1 4beExecute bYarBbOoL dusiMade 1 4usiChannel iErrarMumhear 1 4ui value User Manual PMCprimo SoftPLC Page 171 14 Function library primo lib SetVelocityOutputHysteresis Page 172 PMCprimo Command VH Velocity Output Hysteresis Function library Output Description This function block is used for an extension of the function block DefineVelocityOutput A hysteresis is added to the switching points hence the output is not constantly switched on and off The set value is either added to the set switching points of the velocity or subtracted from them The value is used for all outputs of the axis Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The hysteresis for all velocity outputs on this axis As of Primo_V2_006 lib udiValue UDINT Output variables bDone BOOL Output has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function DefineVelocityOutput Factory setting 0 switched off Examples Declaration INST SetVelocityOutputHysteresis bVarBOOL1 BOOL
276. th an absolute positioning at a rotary axis if Bit 2 is set to 1 0 The positioning is executed in a positive starting direction 1 The positioning is executed in a negative starting direction Bit 4 Version 2 000 or higher If bit 1 of the option word is set and the target position is a multiple of the value of SetPositionBound for a move absolute this bit decides to move one bound or not 0 If bit 1 is set and driveway n position bound no movement 1 If bit 1 is set and driveway n position bound move one bound Bit 5 reserved Bit 6 reserved Page 234 User Manual PMCprimo SoftPLC 14 Function library primo lib Bit 7 Version 2 000 or higher If the axis is not moving in mapping an automatic bound correction is possible with this bit Therefore the position bound is multiplied with the scale map set by the function block SetScaleMapping With an odd gear transmission a reference sensor is no longer necessary Example position bound 4096 scale map 1 3 The bound for it is 1365 33 Therefore a drift of one increment every 3 bound would happened With correction the bound set two cycles to 1365 and one cycle to 1366 The calculated bound can be shown with the function GetMappedMasterBound 0 Automatic correction is not active 1 Automatic correction is active Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iEr
277. tion installation initial operation maintenance and operation of the units as well as with the relevant standards may carry out the corresponding works e Technical data and information Type tag and documentation must be observed e ESD Danger Control units contain components which will be damaged by electrostatic discharge if handled incorrectly Therefore before touching the control unit Ensure that your own body is earthed Always place the control unit on a conductive surface with good earth connection Avoid touching contacts components and plug connections e Never disconnect electrical connections when the drive is connected to mains power e Do not open the covers and switch enclosures when the drive is running e Before opening the units switch off mains power Wait at least 5 minutes before opening As a precaution test the intermediate circuit Open only when it is 40 V User Manual PMCprimo SoftPLC Page 9 Page 10 7 General description General description The option PMCprimo SoftPLC is a supplement to the existing software functionality by a IEC 61131 programmable software PLC PLC programmable logic control Release this software functionality is made by the PMCprimo command SK Series number 000102 Installed Software keys Motion 49a84d Ethernet 03fce7 SOTLPBhC 1781953 New Key A releasing has been carried out by an input of the code 178195 This code is different for every unit T
278. tion of a slave axis must be cancelled before the axis is allocated to another master axis Input variables bExecute BOOL The definition is cancelled in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Definition cancelled True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions MapLinkSlaveToMaster and MapLinkSlaveToDifferentialMaster Examples Declaration INST UnlinkSlaveToMaster bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL 1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST LInlinkSlaveTalMaster bYarBOOL1 4bExecute bDone bYarBbOoL UsusiMode bError 1HusiChannel ierrorkumber Page 140 User Manual PMCprimo SoftPLC 14 Function library primo lib 14 12 Output DefineAnalogueLimitErrorOutput PMCprimo Command AE Define analogue limit error output Function library Output Description This function block defines a digital output of PMCprimo as error output If t
279. tion is activated The activation is carried out at the slave axis Before activation of the position allocation the master slave relation must be defined with the function block MapLinkSlaveToMaster and the table must be loaded with the function block TransferMapData onto the axis The position of the master axis is automatically after connection of the slave axis with the master axis transferred to the same by the host An active position allocation is signalled with X at the monitor with selected slave axis The stop and abort commands de activate a position allocation The linear position allocation is already pre defined by the name LINEAR e The position allocation LINEAR is especially used for the execution of transmission ratios specified with the function block SetScaleMapping 6 Non linear position allocations must be generated with the program PMotion as table or gt PMCprimo program and must be downloaded to the control The position allocation can be activated with stationary or moving master axes 1 Activation with stationary master axis The slave axis moves according to the activated position allocation to the corresponding position which is allocated to the slave axis for the instantaneous position of the master axis In case of an active software clutch Bit 1 Function SetMapOptionsWord age 101 the slave axis waits in the instantaneous position until the master axis is in the position corresponding to the position
280. to 2 000 000 000 Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetPositionOverflowCounter Factory setting 4 000 000 increments As of version 2 005 new Factory setting 4 194 304 This helps to avoid problems with absolute encoders because therefore the bound must have a value of 2 Examples Declaration INST SetPositionBound bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 4096 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 4096 bVarBOOL2 Inst bDone Example in FBD INST SetPositionBound BvarBOoOL1 bDone BvarBOoOLb 7 T i bError 1 4usichanrnal iErrarMurnber 40964udi value Page 134 User Manual PMCprimo SoftPLC 14 Function library primo lib SetPositionOverflowCounter PMCprimo Command BC Set position overflow counter Function library Mapping Description This function block locates the overflow counter to the specified value The overflow counter counts the exceeding of the position bounds The counting value is incremented in case of exceeding in positive and decremented when exceeding the cycle limitation in negative direction Input variables bEx
281. tput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetReferenceMode DefineReferenceBackwardOutput DefineReferenceOutput and DefineReferencelnput The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defined User Manual PMCprimo SoftPLC Page 155 Page 156 14 Function library primo lib Examples Declaration INST DefineReferenceForwardOutput bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiBank 1 usiOutput 5 usiPolarity 0 bVarBOOL2 Inst bDone Example in FBD INST DLefineReferenceFonwardOutput BvarBOoOL1 hbExecute bDone bVarb00L2 usiNade bErrar usiChannel iErrar lumbar usiBank UsiQutput usiPolarity ao ms ID User Manual PMCprimo SoftPLC 14 Function library primo lib DefineReferenceOutput PMCprimo Command OR Set reference adjustment output Function library Output Description With this fu
282. tration 15 Position allocation as equation SetScaleMapping SetMapBaseOffset SetSlaveMapOffset S Table Mp Ma X SBwaster SBpiffmaster MB X SM MF S Mp Ma SB master SBpittmaster User Manual PMCprimo SoftPLC LW BitS Illustration 16 Position allocation with differential as equation Demand position Slave axis Position first master axis MapLinkSlaveT oMaster Position differential master axis MapLinkSlaveT oDifferentialMaster Position bound master axis Position bound differential master axis Page 89 DefineMap Page 90 14 Function library primo lib PMCprimo command EM Edit map Function library Mapping Description With this function block a table allocation can be defined The program PMotion can be used for the generation of a prefabricated function block with all necessary variables The definition is essentially facilitated with this program as the curve generation is carried out graphically From this data a function block can be exported which only has one start input bExecute and internally carries out all necessary initialisations Input variables bExecute BOOL The table allocation is defined in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 sMapname STRING The name of the table diMasterBound DINT The master position bound iSteps INT The number of the table support value maximum 2000 pdiSlavepos POINT
283. trol loop In this case PMCprimo waits for a reference signal and when recognising a reference signal the position counter is set to the value of SetReferenceOffset Following the distance between reference signals as position bound is entered to the value SetPositionBound The return to the position O can be prevented with the function block SetReferenceOptionsWord page 272 Vt reference signal reference signal v reference signal return to cycle length reference signal V Illustration 22 Initialisation position and position bound User Manual PMCprimo SoftPLC 14 Function library primo lib Input variables bExecute BOOL The initialisation is started in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axle number from 1 to n depending on the system bDirection BOOL The rotational direction 0 negative 1 positive Output variables bDone BOOL Initialistion completed True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 See also InitialisePosition Examples Declaration INST InitialisePositionBounds bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0
284. ts as for example the target information data and the PMCprimo library are copied Herewith all required components are available 9 1 Usage of directories Different subdirectories will be added in the installation directory Here a short description Directory Doku PDF documents Help Files for online help in different languages English French German Library Additional libraries and function blocks PLCConf GSD and EDS files for Profibus and CANopen Projects Directory for the projects Target Files for the different target descriptions for any manufacturer Primo The files necessary for PMCprimo If additional GSD files should be added then they have to be copied in the directory Library PLCConf The installation program automatically installs all for PMCprimo necessary files This can be done also with the program InstallTarget manually 10 First steps Please start the program CoDeSys for programming the control A new window opens If the program is started the first time or a new program should be started please click in the menu data file to new Now a window is opened in which the target system must be set Page 12 User Manual PMCprimo SoftPLC DIIZ 10 First steps Target Settings x Configuration CoDeSys for Primo Target Platform Memory Layout General Networkfunctionality Platform Motorola 68k M CPU ColdFire Reserved Register 1 I Support Float Processor AS E JV Use 16 bit
285. ts et bYarBOOL 4bExecute bvarBOOL dusiMacde 1 4usiChannel 10004diValue User Manual PMCprimo SoftPLC Page 271 SetReferenceOptionsWord Page 272 14 Function library primo lib PMCprimo Command RW Set reference options word Function library Referencing Description With this function block a function selection is done and the reference behaviour of PMCprimo is pre set Bit 0 stands with input or output on the right and Bit 7 on left side Input variables bExecute BOOL usiNode USINT Host usiChannel USINT usiControlword USINT Bit 1 Bit 4 The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 The node number in the linked system 0 if only one unit or The axis number from 1 to n depending on the system The setting with following meaning This Bit activates the cyclic homing if it is activated with the RM command Reference correction not active Reference correction active This Bit determines the reaction of PMCprimo if the reference error to be corrected is bigger than the permissible maximum value with reference error correction Function SetMaxReferenceCorrection page 255 PMCprimo completely ignores a reference error Only reference signals within the window are evaluated and corrected PMCprimo executes a reference error correction with the permissible maximum value and provides the error signal
286. udiv alue User Manual PMCprimo SoftPLC Page 263 14 Function library primo lib SetReferenceFalseHighLimit Page 264 PMCprimo Command FH Set reference input true high limit Function library Referencing Description This function block acts in connection with the function blocks SetReferenceFalseLowLimit SetReferenceTrueHighLimit and SetReferenceTrueLowLimit These four modules limit the travel length of a reference input defined with the module DefineReferencelnput They allow that PMCprimo only reacts on a reference input when the signal is recognised within the specified limits The reference input is evaluated only then as valid if it results between the values of SetReferenceFalseLowLimit and SetReferenceFalseHighLimit in untrue and afterwards between the values of SetReferenceTrueLowLimit and SetReferenceTrueHighLimit in true The input is only evaluated as valid reference input by PMCprimo when it has changed from true to untrue However the reference error for the initialisation and the cyclic reporting is determined with the rising edge change from untrue to true of the input signal The values are given in increments An inspection of the limit values for reference input true does not occur with indication of zero SetReferenceTrueHighLimit and SetReferenceTrueLowLimit An inspection of the limit values for a reference input untrue does not occur with indication of zero for SetReferenceFalseHighLimit and SetReferenceFa
287. usiChannel USINT The axis number from 1 to n depending on the system diValue DINT The relative target position in increments in the range of 8 389 000 Output variables bDone BOOL Target position has been achieved True or movement is still not completed False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAcceleration SetVelocity SetDeceleration SetSlowSpeedMode SetLowPositionLimit SetHighPositionLimit and SetSlowSpeed Page 220 User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Declaration INST MoveRelativePosition bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 2000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diValue 2000 bVarBOOL2 Inst bDone Example in FBD INST MoveRelatvePoasition BvarBOOL1 BbExecute BvarBOoOLb qusiMade 1 4usichannal ierroriJumbetr 20004diValue User Manual PMCprimo SoftPLC Page 221 14 Function library primo lib MoveToAbsolutePosition PMCprimo Command MA Move to absolute position Function library Positioning Description The motor moves to the specified absolute position The movement follows a trapezoidal or sinusoidal velocity profile Illustration 24 It can be selected via Bit 2 the
288. ut variables are set to False or 0 usiNode USINT The node number in the linked system O if only unit or Host usiChannel USINT The axis number from 1 to n depending on the system uiValue UINT The filter value from 0 up to 65 535 increments Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetReferenceMode and SetReferenceOptionsWord Factory setting 0 switched off User Manual PMCprimo SoftPLC Page 253 14 Function library primo lib Examples Example in IL Declaration INST SetFilterOnReference bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 300 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 uiValue 300 bVarBOOL2 Inst bDone Example in FBD INST aetFilter nFeference BvarBoOL1 bVarB00L2 0 300 Page 254 User Manual PMCprimo SoftPLC 14 Function library primo lib SetMaxReferenceCorrection PMCprimo Command SR Set maximum reference correction Function library Referencing Description This function block limits with values unequal to zero of the reference error which is corrected at the motor to the set value This function block can be used to elimi
289. variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetScaleMapping Examples Declaration INST SetMapScaleFromBounds bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBOOL2 Inst bDone Example in FBD INST SetMapScaleFromBounds bVarBQ00L1HbExecute bDone BhvarBOOoL 7 I AusiMade bErrar 1HusiChannel ierrorMumber Page 132 User Manual PMCprimo SoftPLC 14 Function library primo lib SetPositionBound PMCprimo Command SB Set position overflow bound Function library Mapping Description This function block defines a position bound as limitation of the absolute position i e if the motor position exceeds the adjusted position bound the adjusted value is subtracted from the absolute value of the position counter The limitation of the absolute position is mostly identically adjusted with the reference position This facilitates the continuous monitoring of the refer
290. waits for example for a defined position before bDone goes TRUE Therefore the critical time polling from the PLC is avoided User Manual PMCprimo SoftPLC Page 33 14 5 Page 34 14 Function library primo lib Auxiliary The analogue outputs 10V can be defined as auxiliary outputs with the function blocks DefineAuxiliaryOutput SetMonitorOutputFunction SetMonitorOutputGain and SetMonitorOutputOffset These auxiliary outputs can be used in order to connect an oscilloscope or multimeter for example and to indicate various values from the control However a frequency converter can also be connected and the speed can be controlled with the function SetMonitorOutputOffset without position control As a result a slowly control could be realised i e dependent on an analogue input for example the frequency converter can be controlled faster or more slowly The following graphics shows the connections of the various functions SetMonitorOutputOffset D A converter de SetMonitorOutputGain E gt 48 oegec SetMonitorOutputF unction Illustration 9 Analogue auxiliary output Voltage gt User Manual PMCprimo SoftPLC 14 Function library primo lib DefineAuxiliaryOutput PMCprimo command AO Set auxiliary output channel Function list Auxiliary Description This command allocates the monitor signal for the current channel to one of the analogue outputs on the same board Th
291. was executed with the next reference signal A typical application for this function is for example the control of a distribution point which distinguishes between good and worse elements For example the front edge of elements lying on a conveyer belt is measured with a photo cell The measured value in connection with the value of SetMaxReferenceCorrection can be used for the control of a distribution point to disconnect good and worse elements Input variables bExecute BOOL The output is defined in case of a change from O to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiBank USINT 1 to 4 3 and 4 is virtual usiOutput USINT The output number from 1 to 8 usiPolarity USINT The polarity O positive 1 negative Output variables bDone BOOL Output has been defined True or definition is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetReferenceMode and DefineReferencelnput The function block UndefineOutput is available for cancellation of the output definition Factory setting no output defined User Manual PMCprimo SoftPLC Page 159 Page 160 14 Function library primo lib Examples Declaration
292. ways set down at the slave axis The Initialisation of the transmission ratio with analogue distances functions as follows The motor moves in the same direction with the velocity function module SetSlowSpeed as with the start up of the web tension demand value the position stores and stopps until an analogue limit value has been exceeded Subsequently the motor moves in the opposite direction these second position stores until an analogue value has been exceeded again and stores the distance between these both values as value of SetAnalogueRangeDistance for the slave The Bits 4 and 5 in the function SetAnalogueControlWord release the Initialisation of the transmission ratio with analogue distances i e this function is automatically executed when the position allocation is activated with ExecuteMap The determined transmission ratio SetAnalogueRangeDistance Slave SetAnalogueMasterRangeDistance Master is used as initial transmission ratio see function module CalculatelnitialRatio Input variables bExecute BOOL The transmission ratio is determined in case of a change from O to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system O if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiMasterSlave USINT 0 distance is measured on slave 1 distance is measured on master Output variables bDone BOO
293. with PMCprimo Drive and channel x 1 Yes with PMCprimo Drive and channel x 1 Yes with version 3 56a or 4 94a Yes with version 3 56a or 4 94a Yes with version 5 x Yes with version 5 x Yes with version 5 x Following error available in PMCprimo Yes Yes Yes Yes O O O Yes Use of position loop of PMCtendo DD4 Z O Z O Z O O Yes Yes Yes Yes Yes Yes Page 81 Page 82 14 Function library primo lib Input variables bExecute BOOL The value is written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system usiValue USINT The selected kind of the encoder Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error ierrorNumber INT Indicates the exact error cause see GetError page 203 Connected function SetNumberOfBits Factory setting 0 Quad incremental evaluation Examples Declaration INST SetFeedbackEncoder bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 usiValue 8 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarB
294. written in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system udiValue UDINT The velocity from 0 to 4 000 000 increments s Output variables bDone BOOL Value has been written True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetSlowSpeedMode MoveConstantVelocity MoveRelativePosition MoveToAbsolutePosition SetReferenceCorrectionVelocity SetMapNBaseOffset SetSlaveMapOffset and SetScaleMapping Factory setting 0 stoppage Page 236 User Manual PMCprimo SoftPLC 14 Function library primo lib Examples Example in IL Declaration INST SetSlowSpeed bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 30000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 udiValue 30000 bVarBOOL2 Inst bDone Example in FBD INST Setslows peed bVarB00L1H4bExecute BvarBOooL ll AusiMade 14usichannal iErrarurmbaer 30000 4udi Value User Manual PMCprimo SoftPLC Page 237 14 Function library primo lib SetSlowSpeedMode Page 238 PMCp
295. xceeds this value PMCprimo issues a corresponding error signal If the Bit 3 of the module SetErrorOptionsWord is set to 1 the exceeding of the upper limit is evaluated as motor OFF error Input variables bExecute BOOL The value is set in case of a change from 0 to 1 0 resets the function module and the output variables are set to False or 0 usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system diLimit DINT The limit value of 2 147 483 648 up to 2 147 483 647 2047 corresponds to 10V it the analogue input is used Output variables bDone BOOL Value is set True or module is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 Connected functions SetAnaloguelnputLowLimit und SetAnalogueControlMode Factory setting 2000 Examples Example in IL INST SetAnaloguelnputHighLimit bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diLimit 1000 LD INST bDone ST bVarBOOL2 Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 diLimit 1000 bVarBOOL2 Inst bDone Example in FDB INST SetAnaloguelnputHighLimit b arBOOL1 4bExecute bVarBOOL2 D usiMnde oo errati o 1HYusiChannel ierrorMumber 1000HdiLIMiIT Page
296. y velocity Function library Display Description With this function block the actual speed of the selected axis is written to diValue The unit of the speed is made in increments second When using the function block SetVelocityAveragingTime an averaged speed is determined via the set time Input variables bExecute BOOL The value is read in case of a change from 0 to 1 0 resets the function block and the output variables are set to False or 0 except diValue usiNode USINT The node number in the linked system 0 if only one unit or Host usiChannel USINT The axis number from 1 to n depending on the system Output variables bDone BOOL Value has been read True or it is still under operation False bError BOOL True an error has occurred False no error iErrorNumber INT Indicates the exact error cause see GetError page 203 diValue DINT The actual speed Also refer to SetVelocityAveragingTime Examples Declaration INST DisplayVelocity bVarBOOL1 BOOL bVarBOOL2 BOOL Example in IL CAL INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 LD INST bDone ST bVarBOOL2 LD INST diValue ST diValue Example in ST INST bExecute bVarBOOL1 usiNode 0 usiChannel 1 bVarBool2 Inst bDone diValue Inst diValue Example in FBD INST DisplayVelocity BvarBOaoL1 BbExecute b arBooLzi 0 4usiNode 1 4usichannal iIErrar lumber divalue diValue Page 64 User Manual PMCprimo S

Download Pdf Manuals

image

Related Search

Related Contents

Heath Zenith SL-5659 User's Manual  Samsung SGH-F480 Manual de utilizare  Weslo 831.24822.0 Treadmill User Manual  

Copyright © All rights reserved.
Failed to retrieve file