跳转至

DLLVarGlobalSetDoubles

函数 DLLVarGlobalSetDoubles 向控制器写入 $global[] 全局双精度数组。($global[] 为所有任务共享的双精度变量区。)

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

C/C++

ErrorCode DLLVarGlobalSetDoubles(INT_PTR hClientHandle, int startIndex, const double* values, int count);

C#

Controller.Variables.Global.Doubles.SetMultiple(start, values) — 批量写入全局 double 数组。

参数

hClientHandle (INT_PTR)

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

startIndex (int)

写入起始索引(0-indexed)。

values (const double*)

输入。要写入的双精度值数组指针。

count (int)

要写入的元素数量。

返回值

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

说明

$global[] 在控制器内存中全局共享,所有任务均可见。可用于任务间数据交换。

示例

double values[2] = {1.5, 2.5};
DLLVarGlobalSetDoubles(handle, 0, values, 2);

相关函数