Global JScritp variables are listed in a TreeView in a folder called Global JScript variables.
When adding a new variable, user right-clicks on this folder and chooses New Global JS variable item.

Figure: Creating of new global JScript variable
Defining of the variable is designed similaraly as of Data items. User defines unique name, chooses the data type of the variable and sets its default value. If user does not define default value, it is set to zero or empty string in case of string data type. In addition user can define an array of chosen data types with a specific length. Arrays are supported for all the data types apart from string data type.

Figure: Dialog View - global JScript variable
Following example is a demostration of possible using of global variables in computing running average over ring buffer, which represents simple filtration of a variable. Used global variables are g_aInPkts (represents an array where the values of input SNMP packets (inPkts) are stored), g_nLength (represents the length of the array), g_nPointer (represents a pointer in an array).

Figure: Example of global JScript variable usage.
Send feedback on this topic.
Copyright © 2004-2013, SAE - Automation, s.r.o. (Ltd.), All rights reserved.