サイト内検索

検索

Shares

Table of Content

EthercatDevice_DmpHID.lcmPrint()

[EthercatDevice_DmpHID_Generic]

説明

指定された文字列をEtherCATスレーブデバイスのLCM画面に出力します。

派生クラス:

クラス名製造者ID製品コードUARTKeypadLCMMPG
EthercatDevice_QECR11HU9S0x00000bc30x0086d402OOOO
EthercatDevice_QECR00HU9S0x00000bc30x0086d401OOOO

構文

int lcmPrint(const char *fmt, ...);

媒介変数

  • [in] const char *fmt
    LCM 画面に出力される文字列。これは、出力のフォーマット仕様を含む NULLで終了する文字列へのポインタです。フォーマット文字列はCのprintf 関数と同じフォーマットに従い、変数やフォーマット・オプションを挿入できます。
  • [in] ...
    これは、fmt文字列の書式指定子に従ってフォーマットされた文字列に挿入される可変個引数です。

戻り値

LCM画面に出力される文字数を返します。戻り値が0より小さい場合、 error codeを示します。.

備考

この関数は、 EthercatMaster::begin()が正常に実行された後に呼び出す必要があります。この関数はブロッキングされていないため、循環コールバック内で呼び出すことができます。

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11HU9S slave;

void CyclicCallback() {
  slave.update();
}

void setup() {
  master.begin();
  slave.attach(0, master);
  master.attachCyclicCallback(CyclicCallback);
  master.start();

  slave.lcmPrint("Hello world!");
}

void loop() {
  // ...
}

Please see EthercatDevice_DmpHID_Generic Class for more QEC HID slave instructions and API usage.

上部へスクロール