question

CH.Lee avatar image
0 Likes"
CH.Lee asked CH.Lee answered

How to transmit String data to the OPC UA server?

I am currently working on a project to connect a Flexsim project to an OPCUA server.

While data values of Boolean or int data types are successfully transmitted to the OPCUA server, I am encountering an issue where string data is not being transmitted.

The server settings have the Sensor tag's data type set to String.

I have verified from the Kepserver manual, which is the OPC server being used, that string data is supported in the form of Null-terminated Unicode strings.

How can I transmit Null-terminated Unicode string values from Flexsim to the OPCUA server?

FlexSim 24.1.0
emulationstringopcuaunicodesensortag
· 7
5 |100000

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

Jeanette F avatar image Jeanette F ♦♦ commented ·

@Luciano Cavallero, @Tancredi Canonico, @Fiorenzo A, can you please take a look at this emulation-related question?

0 Likes 0 ·
CH.Lee avatar image CH.Lee Jeanette F ♦♦ commented ·

@Luciano Cavallero, @Tancredi Canonico, @Fiorenzo A


I hope this message finds you well.

I'm writing to follow up on my previous inquiry regarding.

It has been a month since I submitted my question, and I was wondering if you could provide an update on the status of my request.

0 Likes 0 ·
Luciano Cavallero avatar image Luciano Cavallero commented ·

Hi,

strings are supported by the OPC UA connector.

Below a screenshot with a simple test: one le left Flexsim read the value of the variable connected to a exported OPC UA KerServer tag (in the middle) written by a OPC client (on the right)

1719837400794.png

Are you able to reproduce the same configuration?

0 Likes 0 ·
1719837400794.png (346.6 KiB)
CH.Lee avatar image CH.Lee Luciano Cavallero commented ·

Thanks for your respose.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ CH.Lee commented ·
Did Luciano's comment solve your issue? If so we'll change his post to an answer for you to accept.
0 Likes 0 ·
Show more comments

1 Answer

CH.Lee avatar image
0 Likes"
CH.Lee answered

The problem I had was that when I changed the value from Flexsim to Sensor Variable to String data, the OPC-UA server outputs a value such as String 0, or String 1, and it does not change anymore.

At this time, other types of data could be transmitted and received without problems.


This was why I expressed that the question I intended was not the answer.


However, Referring to your answer, when I checked the Sensor Variable value by entering the command in the Script Console, I confirmed that the Sensor Variable value was changed normally to String data, and I determined that there was a problem with the OPC-UA server setting.


Interestingly, when I reduced the length of the character of the device name and removed the space, the String data was sent to the server correctly.


As a result, I was able to find out how to confirm that it was not a problem of Emulation through your answers, and I am grateful that I could get a clue to solving the problem.

5 |100000

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