Calling a subroutine from within UR script

Is it possible to call a subroutine that is defined as a .urp or within a program through UR script?

I have a program that is going to specific locations that are being sent from a separate device using UR’s RTDE module. All of the logic handling the communication between the devices is handled using a UR script for ease of programming. However, once I reach the intended location, I would like to call a subroutine that performs a task at the desired location. I don’t want this to be defined though the script function or RTDE so that operators are able to tweak the settings or routine as needed.

I’ve tried calling the name of the subroutine from within the script but haven’t had any luck (i.e. my_subroutine()). I would assume there’s some handle that defines the subroutines that the program uses when referencing them I’m just not sure if it’s possible to call these within a function written in UR script.

That’s how you do it, you just need to make sure the program is sitting in the main program as a subprogram. Either that, or you need to copy/paste all the script from that .urp into a function def and call it that way