SoeWriteSsc
Downloads data from the EtherCAT master to a EtherCAT slave through SoE (Servo drive profile over EtherCAT).
Syntax
KsCommandStatus SoeWriteSsc(
int SlaveId,
BYTE DriveNo,
BYTE ElementFlags,
USHORT Idn,
UCHAR* Value,
ULONG Length
);
Parameters
SlaveId: the index of a slave array. When EtherCAT is started, this index has the same value as the SlaveId, which corresponds to the position of the slave in the network. Please note that after EtherCAT is started in the Operational (Op) state, any addition or removal of slaves from the network will change the position of the slaves in the network (SlaveId). Nevertheless, the index of the slave will remain the same. Newly added devices will be added in the back of the slave array. For all slaves after the change, the index and SlaveId will no longer match. This behavior is only available for physical devices; simulated devices are inapplicable. Please refer to the use cases in EnableHotConnect for more details.
DriveNo: the index of a drive.
ElementFlags: which property of an IDN is written.
Idn: the identification number of an object.
Value: the value to be written.
Length: data length.
Return value
Returns the KsCommandStatus structure.
Usable EtherCAT states
ecatPreOp, ecatSafeOp, ecatOp
Example
// SoE element flags:
// Value Description
// 0x01 Data status
// 0x02 Name(read only)
// 0x04 Attribute
// 0x08 Unit
// 0x10 Minimum
// 0x20 Maximum
// 0x40 Value
// 0x80 Default
UCHAR soeWriteData[2] = { 0 };
soeWriteData[0] = 0XDD;
soeWriteData[1] = 0XDD;
WaitForCommand(10, TRUE,
SoeWriteSsc(
0, // Slave Id
1, // Drive Number
0x40, // ElementFlags, 0x40: Value
45, // Idn, S-0-0045: Velocity Data Scaling Factor
soeWriteData,
2
)
);
Requirements
| RT | Win32 | |
|---|---|---|
| Minimum supported version | 4.2 | 4.2 |
| Header | ksapi.h | ksapi.h |
| Library | KsApi_Rtss.lib | KsApi.lib |
See also