Hello,
your script works well on my side.
MichalH_1-1725980527609.png
Please remember that the variable needs to be modifiable:
MichalH_0-1725980370862.png
Also note that current version of FreeMASTER will not update the variable value in the Watch view until you open the communication port. This issue will be fixed in the upcoming release - the virtual variables will not need a port being open at all and their value will refresh variable watch views.
Regards,
Michal