ReadOutputDWord

從實體或模擬 I/O 模組的輸出讀取一個雙字 (Double Word)。

語法

KsError ReadOutputDWord(
     int Index,
     int ByteOffset,
     DWORD* Value
);

參數

Index:I/O 模組的索引。索引以 0 為起始;別名將影響此參數。

ByteOffset:指定位元組偏移量到一個位置,以讀取 DWORD 值。最大偏移量由 SlaveStatus 結構中的 OutputLength 決定。

Value:將接收所讀取 DWORD 值的指標。

回傳值

若此函式執行成功,會回傳 errNoError,否則會傳回錯誤碼。如需更多有關錯誤碼的資訊,請參閱 KsError 清單。

備註

ReadOutputDWord 僅能在連結建立並開啟時呼叫。

可用的 EtherCAT 狀態

ecatOP

範例

複製
DWORD dwWrite = 0;
nRet = ReadOutputDWord(0, 0, &dwWrite);

使用需求

  RT Win32
最低支援版本 4.0 4.0
標頭檔 ksapi.h ksapi.h
程式庫 KsApi_Rtss.lib KsApi.lib

參見

ReadInputBit

ReadInputByte

ReadInputDWord

ReadInputWord

ReadOutputBit

ReadOutputByte

ReadOutputWord