ADS_over_EthercatΒΆ
Function blocks for AoE (ADS over EtherCAT)
Example:
This example reads the scanning distance parameter from a Sick WTB12C-3P2413 IO-Link Device connected to the second port of a Beckhoff EKL6224 EtherCAT IO-Link gateway.
PROGRAM PLC_PRG
VAR
iolinkread : ETC_ADS_IoLinkRead;
xRead : BOOL;
wScanningDistance: WORD;
END_VAR
EtherCAT_Master();
IF EtherCAT_Master.xConfigFinished THEN
iolinkread(xExecute := xRead, usiCom := 1, uiDevice := EL6224.PhysSlaveAddr, udiTimeout := 500, usiPort := 1,
uiIndex := 144, usiSubIndex := 0, pbyData := ADR(wScanningDistance), udiSize := SIZEOF(wScanningDistance));
// usiPort 1: second port of gateway
// uiIndex 144: scanning dIstance
IF iolinkread.xDone THEN
// Todo: add handling for data
xRead := FALSE;
END_IF
IF iolinkread.xError THEN
// Todo: add Error handling
xRead := FALSE;
END_IF
END_IF