|
| 1 | +# SinaPos |
| 2 | + |
| 3 | +You use the function block `SinaPos` to control the axis via basic positioner technology function (EPOS) of SINAMICS drive systems. This requires that the basic positioner technology has been properly configured and telegram 111 has been selected in the drive. Connect the according hardware identifier of the drive telegram to the inputs `hwidSTW` and `hwidZSW`. With the `mode` input you can change beetween the operation modes such as positioning, setup mode, homing and jogging of the axis. |
| 4 | + |
| 5 | +## Parameters |
| 6 | + |
| 7 | +| Name | Section | Type | Description | |
| 8 | +| --------------------- | ------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | |
| 9 | +| mode | Input | `SinaPosMode` | Operating mode selection for MDI, see [SinaPosMode](../types/sinapos.md.md#sinaposmode) for further details | |
| 10 | +| enableAxis | Input | `BOOL` | TRUE = enable axis, FALSE = switch off drive (OFF1) | |
| 11 | +| acknowledgeError | Input | `BOOL` | Acknowledge drive errors with rising edge | |
| 12 | +| cancelTraversing | Input | `BOOL` | FALSE = Rejects the active traversing job | |
| 13 | +| intermediateStop | Input | `BOOL` | FALSE = Interrupts the active traversing job | |
| 14 | +| positive | Input | `BOOL` | Positive traversing direction | |
| 15 | +| negative | Input | `BOOL` | Negative traversing direction | |
| 16 | +| jog1 | Input | `BOOL` | Jog signal source 1 | |
| 17 | +| jog2 | Input | `BOOL` | Jog signal source 2 | |
| 18 | +| flyingReferencing | Input | `BOOL` | Controls selection for flying referencing | |
| 19 | +| executeMode | Input | `BOOL` | Activate traversing job/setpoint or activates homing or takes over home position | |
| 20 | +| position | Input | `DINT` | Position setpoint in LU for direct traversing operating modes or traversing block number in traversing block operation mode | |
| 21 | +| velocity | Input | `DINT` | Velocity in 1000 LU/min for MDI operating mode | |
| 22 | +| overrideVelocity | Input | `INT` | Velocity override in %, effective from 0% to 199% | |
| 23 | +| overrideAcceleration | Input | `INT` | Acceleration override in %, effective from 0% to 100% | |
| 24 | +| overrideDeceleration | Input | `INT` | Deceleration override in %, effective from 0% to 100% | |
| 25 | +| config | Input | `SinaPosConfiguration` | Configuration for axis, see [SinaPosConfiguration](../types/sinapos.md#sinaposconfiguration) for further details | |
| 26 | +| hwidSTW | Input | `UINT` | Hardware ID of the SIMATIC S7-1200/1500 setpoint slot | |
| 27 | +| hwidZSW | Input | `UINT` | Hardware ID of the SIMATIC S7-1200/1500 actual value slot | |
| 28 | +| axisEnabled | Output | `BOOL` | TRUE = axis is enabled | |
| 29 | +| axisPositionOk | Output | `BOOL` | TRUE = target position of the axis reached | |
| 30 | +| axisSetpointFixed | Output | `BOOL` | TRUE = setpoint is stationary (SINAMICS S/G120 FW < 4.8 / 4.7.9: r2199.0, SINAMICS S/G120 FW >= 4.8 / >= 4.7.9: r2683.2) | |
| 31 | +| axisReferenced | Output | `BOOL` | TRUE = home position is set | |
| 32 | +| axisWarning | Output | `BOOL` | TRUE = alarm of the drive pending | |
| 33 | +| axisError | Output | `BOOL` | TRUE = drive fault | |
| 34 | +| lockout | Output | `BOOL` | TRUE = switch-on inhibited | |
| 35 | +| actualVeloctiy | Output | `DINT` | Actual veloctiy (standardized 40000000h = 100% p2000) | |
| 36 | +| actualPosition | Output | `DINT` | Actual position in LU | |
| 37 | +| actualTraversingBlock | Output | `UINT` | Actual traversing block (0-63) | |
| 38 | +| actualMode | Output | `SinaPosMode` | Actual operating mode | |
| 39 | +| posZSW1 | Output | `SinaPosZSW1` | Status of POS_ZSW1, see [SinaPosZSW1](../types/sinapos.md#sinaposzsw1) for further details | |
| 40 | +| posZSW2 | Output | `SinaPosZSW2` | Status of POS_ZSW2, see [SinaPosZSW2](../types/sinapos.md#sinaposzsw2) for further detials | |
| 41 | +| actualWarning | Output | `WORD` | Current alarm number | |
| 42 | +| actualFault | Output | `WORD` | Current fault number | |
| 43 | +| error | Output | `BOOL` | TRUE = fault in function block present | |
| 44 | +| status | Output | `SinaPosStatus` | Status of the function block, see [SinaPosStatus](../types/sinapos.md#sinaposstatus) for further details | |
| 45 | +| diagnosticsId | Output | `WORD` | Return values of communication errors (ReadData and WriteData) | |
| 46 | + |
| 47 | +## Example |
| 48 | + |
| 49 | +```iec-st |
| 50 | +PROGRAM SampleProgram |
| 51 | + VAR_EXTERNAL |
| 52 | + axisTelegram111: UINT; |
| 53 | + END_VAR |
| 54 | +
|
| 55 | + VAR |
| 56 | + _enableAxis: BOOL; |
| 57 | + _acknowledgeError: BOOL; |
| 58 | + _moveDistance: BOOL; |
| 59 | + _sinaPos: SinaPos; |
| 60 | + END_VAR |
| 61 | +
|
| 62 | + // check axis is enabled and select speed and direction |
| 63 | + IF _sinaPos.axisEnabled THEN |
| 64 | + // select mode when axis is in standstill |
| 65 | + IF _sinaPos.axisPositionOk THEN |
| 66 | + _sinaPos.mode := SinaPosMode#RelativePositioning; |
| 67 | +
|
| 68 | + // check mode is active and execute traversing job |
| 69 | + IF _sinaPos.actualMode = SinaPosMode#RelativePositioning THEN |
| 70 | + _sinaPos.position := 10000; |
| 71 | + _sinaPos.velocity := 500; |
| 72 | + _sinaPos.executeMode := TRUE; |
| 73 | + END_IF; |
| 74 | + ELSE |
| 75 | + // reset job parameters whenever axis is moving |
| 76 | + _sinaPos.position := 0; |
| 77 | + _sinaPos.velocity := 0; |
| 78 | + _sinaPos.executeMode := FALSE; |
| 79 | + END_IF; |
| 80 | + END_IF; |
| 81 | +
|
| 82 | + // call sina pos cyclically |
| 83 | + _sinaPos(enableAxis := _enableAxis, acknowledgeError := _acknowledgeError, hwidSTW := axisTelegram111, hwidZSW := axisTelegram111); |
| 84 | +END_PROGRAM |
| 85 | +``` |
0 commit comments