[EthercatDevice_DmpAIQ_Generic]
説明
EtherCATスレーブデバイス上の指定されたアナログ入力チャネルの電圧値を読みます。
派生クラス:
クラス名 | 製造者ID | 製品コード | Input Channels | Output Channels |
EthercatDevice_QECR11A44S | 0x00000bc3 | 0x0086d880 | 4 | 4 |
構文
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.