Class EtherCatSlave
Represents an EtherCAT slave device and provides methods to interact with it via TwinCAT ADS.
public class EtherCatSlave
- Inheritance
-
EtherCatSlave
- Inherited Members
Constructors
EtherCatSlave(AdsClient, uint)
Initializes a new instance of the EtherCatSlave class, representing an EtherCAT slave device.
public EtherCatSlave(AdsClient client, uint adress)
Parameters
clientAdsClientAn ADS client that is connected to the EtherCAT master.
adressuintThe index of the EtherCAT slave device within the network. Typically starts at 1001.
Properties
CrcError
Allows the CRC error counters of the individual ports (A, D, B and C) of a slave to be read. Equivavalent to the function block FB_EcGetSlaveCrcErrorEx.
public ST_EcCrcErrorEx CrcError { get; }
Property Value
Identity
Can be used to read the CANopen identity of an individual EtherCAT slave device. Equivavalent to the function block FB_EcGetSlaveIdentity.
public ST_EcSlaveIdentity Identity { get; }
Property Value
State
Allows the EtherCAT status and the Link status of an individual EtherCAT slave to be read. Equivavalent to the function block FB_EcGetSlaveState.
public ST_EcSlaveState State { get; }
Property Value
Methods
CoeReadAny<T>(uint, uint)
Read any object from the CoE object dictionary.
public T CoeReadAny<T>(uint index, uint subIndex)
Parameters
Returns
- T
Type Parameters
T
CoeWriteAny(uint, uint, object)
Write any object to the CoE object dictionary.
public void CoeWriteAny(uint index, uint subIndex, object value)
Parameters
RequestState(EcDeviceState)
With this function a slave can be requested to a specified EtherCAT state. Equivavalent to the function block FB_EcReqSlaveState.
public void RequestState(EcDeviceState state)
Parameters
stateEcDeviceState