· | recomputation of the value of existing OPC item associated with MIB variable on a connected device
|
· | creation of new OPC item (called Script item) as a result of procesing none, single or several MIB variables.
|
In the first case, user can accomplish recomputation of OPC Item through the use of created JScript after read or write its value. When the new Data Item is created (user can check the check box Use script in the configuration dialog view. After that, in the edit box, two function headers for JScript are created. SNMP OPC Server allows user to define, when the JScript with processing algorithm will be executed - after reading of the OPC value or before writing of the OPC value. The processing of the value will be excuted in the following sequence (first reading, than writing).

Figure: Pre-processing by reading of value by OPC client.

The second way to pre-process data right in the SNMP OPC Server is creating the new OPC item as JScript Item. This is special OPC Item, whose value is defined by return value of the JScript function, in which none, single or several SNMP values from defined SNMP devices stored in the database can be processed .
For creation of such script Item, user has to push the right mouse button on the item Address space in Item list control. From the pop-up, command New -> Script item has to be choosen. (These items can't be organized in the folder structure and added to existing devices). After choosing this command following dialog will be displayed
The user can define the name of the new OPC (Script) item, its description and data type (the same data type as returned value of JScript is the condition for this data type value) here.
Next, user can define the items which will be presented as input arguments of JScript. These items can be already defined items with OID in the database or new OID items but from defined devices. If the user wants to use as input argument the existing SNMP values, than he can choose these values from he predefined list or he can type the new value os OID (in the box Device, the device which has the item with new OID, has to be choosen).

Figure: Configuring of OID's that have to be used by computing JScript OPC item.
In the edit box JS variable name (Figure above), user defines the name of chosen SNMP value which will represent this value in the JScript. Here user can find the list of all defined values that will be used as input arguments for JScript. The values can be also removed from this list.
The body of the JScript is in the bottom part of the configuraton dialog. The function header and input arguments are created automatically, user only defines the body of the script.

Figure: Pre-processing by reading of JScript OPC item by OPC client.
According to client's requirements for reading of this script item, the server starts the JScript, reads all input values, processes the JScript and then returns processed value back to the client.
Send feedback on this topic.
Copyright © 2004-2013, SAE - Automation, s.r.o. (Ltd.), All rights reserved.