question

KJH avatar image
0 Likes"
KJH asked Jason Lightfoot commented

How to send Two dimensional array variable value to opc-ua server?

I'm thinking of a two-dimensional array opcua server that records the coordinate values in order when AGV reaches CP.

cap-2023-09-15-01-34-10-218.png

The server was configured through the kepserver and is shown in the following picture.

cap-2023-09-15-01-33-35-569.pngAGV detects reaching CP, but the server accepts the two-dimensional array as a null value, and the variable value is being updated strangely.



/**Custom Code*/
Object agv = param(1);
Object destCP = param(2);
double pathOffset = param(3);
double agvBodyOffset = param(4);
Object current = param(5);
Variant currentValue = param(6);



Array deepArray = [[[1.3, 2.1], [3.1, 4.1]], [[5.1, 6.1]]];

return deepArray;

The custom code is as follows.


Basically, I know that if there is a semicolon or square bracket, it cannot be used as a variable value for the server, but does the output value of the custom code have a semicolon or square bracket, so the variable value cannot be read properly?

How do I write custom code for a server to accept variable values in a two-dimensional array?

I attached the corresponding flexsim model.

*The contents may be awkward because it is written using a translator.

OPC_UA_TEST_2.fsm

FlexSim 22.2.4
emulationopc ua
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @KJH, was Luciano Cavallero's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Luciano Cavallero avatar image
0 Likes"
Luciano Cavallero answered
Currently OPC UA Control and Sensor support only scalar values, not array.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.