Using OPC UA to connect Fanuc robot

Using OPC UA to connect Fanuc robot

mail7WJMZ
Collaborator Collaborator
3,636 Views
8 Replies
Message 1 of 9

Using OPC UA to connect Fanuc robot

mail7WJMZ
Collaborator
Collaborator

[ FlexSim 22.1.4 ]

Hello,

I would like to connect FlexSim with Fanuc robot controller.

By using OPC UA, I can't find any suitable tag such as digital I/O, but only Modbus tags.

We supposed the discreteinput is digital I/O in Fanuc controller, but the list of tags under discreteinput are not available.

01.png


0 Likes
Accepted solutions (1)
3,637 Views
8 Replies
Replies (8)
Message 2 of 9

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

It looks like you may be wanting to use the instance specifier as described here.

If the instances are robots then just add them to an object process flow containin the emulation variable set up as the documentation described - say with a label on each to use as the instance specifier. If the instances are something more abstract within FlexSim - like joints - you'd have to find a way of attaching those to the object process flow as members - such as manually sampling the drawsurrogate tree.

0 Likes
Message 3 of 9

mail7WJMZ
Collaborator
Collaborator

@Jason Lightfoot Thank you for help, but I don't think that manual answers my question. I would like to access Fanuc controller by using OPC UA, but FlexSim OPC UA can't find IO tags I need.


This webpage explains what IO in Fanuc robot.

Mapping and Configuring FANUC Robot IO Points

0 Likes
Message 4 of 9

jason_lightfoot_adsk
Autodesk
Autodesk

Find the tags in UA Expert. I think then you'll find that the use of instance specifiers in FlexSim will match the format you need.

Since this is so abstract I'd probably try using tokens generated in one process flow as instances for the process flow containing the emulation variable.

0 Likes
Message 5 of 9

julie_weller
Not applicable

Hi @Steven Chen, was Jason Lightfoot'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
Message 6 of 9

mail7WJMZ
Collaborator
Collaborator

@Jason Lightfoot I have tried UA Expert today, as you can see in below picture, what we want to access is one boolean value inside an array, such as Coils[0] or Coils[1].

ua-expert.png


Node id of boolean array is "ns=1;i=302".

But elements of the boolean array don't have node id.

FlexSim returns value zero instead of boolean array with that node id.


I was supposing that format of node id can be changed to "ns=1;i=302[0]" to access only one boolean value in the array, but somehow manually set the string of node id in text field didn't take effect.

Image.png

In conclusion FlexSim 2022 seems not able to access single element of array node. Does new emulation module 2023 supports read/write array variable?

0 Likes
Message 7 of 9

jason_lightfoot_adsk
Autodesk
Autodesk

Sorry - you can't use an instance specifier in the node id of the Emulation Properties panel - you need to use object process flows with emulation variables NOT define your variables using the emulaiton properties panel you find in Tools. This is described in the links I supplied above and is should be possible the in the previous versions as well as the latest, licensed emulation module.

1691151135152.png

1691151200090.png


0 Likes
Message 8 of 9

mail7WJMZ
Collaborator
Collaborator

@Jason Lightfoot Sorry I still don't get it how to use instance specifier to read only one boolean from a boolean array. I tried index0 and index1 but return value is zero (False) instead of one (True).

pf-opcua-instance.png


As my understanding to the manual, instance specifier is a convenience way to modeling multiple objects associated to multiple PLC tags, with Object Process Flow and only one variable. Alternately way is create each variable for each object, but would be dumb if there are dozens of objects. Is it correct?

0 Likes
Message 9 of 9

jason_lightfoot_adsk
Autodesk
Autodesk

You're not referencing the specifier in your node ID (it should have '%s' somewhere ) and you have a fixed specifier value instead of something that evaluates to a different value per instance.

You could set up a process flow variable that looks at an object's label:

1691571658645.png which then allows you to choose the variable from a dropdown on the Instance Specifier field and refer to it using %s in the Node ID field:

1691571863045.png

0 Likes