Global variables not accessible thorough Netwatch

Hello,

I am expecting interesting issue - on my RB411AH with ROS 3.23 I am trying to use global variable, everything works fine, but when I want to work with this variable in Netwatch script or script executed by Netwatch, this variable is null.

Example:

  • create variable and set some value (in New Terminal, system script on startup…):

:global “c”;
:set c “0”;

  • then I create new script PRINT_VAR with all polycies and this content: (running this script manually works fine - prints that varialbe to log)
    :global “c”;
    :log info “Data $c”;

  • then I create new Netwatch entry (it does not matter if it triggers on up or down state) with this content:
    system script run PRINT_VAR;

Finally, when trigger occurs, script is being executed (run counter increases), but log contains null data entry "Data ".
I also tryied to write content of PRINT_VAR script directly into Netwatch, but the result is the same.

Thank you very much for your help!
Ondrej

You can’t access global variables created by different users. Owner of the script executed from scheduler is “sys” so it is not possible to access varaibles defined in terminal by for example “admin”

so these aren’t global variables eh, they are really user environment variables unlike previous versions : )

Hello,

thank you for your response!
So is it possible to change the owner of the system variables or script owner so I can access that variables from netwatch?

Ondrej

The script has an ‘owner’ property. Change it accordingly.

I know that field, but I don know how to change it - it is disabled for changing and thorough Terminal it is not possible too. Also when I try to create new script, this field automatically sets to “admin”.

Huh. I could have sworn that you used to be able to change it.

Maybe delete it, then log in as the user that is supposed to own the script, and recreate it as that user?

OK, thank you - that trick with logon as different user works, but Netwatch still cannot access variables - I recreated global variables as user “sys”, changed all scripts owner, but no luck.