サイト内検索

検索

Shares

Table of Content

EthercatDevice.getRevisionNumber()

[Ethercat Device]

説明

EtherCATスレーブデバイスのリビジョン番号を取得します。

構文

uint32_t getRevisionNumber();

媒介変数

なし

戻り値

EtherCATスレーブのリビジョン番号を返します。エラーが生じた場合、 UINT32_MAXを返します。 (232 – 1).

備考

この関数は、 EthercatMaster::begin()が正常に実行された後に呼び出す必要があります。この関数はブロッキングされていないため、循環コールバック内で呼び出すことができます。

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_Generic slave;

void setup() {
  Serial.begin(115200);

  master.begin();
  slave.attach(0, master);

  Serial.println(slave.getRevisionNumber());
}

void loop() {
  // put your main code here, to run repeatedly:

}

詳細は EtherCAT Library User Manual QEC EtherCAT命令とAPI使用法参照

上部へスクロール