Topic RSS13:52, EEST
July 7, 2025
OfflineHi there…
Is there anywhere an example how to create and read an array of double, or any other type, available…
Using the help file and search for “Id_ArrayItemType” > No Topics found…
Other variables (byte, double, string, integer) works good with
Result := FNodeManager.CreateVariable(AName);
Result.DataTypeId := AType; // Id_Double for example
But an array? Nothing found in the examples, tutorials or the web.
Using Sentrol 7.8.2 and the TuaServer Component…
Regards, Kai
14:56, EEST
December 21, 2011
OfflineYeah, you are right that this hasn’t been documented.
First, you need to declare the variable data type additionally using ValueRank and ArrayDimensions, although this is just informative so that the clients know what to expect.
MyLevel.ArrayDimensions := [0]; // size of each dimension. 0 means flexible.
ValueRank can also be declared using the standard values, if you need more flexibility:
vrAny = -2;
vrScalar = -1; // default for variables
vrOneOrMoreDimensions = 0;
The actual values for the varialbe must be provided with Variant arrays:
V: Variant;
…
V := VarArrayCreate([0,1], varDouble);
V[0] := 0.0;
V[1] := 1.0;
MyLevel.Value := TUaVariant.Create(V);
11:05, EEST
December 21, 2011
OfflineAnd this is now included in the Server Tutorial as well.
Thank you for the notice.

Log In
Register