Programming example in the IEC program
INFORMATION
Access to the additionally configured process data can only be programmed using the methods of the logic device assigned to the axis.
- Exit the configuration menu and open the IEC project in the IEC Editor.
- Declare the required local variables as shown.
- In the action User_PRG.ReadActualValues, read process data words 9 to 10 using the GetAdditionalPdIn() method. These process data words contain the position value of the touchprobe function, which is generated accordingly.
- In the action User_PRG.ReadActualValues, read the process data word 11 using the GetAdditionalPdIn() method. This process data word contains the counter value of the touchprobe function.
- In the action User_PRG.ReadActualValues, read the additionally configured status bit using the GetAdditionalState() method. This status bit contains the xActive feedback of the touchprobe function.
- In the action User_PRG.WriteSetpointValues, write the additionally configured status bit using the SetAdditionalCommand() method. This status bit contains the xActivate control signal of the touchprobe function.
- You can activate the touchprobe function using the xActivate bit. xActive is reported back once the touchprobe function has been activated. The touchprobe counter increments with each touchprobe event. The position value allocated to the event is stored in the local variable diPosition.