You can use for example IF-statement. For inputs you can use it like this:
IF di1=1 THEN
!This will be executed if the signal value is 1
ENDIF
For output testing you need to use DOutput-function, like this:
IF DOutput(do1)=1 THEN
!This will be executed if the signal value is 1
ENDIF
When you wrote about different states of the three output, you might be also interested to find out about group signals. You can define your three digital output signals as one group output and that way you can simplify your RAPID code. Then you can use instruction SetGO to set value for the group output. This way you don’t have to manually set or reset all the digital signals. For example like this: