SoeReadSsc

Uploads data from an EtherCAT slave to the EtherCAT master through SoE (Servo drive profile over EtherCAT).

Syntax

KsCommandStatus SoeReadSsc(
     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 read.

Idn: the identification number of an object.

Value: the value to be read.

Length: data length.

Return value

Returns the KsCommandStatus structure.

Usable EtherCAT states

ecatPreOp, ecatSafeOp, ecatOp

Example

Copy
// 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 soeReadData[64] = { 0 };
WaitForCommand(10, TRUE,
               SoeReadSsc(
                   0,       // Slave Id
                   1,       // Drive Number
                   0x40,    // ElementFlags, 0x40: Value
                   79,      // Idn, S-0-0079: Rotational Position Resolution
                   soeReadData,
                   64
               )
              );

Requirements

  RT Win32
Minimum supported version 4.2 4.2
Header ksapi.h ksapi.h
Library KsApi_Rtss.lib KsApi.lib

See also

SoeWriteSsc