IMDHMIControls LibraryShop main store

How-to

Read IO-Link parameters over EtherCAT AoE from a ctrlX PLC

Industrial networks Published 5 min read

Short answer

Call IL_ECATAoEGetConfigInfo with the IO-Link master's EtherCAT address to resolve its Network ID, then pass that Network ID to IL_ECATAoERead with target port 16#1000 plus the IO-Link port number and index group 16#F302. The index offset packs the parameter index and subindex, and the destination buffer must match the parameter's documented length or the read ends with an error.

On this page
  1. Configure the IO-Link master in the IO engineering project
  2. Import the AoE function blocks
  3. Resolve the master Network ID with IL_ECATAoEGetConfigInfo
  4. Call IL_ECATAoERead with the full AoE address set
  5. Worked example: reading the vendor name from an MPB10 on IO-Link port 1
  6. Diagnose where a failed read stops
  7. Write parameters with the same address set
  8. Questions asked

An IO-Link parameter read over EtherCAT from a ctrlX PLC is two calls in the CXA_ETHERCATMASTER library. IL_ECATAoEGetConfigInfo takes the IO-Link master's EtherCAT address and returns its AoE Network ID; IL_ECATAoERead then carries the request through the master to the IO-Link port you name. Set the target port to 16#1000 plus the IO-Link port number, hold the index group at 16#F302, and pack the parameter index and subindex into the index offset. Size the destination buffer to the parameter's documented length, because a mismatch ends the read with an error. On PROFINET the same job means reading IO-Link ISDU parameters over PROFINET acyclic record data; AoE — ADS over EtherCAT — is the EtherCAT route, and it exists to reach the object dictionaries of devices on field buses underneath an EtherCAT slave, not just the slave itself.

You need a ctrlX CORE with the PLC and ETHERCAT apps, an EtherCAT IO-Link master that supports AoE, and the IO-Link device on a port whose number you know. If the master still has to come onto the network, routing an IO-Link master to a ctrlX CORE over EtherCAT is the prerequisite.

  1. Install the master's and the sensor's device descriptions through the Device Repository menu.
  2. Scan the network and parametrize the IO-Link realtime channel: port mode and the cyclic data the sensor exchanges.
  3. Open the device's own menus and confirm AoE is exposed. No menu entry means the master does not provide this route, and no PLC argument will add it.
  4. Download the finished EtherCAT configuration before you open PLC engineering, so the read targets the network that is actually loaded.

Cyclic process data and acyclic parameter access are separate services: valid realtime values prove the port is communicating, not that the parameter service is addressed correctly.

Import the AoE function blocks #

Import CXA_ETHERCATMASTER into the PLC project. The library carries the AoE function blocks together with executable examples that show the full call sequence — trigger, wait for done, then decode. If your IO-Link devices sit on a local ctrlX I/O module instead of an EtherCAT master, whether the ctrlX I/O XI510004 can read IO-Link ISDU parameters is the matching question, and it has a different answer path.

The protocol is not tied to one engineering tool: operating instructions for AoE-capable EtherCAT IO-Link masters describe reaching the same service on TwinCAT controllers with the system library's ADS function blocks. What is fixed is the master side — the master must translate the AoE request into an IO-Link parameter transaction on the selected port.

Resolve the master Network ID with IL_ECATAoEGetConfigInfo #

Call IL_ECATAoEGetConfigInfo with the IO-Link master's EtherCAT device address as input; the block answers with the Network ID. The two addresses do different jobs: the EtherCAT address selects the slave on the bus, the Network ID identifies the AoE destination behind it. Beckhoff's EL6224 documentation, for example, describes a dedicated AoE NetID allocated by the configuration tool for the IO-Link master section, so treat the NetID as a configured value you resolve at runtime — never a constant copied from another project. Proceed to the read only on a successful lookup, and record the block's diagnostic result when it fails.

Call IL_ECATAoERead with the full AoE address set #

Input Value What it selects
Master name address of a string holding the EtherCAT master's name the local master instance
Network ID result of IL_ECATAoEGetConfigInfo the AoE destination
Target port 16#1000 + IO-Link port number the downstream IO-Link channel
Index group 16#F302 the parameter-access service
Index offset parameter index and subindex, packed per the master's documented mapping the parameter inside the device
Destination buffer address and size where the returned bytes land

The transaction is asynchronous: trigger it once, keep every argument stable until done, and do not overlap requests through one function-block instance. The port-number mapping and the index-offset encoding come from the master's parameter-access documentation — confirm how the physical port labels map to the number you add to the base before you trust the arithmetic.

Worked example: reading the vendor name from an MPB10 on IO-Link port 1 #

Inputs:

  • Device: SICK MPB10 IO-Link sensor, on IO-Link port 1 of the master (the port number is the illustrative input; the label-to-number mapping is in the master's documentation).
  • Parameter: index 16, the vendor name, with its subindex, data type and length taken from the MPB10 parameter description.
  • Index group: 16#F302, the fixed value for this access scheme.
  • Target-port base: 16#1000.
  • Destination: a string buffer allocated to parameter 16's documented length.

Rule in words: the target port is the base plus the IO-Link port number, and the index offset packs the parameter index and its subindex in the order the master's documentation defines.

Arithmetic:

16#1000 = 4096 decimal 4096 + 1 = 4097 = 16#1001

The read goes out with target port 16#1001, and on done the buffer holds the vendor-name string. The vendor name is the right first test: it exercises every hop of the path with harmless data.

Decision: allocate the destination to exactly the documented byte count of parameter 16 before triggering the read. A buffer smaller than the parameter ends the transaction with an error; a larger buffer lets the read succeed and you ignore the trailing bytes. If the lookup succeeded and this read still fails, correct the port arithmetic and the offset packing before changing anything else.

Diagnose where a failed read stops #

  • IL_ECATAoEGetConfigInfo fails: the master name string, the EtherCAT address, or the downloaded configuration is wrong. Fix these first; no downstream argument compensates.
  • The read fails after a good lookup: recheck the target-port arithmetic, the index group constant, the offset packing, and the buffer size. Read the IO-Link port diagnostics during the request — a device that has dropped off the port fails the transaction whatever the addressing.
  • The read succeeds but the value looks wrong: the bytes were decoded with the wrong type. Inspect the raw buffer and apply the parameter's documented data type and encoding.
  • The request times out: check the port state before lengthening anything; a longer timeout does not repair an invalid address.

Write parameters with the same address set #

The write block in the same library takes the identical inputs and moves data in the opposite direction. Encode the value in the parameter's documented data type before the call, and apply the same length rule to the source buffer. On EtherNet/IP, what an EtherNet/IP IO-Link master exposes to your PLC covers the equivalent port-parameter route for that network.

Questions asked

Does working IO-Link process data prove the AoE parameter path is usable?

No. Cyclic process data and acyclic parameter access are separate services on the same master. Realtime values prove the EtherCAT link and the IO-Link port are communicating, but the parameter transaction still needs the master to expose AoE, the correct target port and packed index offset, and a buffer matching the parameter length. Confirm AoE in the device menus before writing any PLC code.

Why does IL_ECATAoERead fail after IL_ECATAoEGetConfigInfo succeeds?

The lookup only proves routing to the master. A failed read points downstream: the target port must be 16#1000 plus the port number, the index group 16#F302, the index offset must pack the parameter index and subindex exactly as the master documents, and the destination buffer must match the parameter length.

Can a parameter write use the same function block arguments?

Yes. The write block in the CXA_ETHERCATMASTER library takes the same address set — master name, Network ID, target port, index group 16#F302 and the packed index offset — and moves data in the opposite direction. Encode the value in the parameter's documented data type before the call, and the same length rule applies: the source length has to match the parameter or the transaction errors.

What if the EtherCAT IO-Link master has no AoE support?

No combination of PLC arguments creates the service, because the AoE translation lives in the master. Check the device menus in the IO engineering project and the master's documentation. Without AoE, use the parameter-access method the master does expose, or fit a master that supports it.

Is the Network ID a fixed value, or must the PLC resolve it?

Masters that support AoE are allocated a dedicated AoE NetID by the configuration tool — Beckhoff's EL6224 documentation describes exactly that allocation for the IO-Link master section. Because the value comes out of the downloaded configuration, call IL_ECATAoEGetConfigInfo at runtime with the master's EtherCAT address rather than hard-coding a NetID copied from another project.

Keep reading

  • Explainer

    What an EtherNet/IP IO-Link master exposes to your PLC

    Full access to every port is decided by three documented items: the mode each port is configured in, the master's EtherNet/IP data map, and your PLC's client functions. Process data travels on the cyclic I/O connection; parameters need explicit CIP requests, and at 100 devices polled every 10 ms you would need 10,000 transactions per second, so bulk data belongs on the assembly connection.

    Industrial networks

  • Selection guide

    How to select a CODESYS fieldbus master for industrial Ethernet

    Select the master around the device, not the connector: the 750-340 is a PROFINET IO coupler, and a PROFIBUS station needs a different coupler. Confirm three matches — device protocol, runtime master package, supported network adapter — then size the bus cycle from the process budget; the worked example clears a 10 ms sensor-to-actuator budget at a 2 ms cycle and fails it at 4 ms. Bench-test a laptop NIC only if the runtime documents it.

    Industrial networks

  • Comparison

    PROFINET versus DeviceNet for machine and panel I/O

    Choose by controller ecosystem first: PROFINET is industrial Ethernet at 100 Mbps with line, star and ring topologies, while DeviceNet is a CAN-based trunk running 125 to 500 kbps. Speed only decides when the panel needs dense or fast I/O. PROFINET for new high-speed machines, DeviceNet where the Rockwell-era devices and wiring already exist.

    Industrial networks