Is_secondary_program parameter in URScript Modbus functions

Hello,

In several modbus functions - for example modbus_get_signal_status - there is a boolean parameter called “is_secondary_program” where the documentation says:
is_secondary_program: A boolean for internal use only. Must be set to False

However, we are implementing a modbus heartbeat functionality that is supposed to be sent by a secondary program twice a second, while the main robot program is not running or is doing something else. When these modbus functions are called from a secondary program, should the is_secondary_program parameter be set to True even if the documentation says “Must be set to False” ?

Thanks,

Csaba

Update: it seems that using modbus functions in a secondary program may introduce random connection errors in the modbus communication. Sending this secondary program periodically ca. twice a second:

sec heartbeat():
  modbus_set_output_register("HEARTBEAT", (1 + modbus_get_signal_status("HEARTBEAT", False))%256, False)
end

Tested with both is_secondary_program=True and False, the random timeouts can be observed.
Without the above code (only using primary program) the timeouts can’t be observed anymore.

Is it in general safe to use modbus functions from the secondary program?

@Ebbe do you have any suggestions here?