Introduction

All 4 Modbus datastores are implemented: Coils, Discrete inputs, Holding registers, Input registers. Each datastore has a different set of functionalities. Note that each datastore contains a completely different set of data.

Discrete Input and Input register are READ-ONLY tables. Those have been used to keep the robot state.

Coil and Holding Register are READ/WRITE tables. Those have been used to give user commands to the robot. Hence, those 2 tables do not contain the robot state, but the last given command.

Address tables start at 0.

Coils

Each address contains a 1bit value.

READ/WRITE (the stored values correspond to the last given command, not the current robot state)

Accepted Modbus functions:

  • 0x01: READ_COILS

  • 0x05: WRITE_SINGLE_COIL

This datastore can be used to set Digital I/O mode and state. Digital I/O numbers used for Modbus:

  • 0: 1A

  • 1: 1B

  • 2: 1C

  • 3: 2A

  • 4: 2B

  • 5: 2C

Address

Description

0-5

Digital I/O mode (Input = 1, Output = 0)

100-105

Digital I/O state (High = 1, Low = 0)

200-299

Can be used to store your own variables

Discrete inputs

Each address contains a 1bit value.

READ-ONLY

Accepted Modbus functions:

  • 0x02: READ_DISCRETE_INPUTS

This datastore can be used to read Digital I/O mode and state. See the Coils section above for digital I/O number mapping.

Address

Description

0-5

Digital I/O mode (Input = 1, Output = 0)

100-105

Digital I/O state (High = 1, Low = 0)

Holding registers

Each address contains a 16bit value.

READ/WRITE (the stored values correspond to the last given command, not the current robot state)

Accepted Modbus functions:

  • 0x03: READ_HOLDING_REGISTERS

  • 0x06: WRITE_SINGLE_REGISTER

Address

Description

0-5

Joints (mrad)

10-12

Position x,y,z (mm)

13-15

Orientation roll, pitch, yaw (mrad)

100

Send Joint Move command with stored joints

101

Send Pose Move command with stored position and orientation

110

Stop current command execution

150

Is executing command flag

151

Last command result*

152

Last command data result (if not vision related)

153 - 158

Vision - Target pose result

159

Vision - Shape of the object found (-1: ANY, 1: CIRCLE, 2: SQUARE, 3: TRIANGLE, 0: NONE)

159

Vision - Color of the object found (-1: ANY, 1: BLUE, 2: RED, 3: GREEN, 0: NONE)

200-299

Can be used to store your own variables

300

Learning Mode (On = 1, Off = 0)

301

Joystick Enabled (On = 1, Off = 0)

310

Request new calibration

311

Start auto calibration

312

Start manual calibration

401

Gripper open speed (100-1000)

402

Gripper close speed (100-1000)

500

Update the tool id according to the gripper plugged (gripper 1: 11, gripper 2: 12, gripper 3: 13, vaccum pump: 31)

501

Store the tool id

510

Open gripper previously updated

511

Close gripper previously updated

512

Pull air vacuum pump with id 31

513

Push air vacuum pump with id 31

520

Update the conveyor id and enable it

521

Detach or disable the conveyor previously enabled and updated

522

Start the conveyor previously enabled and updated

523

Set the conveyor direction (backward = number_to_raw_data(-1), forward = 1)

524

Set the conveyor speed (0-100)(%)

525

Store the conveyor id

526

Stop conveyor previously enabled and updated

610

Vision - Get target pose from relative pose, with stored relative pose and height_offset

611

Vision - Get target pose from camera, with stored workspace name, height offset, shape and color

612

Vision - Vision pick, with stored workspace name, height offset, shape and color

613

Vision - Move to object, with stored workspace name, height offset, shape and color

614

Vision - Detect object, with stored workspace name, shape and color

620

Vision - Store workspace’s height offset

621

Vision - Store relative pose x_rel

622

Vision - Store relative pose y_rel

623

Vision - Store relative pose yaw_rel

624

Vision - Store requested shape (-1: ANY, 1: CIRCLE, 2: SQUARE, 3: TRIANGLE)

625

Vision - Store requested color (-1: ANY, 1: BLUE, 2: RED, 3: GREEN)

626 - max 641

Vision - Store workspace’s name, as a string encoded in 16 bits hex (see examples on how to store a workspace name from a client)

‘*’ The “Last command result” gives you more information about the last executed command:

  • 0: no result yet

  • 1: success

  • 2: command was rejected (invalid params, …)

  • 3: command was aborted

  • 4: command was canceled

  • 5: command had an unexpected error

  • 6: command timeout

  • 7: internal error

Input registers

Each address contains a 16bit value.

READ-ONLY.

Accepted Modbus functions:

  • 0x04: READ_INPUT_REGISTERS

Address

Description

0-5

Joints (mrad)

10-12

Position x,y,z (mm)

13-15

Orientation roll, pitch, yaw (mrad)

200

Selected tool ID (0 for no tool)

300

Learning Mode activated

301

Joystick enabled

400

Motors connection up (Ok = 1, Not ok = 0)

401

Calibration needed flag

402

Calibration in progress flag

403

Raspberry Pi temperature

404

Raspberry Pi available disk size

405

Raspberry Pi ROS log size

406

Ned RPI image version n.1

407

Ned RPI image version n.2

408

Ned RPI image version n.3

409

Hardware version (1 or 2)

530

Conveyor 1 connection state (Connected = 1 , Not connected = 0)

531

Conveyor 1 control status ( On = 0, Off = 1)

532

Conveyor 1 Speed (0-100 (%))

533

Conveyor 1 direction (Backward = -1, Forward = 1)

540

Conveyor 2 connection state (Connected = 1 , Not connected = 0)

541

Conveyor 2 control status ( On = 0, Off = 1)

542

Conveyor 2 Speed (0-100 (%))

543

Conveyor 2 direction (Backward = -1, Forward = 1)