Profinet Communication (Codesys, UR5e, Gripper) | Boolean Registers

Hello,

I am currently working on Profinet communication between a UR5e, an electric gripper, and a Codesys controller.

The Profinet communication works, but the program flow on the robot does not yet work as desired.
My idea looks like this:

  1. robot moves to position 1
  2. user confirms to continue
  3. robot moves to position 2 for gripping
  4. gripper moves to
  5. robot moves to position 3 for depositing
  6. gripper opens
  7. robot moves to home position

I would like to solve the handshake between robot and gripper via the bit registers.
I have already placed my handshakes on the registers:

Now to my question: How can I read and write these registers?
My idea so far:
READING:
Read the register value set in the PLC at the robot (i.e. gripper closed):
Var1 := read_output_boolean_register(0)
Continue if register value is TRUE
Wait Var 1 =? TRUE

WRITING:
Robot reaches position → write register value
write_output_boolean_register(1. TRUE)

But this does not work yet, hence the question:
When do I use
read_input_boolean_register
read_output_boolean_register
write_output_boolean_register?

Many thanks and best regards