[EthercatDevice_DmpStepper_Generic]
説明
EtherCATスレーブデバイス上の指定された識別子を持つ指定されたモーターの EthercatDevice_CiA402 オブジェクトを初期化し、初期化された EthercatDevice_CiA402 オブジェクトへのポインタを返します。
派生クラス:
クラス名 | 製造者ID | 製品コード |
EthercatDevice_QECR11MP3S | 0x00000bc3 | 0x0086d0d6 |
EthercatDevice_QECR00MP3S | 0x00000bc3 | 0x0086d0d9 |
構文
EthercatDevice_CiA402 *cia402GetServo(int motor, EthercatDevice_CiA402 *servo = NULL);
媒介変数
[in] int motor
EtherCATスレーブデバイス上の指定されたモーター番号:- 1: Motor 1.
- 2: Motor 2.
- 3: Motor 3.
[in] EthercatDevice_CiA402 *servo
ユーザーが宣言したEthercatDevice_CiA402クラスのオブジェクトへのポインタ。この変数が NULL の場合、ライブラリからEthercatDevice_CiA402クラスのオブジェクトで初期化し、そのオブジェクトへのポインタを返します。それ以外の場合は、ユーザーが提供したEthercatDevice_CiA402クラスのオブジェクトへのポインタで初期化し、そのポインタを返します。
戻り値
EthercatDevice_CiA402クラスのオブジェクト・ポインタを返します。
備考
この関数は、EthercatMaster::begin()
が正常に実行された後で、呼び出す必要があります。この関数はEtherCATスレーブデバイスのCiA402でのみ動作します。詳細については、configDeviceMode()
を参照ください。
注:コールバック関数内での呼び出しは禁止されています。
例
#include "Ethercat.h" EthercatMaster master; EthercatDevice_QECR11MP3S slave; EthercatDevice_CiA402 motor1; EthercatDevice_CiA402 motor2; EthercatDevice_CiA402 *pMotor[3]; void setup() { master.begin(); slave.attach(0, master); pMotor[0] = slave.cia402GetServo(1, &motor1); pMotor[1] = slave.cia402GetServo(2, &motor2); pMotor[2] = slave.cia402GetServo(3); } void loop() { // ... }
Please see EthercatDevice_DmpStepper_Generic Class for more QEC Stepper Drivers instructions and API usage.