I want to find...

Search

Shares

Table of Content

EthercatDevice_Dmp.getSystemPowerCurrent()

[EthercatDevice_Dmp]

Description

Get the system current.

Syntax

double getSystemPowerCurrent();

Parameters

None.

Return Value

Return the system current. If the return value is less than 0, it indicates an error code.

Comment

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 tryToGetSystemPowerCurrent(), and it can be called within callback functions.

Example Code

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11DT0H slave;

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

  Serial.print("System Current: ");
  Serial.println(slave.getSystemPowerCurrent());
}

void loop() {
  // ...
}

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

Leave a Comment

Scroll to Top