サイト内検索

検索

Shares

Table of Content

EthercatDevice.sdoDownload64()

[Ethercat Device]

説明

該当するEtherCATスレーブデバイスの指定されたオブジェクトに64ビット値を書き込みます。

構文

int sdoDownload64(uint16_t od_index, uint8_t od_subindex, uint64_t value, uint32_t timeout_us = 100000);

媒介変数

  • [in] uint16_t od_index
    オブジェクトのインデックス。
  • [in] uint8_t od_subindex
    オブジェクトのサブインデックス。
  • [in] uint64_t value
    The 64-bit value to be written to object.
  • [in] uint32_t timeout_us
    タイムアウト値でマイクロ秒単位。

戻り値

error codeを返します。返された値が 0の場合、この関数が正常に完了したことを示します。

備考

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

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_Generic slave;

void setup() {
  master.begin();
  slave.attach(0, master);
  master.start(1000000);
}

void loop() {
  slave.sdoDownload64(0x5000, 0x00, 100000);
  delay(1000);
  slave.sdoDownload64(0x5000, 0x00, 0);
  delay(1000);
}

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

上部へスクロール