EthercatDevice_XXX.getSlaveNo()

[EthercatDevice_XXX]

説明

Get EtherCAT Slave Number on the EtherCAT bus.

Format

int getSlaveNo();

Syntax

EthercatDevice_XXX slave;
slave.getSlaveNo();

Returns

Int: the sequential ID of the specified slave.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11DF0S slave;

void setup(void) {
    int getSlaveNo;
    
    Serial.begin(115200);
    while (!Serial);
    
    master.begin();
    slave.attach(0, master);
    master.start();
    getSlaveNo = slave.getSlaveNo();
    Serial.println(getSlaveNo);
}

void loop() {}

Libraries Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

コメントする

上部へスクロール