SystemState 

Property displaying the current state of the TwinCAT system.

HRESULT SystemState(
  [out,retval] long* pVal,
);

Parameters

pVal

[out, retval]
pVal shows the current state of the TwinCAT system. The currently implemented states are ADSSTATE_RUN (5) and ADSSTATE_STOP (6).

Return Values

HRESULT == S_OK

Reading successful.

HRESULT != S_OK

Error during reading of the status.

Comments

Calling of SystemState returns the current state of the TwinCAT system.