我想找...

搜尋

分享

目錄

EthercatDevice_Dmp.getSystemPowerVoltage()

[EthercatDevice_Dmp]

描述

Get the system voltage.

語法

double getSystemPowerVoltage();

參數

回傳值

Return the system voltage. If the return value is less than 0, it indicates an 錯誤代碼.

備註

This function must be called after a successful execution of EthercatMaster::begin(). This function can be either blocking or non-blocking. If it is blocking, it should not be called within callback functions. If it is non-blocking, it must be used in conjunction with tryToGetSystemPowerVoltage(), and it can be called within callback functions.

範例程式碼

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11DT0H slave;

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

  Serial.print("System Voltage: ");
  Serial.println(slave.getSystemPowerVoltage());
}
void loop() {
  // ...
}

Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.

返回頂端