[EthercatDevice_DmpAIQ_Generic]
説明
EtherCATスレーブデバイスのアナログ入力ピンから値を読みます。
派生クラス:
クラス名 | 製造者ID | 製品コード | Input Channels | Output Channels |
EthercatDevice_QECR11A44S | 0x00000bc3 | 0x0086d880 | 4 | 4 |
構文
int analogRead(int ch);
媒介変数
[in] int ch
EtherCATスレーブデバイス上の指定されたアナログ入力チャネル。
戻り値
アナログ入力値として、-231 から231 の範囲をもつ32ビットの符号付き整数を返します。その値は、物理的な入力電圧にボルト単位で、0の値は、電圧0V、231 は 64V、そして -231 は -64Vに線形にマッピングされます。
備考
この関数は、 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.analogRead(0)); delay(1000); }
Please see EthercatDevice_DmpAIQ_Generic Class for more QEC AIO slave instructions and API usage.