DLLVirtIOGetRegisterOutput
函数 DLLVirtIOGetRegisterOutput 读取控制器虚拟浮点寄存器输出。(寄存器输出由控制器程序或 SDK 写入,可驱动需要模拟量输入的外部设备。)
C/C++
ErrorCode DLLVirtIOGetRegisterOutput(INT_PTR hClientHandle, int startIndex, double* outValues, int* inOutCount);
C#
Controller.Variables.VirtualIO.Register.Outputs.GetMultiple(start, count) — 批量读取虚拟寄存器输出。
参数
hClientHandle (INT_PTR)
客户端会话句柄,由 DLLSysConnect 获取。
startIndex (int)
读取起始索引(0-indexed)。
outValues (double*)
输出。接收读取的 double 值数组。
inOutCount (int*)
输入输出。调用时传入要读取的寄存器数量;返回时写入实际读取的数量。
返回值
返回 ErrorCode;NoError (0) 表示成功,正值为错误码,详见 SDK 发布头 ErrorCode.h。
示例
double regs[2] = {0};
int count = 2;
DLLVirtIOGetRegisterOutput(handle, 0, regs, &count);