[Ethercat Device]
説明
該当するEtherCATスレーブデバイスの指定されたオブジェクトから32ビット値を読み取ります。
構文
uint32_t sdoUpload32(uint16_t od_index, uint8_t od_subindex, uint32_t timeout_us = 100000);
媒介変数
[in] uint16_t od_index
オブジェクトのインデックス。[in] uint8_t od_subindex
オブジェクトのサブインデックス。[in] uint32_t timeout_us
タイムアウト値でマイクロ秒単位。
戻り値
32ビット値を返します。
備考
この関数は、 が正常に実行された後で呼び出す必要があります。この関数はブロッキングされているため、循環コールバック関数内で呼び出すことができません。
例
#include "Ethercat.h"
EthercatMaster master;
EthercatDevice_Generic slave;
void setup() {
Serial.begin(115200);
master.begin();
slave.attach(0, master);
master.start(1000000);
}
void loop() {
Serial.print("Value: ");
Serial.println(slave.sdoUpload32(0x607A, 0x00));
delay(1000);
}詳細は EtherCAT Library User Manual QEC EtherCAT命令とAPI使用法参照