跳转至

DLLVirtIOGetRegisterInput

函数 DLLVirtIOGetRegisterInput 读取控制器虚拟浮点寄存器输入。(寄存器为 double 精度浮点型 IO,可存储模拟量数据如位置、速度、力等。)

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

C/C++

ErrorCode DLLVirtIOGetRegisterInput(INT_PTR hClientHandle, int startIndex, double* outValues, int* inOutCount);

C#

Controller.Variables.VirtualIO.Register.Inputs.GetMultiple(start, count) — 批量读取虚拟寄存器输入。

参数

hClientHandle (INT_PTR)

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

startIndex (int)

读取起始索引(0-indexed)。

outValues (double*)

输出。接收读取的 double 值数组。

inOutCount (int*)

输入输出。调用时传入要读取的寄存器数量;返回时写入实际读取的数量。

返回值

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

说明

虚拟寄存器 IO 可用于进程间数据共享、传感器数据注入或仿真场景。

示例

double regs[2] = {0};
int count = 2;
DLLVirtIOGetRegisterInput(handle, 0, regs, &count);

相关函数