GetStatusEx
Gets the extended state of an EtherCAT link. Use this function to see when the link has been established. After the link is established you can access the number of I/O and servo modules.
Syntax
KsError GetStatusEx(
SubsystemStatusEx* Status,
SubsystemDiagnostics* Diagnostics
);
Parameters
Status: pointer to the SubsystemStatusEx structure that shows the states of the EtherCAT link.
Diagnostics: pointer to the SubsystemDiagnostics structure that shows the diagnostics information of EtherCAT slaves' state.
Return value
If the function succeeds, it returns errNoError
, otherwise an error code. For more information about the error code, see the KsError list.
Usable EtherCAT states
ecatOffline, ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP
Example
SubsystemStatusEx SubsystemEx = { ecatOffline, ecatOffline, 0, 0, 0, 0, 0,
{ecatOffline}, {ecatOffline}, {axisOffline}, {groupDisabled},
{FALSE}, 0LL, {0LL}, {0LL}, {0LL}, {0LL}, {0LL}
};
SubsystemDiagnostics Diagnostics = { 0 };
nRet = GetStatusEx(&SubsystemEx, &Diagnostics);
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.2 | 4.2 |
Header | ksapi.h | ksapi.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also