question

Manikanta avatar image
0 Likes"
Manikanta asked Manikanta commented

Modbus

I am trying to get a data from a universal robot in URsim environment. I found the address of the robot to be connected. and connected according to the steps https://www.universal-robots.com/articles/ur/interface-communication/connecting-to-client-interfaces-within-ursim/#:~:text=Within%20the%20virtual%20machine%20open,of%20the%20robot%20within%20URSim.

1690188157064.png

I am trying to get the joints data of the robot while it is running into flexsim using Modbus connection

1690188269873.png

According to universal robot website https://www.universal-robots.com/articles/ur/interface-communication/modbus-server/

1690188359095.png

address (registers 270 to 275 gives a joint data of the robot)

In flexsim I emulated the connection as

1690188580424.png

detailed model Emulation example flexsim question.fsm here i am basically testing whenever a data comes from the register create a object on queue / change the colour of the queue using control registers. But when i run the model no change in the property of queue.

I doubted whether the connection is good and checked with qModMaster https://sourceforge.net/projects/qmodmaster/

It seems i am getting data from the URsim robot for the Base joint which is in 270 register. But it is not reflecting in the flexsim model.

How do i check whether flexsim is receiving data from the address by using MODBUS TCP connection. Is there anything I could do alternatively in the model like populating the data in global table. Help me in this regard so that I could get data from the robot.

FlexSim 23.1.3
modbus tcp
5 |100000

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

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Manikanta commented

The software you are using to check the connection is emulating a modbus master/client, so I would assume that the robot is acting as the slave/server. As such FlexSim should also be set up to serve as a client instead of a server.

· 20
5 |100000

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

Manikanta avatar image Manikanta commented ·

Hi Felix

I changed into client,

1690222598120.png

1690222643631.png

But the changes are not reflecting in the model, is there a way for me to check whether flexsim is getting the data from the robot using actions in control register or like writing the values in global table.

0 Likes 0 ·
1690222598120.png (242.1 KiB)
1690222643631.png (267.4 KiB)
Felix Möhlmann avatar image Felix Möhlmann Manikanta commented ·

Try checking the box to poll for changes. To show whether any values are received I'd suggest to print the values to the output console.

capture.png

0 Likes 0 ·
capture.png (22.0 KiB)
Manikanta avatar image Manikanta Felix Möhlmann commented ·

Hi felix thank you

1690228508203.png

I could now confirm that flexsim is getting data from the robot through modbus connection. I have few doubts regarding how to convert these data first i need to get a signed integer as these are unsigned. I don't know whether clicking 16bit int gives the same functionality in the register type.

1690228658217.png

Next thing is i am trying to get the robot joint values in degrees

1690228826488.png

What kind of code should I use.

Also, i could see that output console is showing the data only there is a change in the value. What should i do if I just want to view the value when the value is not changing (i.e robot is not moving).

0 Likes 0 ·
1690228508203.png (246.5 KiB)
1690228658217.png (15.9 KiB)
1690228826488.png (361.0 KiB)
Show more comments