跳转至

DLLVirtIOGetBinaryOutput

函数 DLLVirtIOGetBinaryOutput 读取控制器虚拟二进制输出字(ushort 数组)。(虚拟 IO 输出表示控制器驱动外部设备的软件输出信号。)

所属:C/C++ API 函数索引

C/C++

ErrorCode DLLVirtIOGetBinaryOutput(INT_PTR hClientHandle, int startWord, unsigned short* outValues, int* inOutCount);

C#

Controller.Variables.VirtualIO.Binary.Outputs.GetMultiple(start, count) — 批量读取虚拟二进制输出。

参数

hClientHandle (INT_PTR)

客户端会话句柄,由 DLLSysConnect 获取。

startWord (int)

起始字索引(0-indexed)。

outValues (unsigned short*)

输出。接收读取的字值数组(每个元素 16 位)。

inOutCount (int*)

输入输出。调用时传入要读取的字数;返回时写入实际读取的字数。

返回值

返回 ErrorCodeNoError (0) 表示成功,正值为错误码,详见 SDK 发布头 ErrorCode.h。

说明

虚拟 IO 输出由控制器程序控制,可驱动继电器、指示灯等外部设备。读取返回当前输出映像值。

示例

unsigned short outputs[2] = {0};
int count = 2;
DLLVirtIOGetBinaryOutput(handle, 0, outputs, &count);

相关函数