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 slave index. This index value is automatically assigned by the KINGSTAR master when the EtherCAT network starts, based on the physical connection order. The first device connected directly to the master is assigned Index 0, followed by Index 1, Index 2, and so on. These indexes remain consistent within the slave array even if devices are added, removed, or reconnected. Please refer to the use cases in HotConnect, Repair, and Restart 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