サイト内検索

検索

Shares

Table of Content

EthercatDevice.sdoUpload8()

[Ethercat Device]

説明

Read 8-bit value from the specified object for such EtherCAT slave device.

構文

uint8_t sdoUpload8(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
    タイムアウト値でマイクロ秒単位。

戻り値

Return the 8-bit value.

備考

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

#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.sdoUpload8(0x6040, 0x00));
  delay(1000);
}

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

上部へスクロール