TwinCAT PLC Library Hydraulics - Version 1.4 — 5.4.2 FB_Encoder

Knowledge Base The individual function blocks required for a complete axis are listed and described below. 5.4.1 FB_Init The function block loads the parameters from the given file path and transfers them to the axis reference. The function block also links the input and output structures to the axis reference. All parameters are stored in binary form in an Axis name.dat file. Once the parameters have been loaded successfully, the bParamsEnable flag in the axis reference becomes TRUE. Only now may all other axis-related function blocks be called up, otherwise calculations would be carried out with incorrect parameters.

The Init function block should be called cyclically to check the pointer addresses. Variables that are passed as addresses are marked with the prefix "p". 5.4.2 FB_Encoder The actual value is read from the input structure via the selected encoder type and converted into a position [mm] and velocity [mm/s]. If the actual values are very noisy, it is possible to filter them via a moving average ( MC_AxUtiSlidingAverage_BkPlcMc [ } 191] ) or a Pt1 element ( MC_AxUtiPT1_BkPlcMc [ } 189] ). In addition, it is possible to build custom filters. PLC Library Hydraulics 247 Version: 1.4