FUNCTION UserInitialisations : BOOL VAR_INPUT dummy : BOOL := FALSE; (* not used *) END_VAR VAR AxIdx : UDINT; ChIdx : UDINT; END_VAR (* Register PLC at all axes interfaces *) FOR AxIdx := 1 TO nAxis DO (* Set plc_present_w at each axis *) pAC[AxIdx]^.addr^.HLIHeadAxe_Data.X_PLCPresent := TRUE; (* Register at all axis specific control units you want to handle by PLC *) (* Register at all control units to enable a drive *) pAC[AxIdx]^.addr^.McControlLr_Data.MCControlBoolUnit_TorquePermission.X_Enable := TRUE; pAC[Lauf1]^.addr^.McControlLr_Data.MCControlBoolUnit_ReleaseFeed hold.X_Enable := TRUE; pAC[Lauf1]^.addr^.McControlLr_Data.MCControlBoolUnit_DriveOn.X_Enable := TRUE; END_FOR; (* Register PLC at all channel interfaces *) FOR ChIdx := 1 TO nChannel DO (* Set plc_present_w at each channel *) pMC[ChIdx]^.addr^.HLIHeadChannel_Data.X_PLCPresent := TRUE; (* Register at all channel specific control units you want to handle by PLC *) END_FOR; UserInitialisations := TRUE;