説明
Get the current CiA 402 state.
Relevant Objects
- Object 6041h: Statusword
構文
int getCiA402State();
媒介変数
なし
戻り値
Return the current CiA 402 state:
| 定義 | コード | State |
| CIA402_NOT_READY_TO_SWITCH_ON | 0 | Not ready to switch on. |
| CIA402_SWITCH_ON_DISABLED | 1 | Switch on disabled. |
| CIA402_READY_TO_SWITCH_ON | 2 | Ready to switch on. |
| CIA402_SWITCHED_ON | 3 | Switched on. |
| CIA402_OPERATION_ENABLED | 4 | Operation enabled. |
| CIA402_FAULT | 5 | Fault. |
| CIA402_FAULT_REACTION_ACTIVE | 6 | Fault reaction active. |
| CIA402_QUICK_STOP_ACTIVE | 7 | Quick stop active. |
戻り値が0未満の場合、 error codeを示します。.
備考
この関数は、 EthercatMaster::start(). This function is non-blocking and can be called in callback functions.
例
#include "Ethercat.h"
EthercatMaster master;
EthercatDevice_CiA402 motor;
void setup()
{ Serial.begin(115200);
while (!Serial);
master.begin();
motor.attach(0, master);
master.start();
}
void loop() {
Serial.print("CiA402 State: ");
Serial.println(motor.getCiA402State());
delay(1000);
}詳細は EtherCAT CiA 402 User Manual QEC EtherCAT命令とAPI使用法参照