Connecting to a Universal Robot for read and write

Hi I am very new to Ignition and I am trying to set up communication between a Universal Robots UR5e and Ignition, Ignition would be used to create the user interface, before this I need to be able to pass data between the cobot and Ignition.

I reached out to UR and they suggested using Modbus, is this the best way?

I guess I need to setup registers on the cobot which ignition can read and write to, is this the way to go?

Have someone done this before, please advice

I've done this, there are pre-defined registers on the cobot controller.

Best to make the cobot controller the Modbus Server.


This is the communication system I am trying to implement. Steps 4, 7, 12 are variables from Ignition to cobot and (1) can Ignition load and start a program using modbus?

image
The connection from Ignition has been successful

Since I am using the robot as server and the (2) connection is successful, there is no setup required on the cobot end, like "Modbus Client IO setup" on the cobot under Installations>Fieldbus>Modbus?

Matrix_Engineering Thanks for the docx with adresses; (3)so if I need to pass variables like diameter (float), should I use "General purpose 16 bit registers" 128 - 255 and does that mean I can pass atmost 128 variables (255 - 128)?

(4)And how should I configure the address in Ignition to read 128 and the Modbus Type is it "Holding register(UInt16)":

Tried:
(1)

There is a program setup on the cobot which has "write_output_integer_register(0, 300)" hoping this writes to general purpose register 128 (register 128 is referred as 0 in URscript)

and on Ignition tried reading/subscribing to the corresponding tag:

(2)
Also tried writing from ignition to register 128 and reading at cobot side using "temp = read_input_integer_register(0)"

Ignition gives out error while writing:

Both didnt work out.

So I am using the right register and can the register 128 be used to read and write?

Don't use the address mapping feature. Instead, create your own tags and manually enter the address.

For example, to get the e-stop status of the cobot controller:

ns=1;s=[ur3]1.HRI262

I used this coil to tell the cobot to run the program from the SCADA:

ns=1;s=[ur3]1.C16

I'm not sure about loading a user program, you'll have to dig more into the manual.

Additionally, in the driver settings under advancerd, you will want this:

Tried it:


Also enabled zero based addressing and made sure the device name is correct:

Should the data type be an integer?

No, you didn't. The OPC Item Path in your screenshot is missing the unit number before the dot.

Also it's a status, make it a boolean.

1 Like

Thanks guys, it worked.

@mnizamudeen You will not be able to load a specific program through Modbus. There are some ways around this using case a statement in the main robot program that looks at a modbus register and calls the apropriate program. But Ur robot has the dashboard server which takes simple tcp commands. Dashboard Server e-Series, port 29999 - 42728

Thanks Marcis_Sysum

I can setup a variable in the program and populate the variable over modbus to start the program but dashboard server seems like a better option, but how do I pass the dashboard server commands using Ignition.

Should I set up a TCP connection and then how?

@mnizamudeen The easiest way to test the dashboard server is create a tcp device in ignition. Set it to packet based.
click advanced properties and check the writable option it's false by default. Put a newline character for the writeback message Delimiter.
The link I sent above has the list of commands. Just write your message to the writable tag for the tcp device.


Then when you hit enter the driver will write the message to the dashboard server. In this screenshot I am connected to ursim in a docker container.

1 Like

I have set up modbus communication, but the value readout on the tag within ignition designer is '0'. The value for the same variable on the teach pendant is increasing, but the value is not being read by the tag.

Show the address map for the robot and show the OPC path configuration for your tag that is not reading anything. Also, are there any errors/warnings in your gateway log?

Here are screenshots of those. There are no errors, just a zero value where there should be a number


You are missing the leading unit Id and you also have the tag defined as a float, but are only reading a single modbus register. Try [UR3 ModBus]1.HRF225.

With that change I am still getting '0' unfortunately. If it helps, I'm converting a program variable value to modbus using the write_port_register(225,Downtime_Output) thread script.

Try adjusting the Ignition side register to [UR3 ModBus]1.HRF224 or [UR3 ModBus]1.HRF226. you might be off by one register, though I would expect you to be getting a bogus value if you were off by one. Also, ensure 0-Based Addressing is enabled in the Ignition configuration for your device.

Are you able to successfully read any of the robot status registers?

Universal Robot Docs for others to reference:

Enable zero based addressing in the advanced config. The ur robot is zero based

1 Like

Wait I'm blind, you are missing ns=1;s= from your OPC path configuration on your tag. Try ns=1;s=[UR3 ModBus]1.HRF225. I'm surprised it didn't give you a configuration error.