Web Gate: Script sharing Principles.
Goals and Symptoms
Web Gate: Script sharing Principles
Causes and Fixes
Publish property: you can define publish property by two ways.
The first one is to define the publish property in the property inspector of each popup, script or panel. In this case you can choose to publish it to the HMI Runtime, to web gate or to the both (for All).
The second method is to define the publish property in property inspector of the project (the target) in this case you can choose: HMI Runtime, Web gate, All or No Change.
If you choose the second way, the publish property will be applied for all scripts, popups and panels. If you select to publish scripts only in HMI runtime in the property inspector of the target, even if you select another publishing property (for example for All) for one script, that will not be applied (the selection "No change " allow you to define the publish property for each script, popup or panel separately)
For the variables: if you select none for sharing property of variable, in the web gate this variable will behave as an internal variable of web gate. This means that you can write values to the variable, but the values will not be written to the HMI. You will not be able to see the value in the HMI as well. The non shared variables can have different values in the web gate and the HMI
For script, you can have 6 possible situations:
-Script published for all (Web gate and HMI) :
*Variable shared: the script is executed 2 times, one time in the VJD runtime and one time in the web gate frame, if you modify the value of shared variable you will see the modification in the web gate and the XBT
*Variable not shared: the script is executed 2 times, one time in the VJD runtime and one time in the web gate frame, but variables could take 2 different values that mean you can have 2 different values for the same variable
-Script not published in Web Gate (Published to HMI Runtime):
*variable shared: the script is executed in the HMI but you can see the variable in the web bate even if it was not shared
*variable not shared: the script is executed in the HMI, you can' t see the variable values in the web gate but you can write it (value written in the web gate are seen locally in the web gate and not send to the HMI)
- Script not published in HMI Runtime (Published to Web Gate):
*variable shared: the script is executed in the web gate but you can see the variable modification in the HMI even if it was not shared
*variable not shared: the script is executed in the web gate, you can't see the variable values modification in the HMI but you can write it in the HMI and it will has a different value than in the web gate