サイト内検索

検索

Shares

Table of Content

EthercatDevice_DmpAIQ.voltageRead()

[EthercatDevice_DmpAIQ_Generic]

説明

EtherCATスレーブデバイス上の指定されたアナログ入力チャネルの電圧値を読みます。

派生クラス:

クラス名製造者ID製品コードInput ChannelsOutput Channels
EthercatDevice_QECR11A44S0x00000bc30x0086d88044

構文

double voltageRead(int ch);

媒介変数

  • [in] int ch
    EtherCATスレーブデバイス上の指定されたアナログ入力チャネル。

戻り値

ボルト(V)単位で表す電圧値を倍精度で返します。

備考

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

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11A44S slave;

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

void loop() {
  Serial.print("AIO: ");
  Serial.println(slave.voltageRead(0));
  delay(1000);
}

Please see EthercatDevice_DmpAIQ_Generic Class for more QEC AIO slave instructions and API usage.

上部へスクロール