Skip to main content

Configuration

Through master.Config you reach the MasterConfig object, which manages every communication setting in one place.

Properties​

CategoryPropertyTypeAccessDescription
Cycle configurationLoopCycleuintRead/writePDO exchange cycle (ns). The master sends and receives PDO frames at this interval
HighResolutionTimerboolRead/writeRead: whether the system clock is already at 1ms (or finer); write: turn it on or off for this process, effective immediately. The installer leaves it off by default
Network transportFrameHighPriorityboolRead/writeHigh frame priority (off by default). Raises the send priority of frames at the OS layer. Linux: SO_PRIORITY; Windows: thread priority boost
UseUdpboolRead/writeUDP frame mode (EtherCAT gateway / EAP devices only; standard ESC slaves do not support it). Carries datagrams inside UDP/IP
IsUdpAvailableboolRead-onlyWhether UDP mode is available. Reflects whether the UDP socket was created during system initialization
VlanIdushortRead/writeVLAN ID (IEEE 802.1Q, 0-4095, 0 = disabled). Takes effect in real-time runtime mode only
VlanPrioritybyteRead/writeVLAN priority PCP (0-7, 7 = highest). Requires VlanId > 0 and real-time runtime mode
PDO configurationOverlappingGroupsboolRead/writePDO overlap mode (off by default). Inputs overwrite the output positions in the LRW frame; for special slaves such as TI ESC only
PackedModeboolRead/writePacked PDO mapping mode (disabled by default). PDO variables are packed bit by bit with no forced byte alignment; for bit-level IO modules
FilterThresholduintRead/writeConsecutive PDO frame loss threshold (default 3). The callback fires only after this many consecutive lost frames
Mutex protectionMutexProtectionboolRead/writeMutex protection (enabled by default). When enabled, locking is automatic and thread safety is guaranteed; when disabled, you manage it yourself
Adaptive timeoutAdaptiveTimeoutEnabledboolRead/writeAdaptive timeout (enabled by default). Samples the network RTT automatically and computes the optimal PDO timeout
State transition timeoutsTimeoutInitToPreOpintRead/writeINIT→PREOP timeout (ms), default 3000. 0 = use the SDK default
TimeoutPreOpToSafeOpintRead/writePREOP→SAFEOP timeout (ms), default 10000. 0 = use the SDK default
TimeoutSafeOpToOpintRead/writeSAFEOP→OP timeout (ms), default 10000. 0 = use the SDK default
WatchdogPdiWatchdogMsintRead/writePDI watchdog timeout (ms), default 0. 0 = use the slave default
ProcessDataWatchdogMsuintRead/writeProcess data watchdog timeout (ms), default 100 (range 0-6553). 0 = use the slave default
Scan configurationScanRevisionMatchScanRevisionMatchModeRead/writeRevision matching policy for the network scan (default IgnoreRevision)
Frame repeatFrameRepeatCountbyteRead/writeFrame repeat count (ETG.1500 5.4.3, default 1 = disabled, range 1-3). A master-level setting that applies only to groups in which every slave supports it
DC configurationDriftCompensationboolRead/writeDC drift compensation switch (default false)
Mailbox configurationMailboxConfigMailboxConfigRead-onlyMailbox resilience configuration (the instance always exists; set its properties directly). TimeoutMs defaults to 5000ms (range 1-60000) and RetryCount to 3 (range 0-10); both apply to SDK mailbox transactions

Cycle configuration​

LoopCycle​

public uint LoopCycle { get; set; }

PDO exchange cycle time, in nanoseconds (ns).

The master runs its real-time cycle at this LoopCycle, sending and receiving PDO frames. The value sets how often process data is refreshed between master and slaves: the smaller the value, the faster the refresh, but the higher the demand on the system's real-time capability. Real-time runtime supports a minimum of 31 µs (31,000ns, in whole microseconds).

Recommended values

On Windows, keep it at or above 125,000ns (125 µs). Real-time runtime fully supports 31 µs; smaller values are meaningless on Windows, because the application layer cannot write at a higher rate.

Example:

master.Config.LoopCycle = 1000000;  // 1ms     = 1,000,000ns
master.Config.LoopCycle = 500000; // 500 µs = 500,000ns
master.Config.LoopCycle = 250000; // 250 µs = 250,000ns
master.Config.LoopCycle = 125000; // 125 µs = 125,000ns (recommended minimum on Windows)
DC drift compensation

DC drift compensation runs automatically; no extra configuration is needed.

Mailbox traffic and the PDO cycle

Mailbox frames (SDO read/write, FoE file transfer, emergency messages, and so on) ride along in the PDO cycle and take no extra frames.

Mailbox response latency: about 2-3 PDO cycles. With LoopCycle=1ms, an SDO read takes about 2-3ms.

HighResolutionTimer​

public bool HighResolutionTimer { get; set; }
High-resolution clock

Read: whether the system clock is already at 1ms (or finer) — not a hard-coded false. Write: turn it on or off for this process, effective immediately. The installer leaves it off; you set it in the cycle configuration. When on, waits are more accurate but the mouse may stutter; PDO on isolated cores does not depend on it. On non-Windows systems it does nothing.

The read side returns whether the system clock is already at 1ms, not a hard-coded false; the installer does not enable it.

Example:

master.Config.HighResolutionTimer = true;

Network transport​

FrameHighPriority​

public bool FrameHighPriority { get; set; }

Raises the send priority of EtherCAT frames at the OS layer, which cuts queueing delay.

Default: false (off by default)

How each platform does it
  • Windows — process / thread priority boost
  • Linux — SO_PRIORITY=6 socket option (OS socket queueing priority; requires root)

UseUdp​

public bool UseUdp { get; set; }

UDP frame mode (ETG.1500 5.3.7). When enabled, EtherCAT datagrams no longer use raw Ethernet frames (EtherType 0x88A4) but are carried inside UDP/IP packets (UDP port 34980).

Gateway / EAP devices only — standard slaves are not supported

The ESC (EtherCAT Slave Controller) chip on a standard EtherCAT slave works at the data link layer and recognises only raw Ethernet frames with EtherType=0x88A4. Frames wrapped in UDP/IP are invisible to those slaves.

Only for:

  • EtherCAT gateways or bridge devices that support the UDP protocol
  • Communicating with EtherCAT Automation Protocol (EAP) devices

Not for: direct connection to standard EtherCAT slaves (EK1100, EL7041, servo drives, and so on)

IsUdpAvailable​

public bool IsUdpAvailable { get; }

Whether the UDP socket was created successfully during system initialization. Only when this property returns true can you switch to UDP mode with UseUdp.

In some restricted environments (missing network permissions, a blocking firewall, and so on) the UDP socket may fail to be created; IsUdpAvailable then returns false and setting UseUdp = true has no effect.

Example:

if (master.Config.IsUdpAvailable)
{
master.Config.UseUdp = true; // switch to UDP mode
}

VlanId​

public ushort VlanId { get; set; }

VLAN ID (IEEE 802.1Q, ETG1000_4 table 9, ETG.1500 optional feature). Range 0-4095; 0 disables the VLAN tag.

With a non-zero value, every EtherCAT frame carries a 4-byte 802.1Q VLAN tag and the frame header grows from the standard 14 bytes to 18 bytes.

Set the VLAN before entering SafeOp (after a successful Build, before SetState(OP)).

Real-time runtime mode only

The VLAN tag feature takes effect only when real-time runtime is configured. Raw frames go out directly, and the VLAN tag is preserved along the cable.

VlanPriority​

public byte VlanPriority { get; set; }

VLAN priority (PCP — Priority Code Point, IEEE 802.1Q, ETG.1500 optional feature). Range 0-7, 7 is the highest. It is encoded in the top 3 bits of the TCI field of the VLAN tag.

The property only means anything once VlanId is set to a non-zero value and the master runs in real-time runtime mode. On QoS-capable switches, frames with a higher PCP are forwarded first.

Typical VLAN uses:

  • Converged IT/OT networks — isolate industrial control traffic from office traffic with VLANs
  • TSN (Time-Sensitive Networking) — IEEE 802.1Q priority tags drive QoS scheduling
  • Multiple network segments — one physical network carries several EtherCAT segments

Example:

// Set the VLAN after Build() succeeds (real-time runtime mode is required)
var master = new DarraEtherCAT()
.SetENI(@"config.deni")
.Build()
.Master;
if (master == null) return;

// Configure the VLAN before entering SafeOp
master.Config.VlanId = 100;
master.Config.VlanPriority = 6; // high priority

PDO configuration​

OverlappingGroups​

public bool OverlappingGroups { get; set; }

PDO overlap mode switch. When enabled, each slave's outputs and inputs share one logical address range (the larger of the two sizes); an LRW command writes the outputs on the way out, and on the way back the ESC replaces the same positions with input data, which keeps frames smaller.

Default: false (off by default)

note

Can be set only in INIT or PRE_OP state, because the memory layout is fixed when the master enters SAFE_OP.

No effect on the application layer

Overlap happens only at the frame's logical address level. CopyInputPdo / WriteOutputPdo still copy whole frames per their own mapping lengths, and slave.Ibytes / slave.Obytes do not change.

TI ESC

Slaves built on a TI (Texas Instruments) EtherCAT Slave Controller must enable overlap mode, otherwise the LRW command does not work correctly. Do not enable it for standard Beckhoff or third-party slaves: some of them do not support overlapping FMMU logical addresses and will refuse the SAFE_OP transition.

Frame optimization requests in a configuration file​

Overlapping groups switch to a different frame layout from the default one. A request stored in a configuration file is therefore not adopted silently: loading the configuration only records it as a request, and the effective switch OverlappingGroups stays false.

The feature is enabled only after you tick the box explicitly in the GUI and agree in the confirmation dialog; loading a configuration programmatically does not bypass that step.

PackedMode​

public bool PackedMode { get; set; }

Packed PDO mapping switch. When enabled, PDO variables are packed bit by bit with no forced byte alignment.

Default: false (disabled by default, byte-aligned mode)

note

Can be set only in INIT or PRE_OP state, because the memory layout is fixed when the master enters SAFE_OP.

When to use it

For bit-level IO modules (digital IO terminals such as Beckhoff EL1008/EL2008), whose PDO data is a single bit each. PackedMode packs several bit-level IOs tightly into contiguous memory and saves IOmap space.

Example:

master.Config.PackedMode = true;  // enable tight bit packing

FilterThreshold​

public uint FilterThreshold { get; set; }

Consecutive PDO frame loss threshold, default 3.

The master checks on every PDO cycle whether the frame came back normally. A single lost frame counts as occasional interference and is only tallied; the PDOFrameLoss callback fires only when the consecutive loss count reaches this threshold, so occasional losses do not raise a flood of alarms.

Example:

master.Config.FilterThreshold = 8;  // fire the callback only after 8 consecutive lost frames
Grouping

PDO configuration works together with slave grouping. Each group has its own cycle divider and frame loss tracking, so losses in a high-rate group and in a low-rate group do not affect each other.

Scan configuration​

ScanRevisionMatch​

public ScanRevisionMatchMode ScanRevisionMatch { get; set; }

Revision matching policy for the network scan. It sets how strictly the revision numbers of the slaves found during Build() must match those in the DENI configuration.

Default: ScanRevisionMatchMode.IgnoreRevision

Related type:

public enum ScanRevisionMatchMode
{
Exact, // exact match on VendorID + ProductID + RevisionID
CompatibleHigher, // compatible match: scanned RevisionID >= configured RevisionID
IgnoreRevision // ignore RevisionID, match VendorID + ProductID only (default)
}

Example:

master.Config.ScanRevisionMatch = ScanRevisionMatchMode.CompatibleHigher;

DC configuration​

DriftCompensation​

public bool DriftCompensation { get; set; }

DC drift compensation switch. When enabled, the master periodically measures the DC system time deviation and writes a compensation value (0x0920).

Default: false

note

You can also enable it with master.EnableDriftCompensation(bool enable, int thresholdNs, int gain), which additionally lets you set the threshold and the gain.

Frame repeat​

FrameRepeatCount​

public byte FrameRepeatCount { get; set; }

Frame repeat mechanism (ETG.1500 5.4.3). It sets, globally, how many times the same PDO frame is sent per cycle, and applies automatically to the groups that qualify.

Default: 1 (disabled), range 1-3

This is a master-level global setting; at runtime it is filtered per group — only groups in which every slave declares FrameRepeatSupport=1 in its ESI repeat frames. Group eligibility is computed during IO mapping:

  • every slave in the group supports it → the group repeats frames
  • any slave in the group does not → the group skips frame repeat
Why a global setting filtered by group?

ETG.1500 defines frame repeat as a master-level capability with one repeat count for the whole master. EtherCAT PDO frames are sent as LRW broadcasts, so a single frame cannot treat individual slaves differently; "all or nothing" per group is the only compliant approach. There is no need to set a different repeat count for each group.

DENI configuration migration

This parameter and each slave's FrameRepeatSupport flag are both part of the DENI configuration file. After you export the DENI and load it into another master, the frame repeat eligibility of each group is computed correctly without the ESI files.

Example:

// Global setting: for every qualifying group, send the same PDO frame 2 times per cycle
master.Config.FrameRepeatCount = 2;

Mutex protection​

MutexProtection​

public bool MutexProtection { get; set; }

Mutex protection switch. It controls whether PDO reads and writes lock automatically for thread safety.

  • Enabled (default) — the framework locks automatically and guarantees thread safety
  • Disabled — automatic mutex locking is off; you manage thread safety yourself, which cuts lock contention overhead

Default: true

Take care

With mutex protection disabled, you must keep PDO data thread-safe yourself. This suits scenarios with very tight latency requirements where you can manage concurrency on your own.

Adaptive timeout​

AdaptiveTimeoutEnabled​

public bool AdaptiveTimeoutEnabled { get; set; }

Adaptive timeout switch. When enabled, the system samples the network round-trip time (RTT) automatically and computes the optimal PDO timeout instead of using the fixed default.

Default: true (enabled by default)

  • Enabled (default) — samples RTT and computes the timeout dynamically, which noticeably reduces timeout-related frame loss
  • Off — uses the fixed default timeout
Why it is on by default

On most networks a fixed timeout is far larger than the real RTT, so an occasional lost frame waits too long and eats into the following cycles. Adaptive timeout measures the real network latency and keeps a safety margin, which noticeably reduces timeout frame loss and the cascading losses it triggers.

State transition timeouts​

TimeoutInitToPreOp​

public int TimeoutInitToPreOp { get; set; }

INIT→PREOP state transition timeout, in milliseconds (ms).

Default: 3000 (same as the SDK default). Write 0 to use the SDK default.

Set a non-zero value to override the default. This suits slaves that need longer initialization (devices with slow firmware loading or EEPROM reads, for example).

Example:

master.Config.TimeoutInitToPreOp = 5000;  // 5 s timeout

TimeoutPreOpToSafeOp​

public int TimeoutPreOpToSafeOp { get; set; }

PREOP→SAFEOP state transition timeout, in milliseconds (ms).

Default: 10000 (same as the SDK default). Write 0 to use the SDK default.

This phase covers SM/FMMU configuration and PDO mapping and usually takes the longest. Raise the timeout when there are many slaves or the PDO configuration is complex.

Example:

master.Config.TimeoutPreOpToSafeOp = 15000;  // 15 s timeout

TimeoutSafeOpToOp​

public int TimeoutSafeOpToOp { get; set; }

SAFEOP→OP state transition timeout, in milliseconds (ms).

Default: 10000 (same as the SDK default). Write 0 to use the SDK default.

Example:

master.Config.TimeoutSafeOpToOp = 12000;  // 12 s timeout
When to change the timeouts
  • Many slaves — large networks (>50 slaves) may need a larger PreOp→SafeOp timeout
  • Special slaves — some servo drives or safety devices initialize slowly
  • During commissioning — raise the timeout so you can observe problems during the transition
  • Value 0 — use the SDK default timeout, with no per-field time limit

Watchdog​

PdiWatchdogMs​

public int PdiWatchdogMs { get; set; }

PDI (Process Data Interface) watchdog timeout, in milliseconds (ms).

The PDI watchdog monitors how the slave's local application (microcontroller firmware) accesses the ESC. If the slave firmware does not touch the PDI interface within the given time, the ESC raises a watchdog error, which means the slave application may have crashed.

Default: 0 (use the default in the slave EEPROM/ESI)

Example:

master.Config.PdiWatchdogMs = 100;  // PDI watchdog 100ms
note

The PDI watchdog and the process data watchdog are two independent monitoring mechanisms. The PDI watchdog watches the firmware inside the slave; the process data watchdog watches communication from the master.

ProcessDataWatchdogMs​

public uint ProcessDataWatchdogMs { get; set; }

Process data watchdog timeout, in milliseconds (ms).

The process data watchdog monitors PDO communication from the master to the slave. If the slave receives no valid process data frame within the given time, it may drop from OP to SafeOp by itself.

Default: 100 (same as the SDK default, range 0-6553). Write 0 to use the default in the slave EEPROM/ESI.

Example:

master.Config.ProcessDataWatchdogMs = 200;  // process data watchdog 200ms
Recommended values

Set the process data watchdog timeout to several times the PDO cycle (LoopCycle) so that normal operation does not trip it. 10-100 times the PDO cycle is a good range. With LoopCycle=1ms, for example, set the watchdog to 100-200ms.

Atomic IOmap writes​

During multi-axis interpolated motion, the target positions of several slaves must take effect in the same PDO cycle. The SDK manages the IOmap lock through MutexProtection; you do not lock by hand.

Two thread-safety modes:

  • Automatic mutex — MutexProtection = true (default): the general case; the SDK locks on every PDO read and write, guaranteeing thread safety and batch atomicity
  • Lock-free — MutexProtection = false: you guarantee single-threaded writes or external synchronization yourself, which cuts lock contention overhead
Multi-axis interpolation

For multi-axis interpolated motion, keep the default MutexProtection = true and write each axis target position one after another inside the same ProcessDataCyclicSync callback — those writes are committed together in the same PDO frame. The callback itself runs in the SDK's PDO thread context, so no extra locking is needed.

This is an atomic IOmap write example, not a complete motion recipe

Real motion also has to go through the CiA 402 state machine; miss one item and the axis stutters:

  • Enable first: 0x06 → 0x07 → 0x0F; it is OperationEnabled only when (statusWord & 0x6F) == 0x27. Do not send motion targets before enabling completes.
  • Target = actual while not enabled: on the non-enabled branch write 0x0006 and write each axis target position back to its actual position (0x6064), so the axis does not jump from 0 to the target at power-up.
  • Fault reset: send 0x80 (bit7 rising edge) in the OP process data; when the SDK splits it into two phases, do it as 0x0006 → 0x0086 over two cycles — do not Sleep inside the callback.
  • CSP does not write 0x001F: bit4 is the PP/HM NewSetpoint; CSP is always 0x000F and updates the target through 0x607A only.
  • Write all axes in the same callback: finish every axis target within the same tick to keep interpolation synchronised.
  • A whole-frame write drops fields: WriteOutputPdo commits a whole frame, and bytes you did not assign are written as 0. A control word that is not in the struct is cleared to 0 (= Disable Voltage) and the motor drops enable immediately. Either make the struct cover the whole RxPDO segment, or use slave.PDO.OutputsMapping<T>() to change fields only.

Example (batch write for multi-axis interpolation):

// Keep the default MutexProtection = true; the SDK manages the IOmap lock

byte[] frame1 = new byte[slave1.OutputsByteCount];
byte[] frame2 = new byte[slave2.OutputsByteCount];
byte[] frame3 = new byte[slave3.OutputsByteCount];

master.Events.ProcessDataCyclicSync += (mi) =>
{
var out1 = new ServoOutput { TargetPosition = targetPos1 };
var out2 = new ServoOutput { TargetPosition = targetPos2 };
var out3 = new ServoOutput { TargetPosition = targetPos3 };
MemoryMarshal.Write(frame1, ref out1);
MemoryMarshal.Write(frame2, ref out2);
MemoryMarshal.Write(frame3, ref out3);
slave1.WriteOutputPdo(frame1, out _, out _);
slave2.WriteOutputPdo(frame2, out _, out _);
slave3.WriteOutputPdo(frame3, out _, out _);
};

Configuration application state​

IsConfigurationApplied​

public bool IsConfigurationApplied { get; }

Whether the configuration has been applied in full — all four kinds of action (ESI matching, PDO / SyncManager / startup parameters / DC arming) are finished, with no pending automatic configuration and no slave configuration errors.

Return value:

  • bool — true = the configuration is fully applied; false = not initialized yet, automatic configuration still pending, or a slave configuration error present

Build() applies the full configuration once before it returns, so on the normal path this is true after Build() returns. When you read false, do not enter OP straight away: look at the per-slave details and the log from VerifyStartupConfiguration first, and find out which slave and which item did not take.

Example:

var master = new DarraEtherCAT().SetENI("config.deni").Build().Master;
if (master == null) return;

if (!master.IsConfigurationApplied)
{
Console.WriteLine("配置尚未全部应用,先查逐站校验明细"); // The configuration is not fully applied yet; check the per-slave verification details first
return;
}

Startup parameters​

A startup parameter (StartupParameter) describes one write sent to a slave before or after a given state transition. SDO writes are addressed by Index / SubIndex; register writes are addressed by RegisterAddress. The whole batch runs in priority order on the state transition. Reach the collection through slave.Startup.

Phase​

public int Phase { get; set; }

The write phase as a number, kept for compatibility with existing callers. The domain matches ToPhase() exactly: 0 = Init→PreOp (IP), 1 = PreOp→SafeOp (PS), 2 = SafeOp→OP (SO), 4 = OP→SafeOp (OS), 5 = SafeOp→PreOp (SP), 6 = PreOp→Init (PI).

Default: 0 (Init→PreOp)

Assigning back the value returned by ToPhase() and reading it out again is an identity, so the round trip is reversible. 3 has no corresponding state transition, and 4 / 5 / 6 are no longer silently rewritten into another transition either — an illegal value throws ArgumentOutOfRangeException, so the mismatch surfaces at configuration time instead of when the state machine runs. If WriteTiming has never been set manually, assigning this property also updates the write timing to the default timing of that phase.

New code should use TransitionEnum

The number exists only for compatibility with existing callers. New code expresses the phase with TransitionEnum / Transition, which reads directly and cannot drift out of step with the number table.

WriteTiming​

public StartupWriteTiming WriteTiming { get; set; }

Write timing: whether the write goes out before this entry's state transition or after it completes.

Default: derived automatically from the state transition — Init→PreOp, OP→SafeOp and SafeOp→PreOp use AfterTransition; PreOp→SafeOp, SafeOp→OP and PreOp→Init use BeforeTransition. Setting it with Transition = "OP" (run after entering OP) defaults to AfterTransition.

Once you assign this property explicitly, the entry carries a manual-timing flag (IsWriteTimingManuallySet becomes true), and changing TransitionEnum / Transition / Phase afterwards no longer overwrites it with the default.

Related type:

public enum StartupWriteTiming
{
BeforeTransition = 0, // Sent before the state transition
AfterTransition = 1 // Sent after the state transition completes
}

Example:

var p = new StartupParameter { Index = 0x1C12, SubIndex = 0, Data = new byte[] { 0 } };
p.TransitionEnum = StartupTransition.PS; // It then defaults to BeforeTransition
p.WriteTiming = StartupWriteTiming.AfterTransition; // Explicit override; it no longer follows the transition default from here on

IsWriteTimingManuallySet​

public bool IsWriteTimingManuallySet { get; }

Whether the write timing has been set by hand. true = this entry's WriteTiming is a value the caller assigned explicitly, so it does not follow a change of state transition; false = it still follows the default timing of the transition.

Return value:

  • bool — true = the timing is fixed manually; false = it follows the default

Its main use is import and export: only entries that are true need their timing written into the configuration as-is, which avoids freezing a derived default into an explicit value.

Example:

if (!p.IsWriteTimingManuallySet)
Console.WriteLine($"时机未固定,当前跟随 {p.TransitionEnum} 的默认值 {p.WriteTiming}"); // Timing is not pinned; currently following the default of {p.TransitionEnum}, {p.WriteTiming}

IsRegisterWrite​

public bool IsRegisterWrite { get; set; }

The write target of this entry is a register rather than an SDO object. When true, RegisterAddress locates the target register and Data is the register data; the startup parameter collection sends the whole batch on the state transition.

Default: false (an ordinary SDO write, addressed by Index / SubIndex)

Register writes do not go through a single Apply

StartupParameter.Apply(slave) covers the SDO read/write path only. A register write has no immediate path, so Apply() returns false for such an entry and logs a warning (it does not report success falsely); the write is carried out by the whole batch on the state transition. To confirm that a register write took effect, read the register back from the slave or check the state transition log; do not judge by the return value of Apply().

RegisterAddress​

public ushort RegisterAddress { get; set; }

Target address of a register write; meaningful only when IsRegisterWrite = true. On DENI export it is written as the address property of the RegisterWrites section, and read back from the same field on import; when the address is missing or fails to parse it stays 0.

Default: 0

Example:

var reg = new StartupParameter
{
IsRegisterWrite = true,
RegisterAddress = 0x0120,
Data = new byte[] { 0x00 },
TransitionEnum = StartupTransition.PS
};

RegisterType​

public string RegisterType { get; set; }

Type identifier of a register write (free text, for example a register category name); meaningful only when IsRegisterWrite = true. It is written into the RegisterWrites section of the DENI together with RegisterAddress, for read-back and UI descriptions; it is an identifier only and takes no part in the actual write path.

Default: empty string

StartupParameterList.GetEnumerator()​

public IEnumerator<StartupParameter> GetEnumerator()

Enumerates every startup parameter in slave.Startup. What you get is a snapshot taken at the moment of the call: the entry list is copied before the enumerator is returned, so adding or removing entries from another thread during the walk does not throw Collection was modified. The flip side is that you enumerate the entries as they were when you took the enumerator; entries added or removed afterwards do not appear in this pass.

Return value:

  • IEnumerator<StartupParameter> — enumerator over the startup parameters; the order is the collection's internal order (priority is handled when the batch is sent, not through enumeration order)

Example:

foreach (var p in slave.Startup)
Console.WriteLine($"0x{p.Index:X4}:{p.SubIndex:X2} {p.Transition} {p.WriteTiming} 优先级={p.Priority}"); // 0x{p.Index:X4}:{p.SubIndex:X2} {p.Transition} {p.WriteTiming} priority={p.Priority}

State transition tokens​

StartupTransition has four representations: the enum, a two-letter token, a readable description and a number. The three extension methods below convert between them; logging, serialization and UI display all go through them, so do not build the strings yourself.

StartupTransitionExtensions.ToTransitionString(StartupTransition transition)​

public static string ToTransitionString(this StartupTransition transition)

Turns a state transition into the two-letter token defined by ETG, for logging and serialization. Only the 6 valid transitions are produced: IP / PS / SO / OS / SP / PI. An enum value outside the table returns IP.

Parameters:

  • transition (StartupTransition) — the state transition

Return value:

  • string — the two-letter transition token

Example:

string token = StartupTransition.SO.ToTransitionString();   // "SO"

StartupTransitionExtensions.GetDescription(StartupTransition transition)​

public static string GetDescription(this StartupTransition transition)

Turns a state transition into a readable description of the form I>P (Init→PreOp) that you can put straight into a UI or a log. An enum value outside the table returns the name of the enum member itself.

Parameters:

  • transition (StartupTransition) — the state transition

Return value:

  • string — the readable description

Example:

Console.WriteLine(StartupTransition.PS.GetDescription());   // P>S (PreOp→SafeOp)

StartupTransitionExtensions.ToPhase(StartupTransition transition)​

public static int ToPhase(this StartupTransition transition)

Returns the number for a state transition (for compatibility with older code): IP = 0, PS = 1, SO = 2, OS = 4, SP = 5, PI = 6. The domain is exactly that of StartupParameter.Phase, and the two convert back and forth. An enum value outside the table returns 0.

Parameters:

  • transition (StartupTransition) — the state transition

Return value:

  • int — the phase number

Example:

int phase = StartupTransition.OS.ToPhase();   // 4

Startup configuration verification details​

In the result of VerifyStartupConfiguration(...), each item of SlaveDetails is a SlaveDetail: one row per slave, comparing the identity the configuration expects with the identity the scan actually found, item by item. Each match flag comes with an expected value / actual value pair, so a UI or a log can show the difference directly.

CategoryPropertyTypeAccessDescription
Basic informationSlaveNamestringRead-onlyName of the slave the scan found; an empty string when it cannot be read
Overall resultIsMatchboolRead-onlyWhether the slave matches as a whole: identity, alias and topology must all pass. In non-strict mode the revision number and the serial number always pass
Identity matchVendorIdMatchboolRead-onlyWhether the manufacturer ID matches (always part of the check)
ProductCodeMatchboolRead-onlyWhether the product code matches (always part of the check)
RevisionNoMatchboolRead-onlyWhether the revision number matches; not compared in non-strict mode, where it is always true
SerialNoMatchboolRead-onlyWhether the serial number matches; not compared in non-strict mode or when the configuration carries no serial number (0), where it is always true
Alias and topologyExpectedAliasAddrushortRead-onlyAlias address the configuration expects for this slave (0 = no alias configured, not compared)
ActualAliasAddrushortRead-onlyAlias address the scan actually found
AliasMatchboolRead-onlyWhether the alias address matches; always true when the configuration carries no alias (0)
TopologyMatchboolRead-onlyWhether the active ports match the topology recorded in the configuration; always true when the configuration holds no topology information

Example:

var result = master.VerifyStartupConfiguration(strictMode: true);
foreach (var d in result.SlaveDetails)
{
if (d.IsMatch) continue;
Console.WriteLine($"从站 {d.SlaveName}: 别名 {d.ExpectedAliasAddr}→{d.ActualAliasAddr} " + // Slave {d.SlaveName}: alias {d.ExpectedAliasAddr}→{d.ActualAliasAddr}
$"Vendor={d.VendorIdMatch} Product={d.ProductCodeMatch} " +
$"Revision={d.RevisionNoMatch} Serial={d.SerialNoMatch} 拓扑={d.TopologyMatch}"); // Revision={d.RevisionNoMatch} Serial={d.SerialNoMatch} topology={d.TopologyMatch}
}

Timeout configuration best practices​

EtherCAT communication involves several timeout fields that are independent of one another; they directly affect how sensitively network faults are detected and how long recovery takes. The table below sums up the common fields, their typical defaults and recommended ranges. For a real deployment, balance network length / interference level / real-time priority.

FieldUnitDefaultRecommended rangeEffect
LoopCyclens1,000,000 (1ms)125,000 ~ 4,000,000 (125 µs ~ 4ms)PDO cycle; sets the refresh rate and the CPU load
TimeoutInitToPreOpms30003000 ~ 10000INIT→PREOP wait (slow slaves / EEPROM loading)
TimeoutPreOpToSafeOpms1000010000 ~ 30000PREOP→SAFEOP wait (includes SM/FMMU/PDO mapping; increase it for large networks)
TimeoutSafeOpToOpms1000010000 ~ 15000SAFEOP→OP wait
ProcessDataWatchdogMsms100 (write 0 = slave default)LoopCycle × 10 ~ 100Time for a slave to fall back to SafeOp after losing the master
PdiWatchdogMsms0 (slave default)0 ~ 200Detection window for the slave's local firmware stopping its ESC access

Mailbox timeouts have two layers: MailboxTimeout in the slave ESI (100ms for requests / 2000ms for responses by default, loaded with the DENI configuration) sets the per-slave mailbox timing; SDK mailbox transactions (master.Config.MailboxConfig) have their own unified timeout TimeoutMs (5000ms by default) and retry count RetryCount (3 by default), and failures are resent up to the retry count.

When to increase or decrease​

Increase them when:

  • Long cables / across cabinets / across the shop floor — physical transmission delay is large, and occasional RTT jitter needs headroom
  • High EMI / welding / near large VFDs — noise causes occasional frame loss, so retries need more room
  • Across VLANs / TSN converged networks — passing through switches adds queueing jitter
  • Large networks (>50 slaves) — TimeoutPreOpToSafeOp must be increased, otherwise the SafeOp transition fails
  • Slow slaves (large FoE downloads / EEPROM writes) — stretch both the mailbox and the Init→PreOp timeouts

Decrease them when:

  • Fast fault detection comes first — for industrial emergency-stop scenarios, set the watchdog to 5×LoopCycle so frame loss is detected within 50ms
  • Desktop with short cables / lab — RTT is very low, so the watchdog can go down to 20~50ms
  • Tight RT (cycle ≤ 250 µs) — the whole timing budget is compact, so every timeout must be short

Four presets: default, lab, industrial, high EMI​

// (1) SDK defaults — for standard short cables + desktop ~ ordinary workshop
master.Config.LoopCycle = 1_000_000; // 1ms
master.Config.TimeoutPreOpToSafeOp = 10000; // default value; may be left unset
master.Config.ProcessDataWatchdogMs = 100; // default value; 0 = slave default

// (2) Lab high speed — short cable + tight RT
master.Config.LoopCycle = 250_000; // 250 µs
master.Config.TimeoutPreOpToSafeOp = 5000;
master.Config.ProcessDataWatchdogMs = 20; // very fast detection

// (3) Typical industrial — long cable + large network
master.Config.LoopCycle = 1_000_000;
master.Config.TimeoutPreOpToSafeOp = 20000; // relaxed for large networks
master.Config.ProcessDataWatchdogMs = 200;

// (4) High EMI / welding site — tolerate occasional frame loss
master.Config.LoopCycle = 2_000_000; // 2ms
master.Config.TimeoutPreOpToSafeOp = 30000;
master.Config.ProcessDataWatchdogMs = 500;
master.Config.AdaptiveTimeoutEnabled = true; // absorb jitter automatically
Side effects
  • Timeout too large — real faults are reported only after the timeout expires, so application alarms / safe stops are delayed
  • Timeout too small — occasional jitter is misread as a fault, and PDOFrameLoss / StateChanged nuisance alarms fire frequently
  • Watchdog < several × LoopCycle — it trips during normal operation and slaves repeatedly fall back to SafeOp
  • After any change, run a 24h communication stress test before going live
Together with adaptive timeout

With AdaptiveTimeoutEnabled on (the default), the SDK computes the single-frame PDO timeout from the real RTT, so you do not have to tighten LoopCycle by hand. The watchdog / state transition fields above still need to be configured per scenario.