DLLVirtIOSetRegisterOutput
函数 DLLVirtIOSetRegisterOutput 写入控制器虚拟浮点寄存器输出。(立即更新寄存器输出映像,可驱动需要模拟量输入的外部设备。)
C/C++
ErrorCode DLLVirtIOSetRegisterOutput(INT_PTR hClientHandle, int startIndex, const double* values, int count);
C#
Controller.Variables.VirtualIO.Register.Outputs.SetMultiple(start, values) — 批量写入虚拟寄存器输出。
参数
hClientHandle (INT_PTR)
客户端会话句柄,由 DLLSysConnect 获取。
startIndex (int)
写入起始索引(0-indexed)。
values (const double*)
输入。要写入的 double 值数组。
count (int)
要写入的寄存器数量。
返回值
返回 ErrorCode;NoError (0) 表示成功,正值为错误码,详见 SDK 发布头 ErrorCode.h。
示例
double setpoints[2] = {3.14, 6.28};
DLLVirtIOSetRegisterOutput(handle, 0, setpoints, 2);