Web Port scripts can also use methods in .NET provided they are called with a complete search path.
For more information on the .NET framework see
Call scripts are accessed from SYSTEM SETTINGS/SCRIPTS/CALL SCRIPTS. These can be called, among other things, from object functions and schedules.
To call a script, the following syntax is used:
Script names are read from the list of available CALL SCRIPTS
Parameters are not mandatory but are a good way to send information to the script.
Parameters are written as par1 = value, par2 = value where par1 and par2 become variables with set values in the script.
The following example calls the script sum with two parameters x=3 and y=5.
The following settings can be made for a called script:
|*Name||Name of the called script (used for calls and must be unique)|
|Description||Description of the function of the script and any parameters|
Create call script
Go to SYSTEM SETTINGS/SCRIPTS/CALL SCRIPTS. then NEW SCRIPT. Fill in settings according to table above and press SAVE.
Edit call script
Go to SYSTEM SETTINGS/SCRIPTS/CALL SCRIPTS. Click on the desired script in the list. Make the desired changes in the dialog that opens and press SAVE.
Delete call script
Go to SYSTEM SETTINGS/SCRIPTS/CALL SCRIPTS. Click on the desired script in the list. In the dialog that opens, press DELETE and then confirm to complete.
Call scripts in node/portal
When call scripts are used in a node connected to a portal it must be kept in mind that the script will be syncronized and also run in the portal. This creates the possible need for the script to consider that tags may have an additional prefix in the portal. To handle this in the script the variable nodeprefix is available. This will be an empty string in the node while it will will be set to the node prefix in the portal. See example below for how to use this.
Below example shows how the tag AS01_GT31_PV (which exists in the node) is read in a script which works in both node and portal (in the portal the prefix NODE1 is added → NODE1_AS01_GT31_PV)
var tag = nodeprefix == ”” ? ”AS01_GT31_PV” : nodeprefix +
”_AS01_GT31_PV”; var value = tagValue(tag);
External call of the called script
A called script can be called by external services via a URL. For a called script to be called, "Allow script calls" must be enabled for the connection that calls the script (SYSTEM SETTINGS/ACCESS/CONNECTIONS).
To call a script externally, the following URL and syntax are used:
scriptID is the name of the script to be called
&Par1=??? And &par2=??? are optional parameters that can be sent to the script.
The reply given when calling is what the script returns from the return statement.
To be able to call an external script, the script name must not contain any special characters.