Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

How to get an array from opcua server in Emulation

How to get an array from opcua server in Emulation

apollo_s
Not applicable
1,641 Views
7 Replies
Message 1 of 8

How to get an array from opcua server in Emulation

apollo_s
Not applicable

[ FlexSim 21.2.4 ]

5.png

0 Likes
Accepted solutions (1)
1,642 Views
7 Replies
Replies (7)
Message 2 of 8

ryan_c10
Not applicable

Hi @Apollo S,

The print() command doesn't print to the little output field in the script console. That is just for the return value from the code. The print() command prints to the Output Console. Have you checked to see if the array is replicated there?

I hope this helps! Let us know if you have further problems/questions!

0 Likes
Message 3 of 8

apollo_s
Not applicable

I have checked. The Result in Output Console is 0. I can't get the array.

0 Likes
Message 4 of 8

ryan_c10
Not applicable

Hi @Apollo S,

It's hard to know how to help without looking at your model. To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

0 Likes
Message 5 of 8

apollo_s
Not applicable

1-3.pngImage.png


The picture below is the result that I have tested. I only want to read all data in the "table" array and print them in Output Console. But in my code, it doesn't work.Image.pngImage.pngImage.png

0 Likes
Message 6 of 8

sakamoto_ryosuke
Collaborator
Collaborator
Accepted solution

I think its a matter whether FlexSim's OPC UA Client support array datatypes. I never met 3DSimulator which supports arrays. Nothing is mentioned in FlexSim online manual.

If array is not supported, you will need to breakup the array to datatypes(bool, integer, etc.) within OPC server and then send to FlexSim.

0 Likes
Message 7 of 8

apollo_s
Not applicable

Good Solution!

0 Likes
Message 8 of 8

ryan_c10
Not applicable

Hi @Apollo S, was one of Ryosuke S's or Ryan Clark's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. 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 unaccept and comment back to reopen your question.

0 Likes