Overview

The EtherNet/IP connector provides tag-based read and write access to any EtherNet/IP (CIP) compliant device via implicit I/O assemblies, using the Sres.Net.EEIP SDK. It also supports explicit, on-demand CIP attribute reads/writes via connector methods.

Every poll cycle reads the input assembly instance from the device and updates every subscribed tag from that one buffer, based on each tag's Address (see below). Output writes go through the output assembly instance whenever a tag's value changes.

The connector detects when the underlying session is lost and reconnects automatically without blocking the read cycle - reconnection runs on its own dedicated background thread. Since the EEIP client instance is reused across reconnects rather than recreated, the previous session is explicitly unregistered first (tolerating a failure there, since a session that's already broken is usually why the reconnect is happening in the first place).

Parameters

Name Values Description
Type EEIP The connector type identifier.
IP IP address or hostname The IP address or hostname of the device.
InputAssembly integer or 0x-prefixed hex The input assembly instance number to read.
OutputAssembly integer or 0x-prefixed hex The output assembly instance number to write.
UpdateRate milliseconds (integer) How often the connector reads the input assembly. Defaults to 1000.
ReconnectDelay milliseconds (integer) Delay between reconnect attempts while the device is unreachable. Defaults to 5000.

Supported Tag Types:

Tag Type Address Behaviour
Bool Tag byteIndex.bitIndex, e.g. 2.3 A single bit within the input/output assembly buffer.
Any standard tag A bare byte index, e.g. 4 A single raw byte.
Any standard tag start-end, e.g. 4-7 A raw byte range, returned as a byte array.
Any standard tag startasc-end, e.g. 4asc-7 The literal text asc between two byte indices - reads that byte range as an ASCII string.
Any standard tag byte1,byte2, e.g. 4,5 Combines two byte indices into a single 16-bit (ushort) value.

Writable (Out/InOut) tags of any of the above address forms are written back to the output assembly via SetInstance whenever their value changes.

Connector Methods

Name Arguments Description
WriteData Class, Instance, Attribute, Value Writes a single byte value to an explicit CIP attribute, bypassing the assembly buffer. Currently supports digital output boards only.
ReadData Class, Instance, Attribute Reads a single explicit CIP attribute on demand, bypassing the assembly buffer.

Addressing

The Address field of a tag follows one of the five formats described above, all relative to the configured input/output assembly buffer. For a one-off read/write against a specific CIP class/instance/attribute rather than the assembly buffer, use RunMethod("READDATA"/"WRITEDATA") instead.

Diagnostic Codes

Code Type Description
1030 Error EEIP Client failed to Get Instance
1031 Error EEIP Client failed to Set Instance
1215 Error EEIP Client failed to register session
1220 Error EEIP Client not connected...sleeping for 5s
1310 Error Error reading a tag's value during ReadUpdate
1405 Error Failure to set an Analogue address
1510 Error RunMethod called with an unrecognised method name
1520 Error RunMethod threw an unhandled exception
2100 Info Connector started
2200 Info EEIP client connecting
2201 Debug Connection parameters (IP, assembly values)
2205 Info EEIP registering session
2210 Info EEIP output Array created
2225 Info Controller connected
2230 Debug Invoking Connected event
2235 Debug Invoking ConnectionLost event
2240 Debug HandleDisconnection event fired
2245 Debug HandleConnection event fired
2250 Debug Error unregistering previous session (expected if already disconnected)
2255 Info Client connection re-established
2260 Info Reconnecting
2300 Debug Input array length 0 - clearing session
2305 Debug ReadUpdate cycle overran cycleDelay
2400 Debug ITag not present - ChangeData called for an unregistered tag name
2600 Debug Error unregistering session during shutdown
2500 Debug RunMethod called while not connected