Running background program to indicate IOs for robot position (right/left signals)

Hi!

I am running a program to control the robot motion from external sources (e.g. ROS, URcap). Also, I would like to run a background program that is always indicating whether the J1 is always within some range (right) or within a different range (left), via output digital signals (IO1 ON for robot is on the right, IO2 ON for robot is on the left). Any advice on how to have 2 different programs running at the same time to do this?

Thank you!

perhaps just a thread running alongside the program?

Thank you so much for the advice. Any pointer as to where to find the thread programming in the UR manuals/documentation please?

Page 187 in the manual for normal polyscope programmin.

For URscript perhaps this site will help, I do not use it myself.

page 12 for Thread