| ||||||||||||||
|
OPC settings
| ||||||||||||||
|
After the program is loaded, it analyzes the configuration tree and items are added to the internal structures of the data program during this analysis. The existence of items on the server is also checked during this analysis. This process may take from several seconds to several minutes depending on the OPC server. If an item does not exist, the corresponding message is added to the log and this item will be highlighted in red when you open the configuration. If the OPC server is sending data, the program will immediately start receiving data from it provided that the configuration tree is not empty. Also, the program will send data received from the core to OPC servers for the corresponding items.
The following happens when data is being received from an OPC server:
When data is received, the server name will be added to the item name if the "Add server name to item name" checkbox is selected in the group properties. The <;>, <">, <['>, <]> characters in server and item names are replaced with the <_> character. If an item is of the string type, the <\>, <"> characters are replaced with <\\>, <\">, if a character has a code within the range $00..$1F, <\x> characters are added before the character.
The following happens when data is being sent to an OPC server
Groups, servers and variables
Data can be sent and received at any time. The "OPC groups, servers and variables" tree is used for that. For the program to be able to receive/send data, you should add at least one group with one item. The tree allows you to add, remove, edit, view and assign other names to items and also move items and groups.
Select the "OPC settings" tab in the settings dialog box and you will see the group and item tree on the screen. It is empty by default.
OPC Settings.
Fig.1. OPC Settings.
Data source name – the field contains any name that will denote the operations performed with OPC servers.
OPC groups, servers and variables – the tree contains groups of servers and variables used to send/receive data.
Action – the button allows you to add groups and items from OPC servers to the configuration, remove groups and items, assign new names to items, view and edit data, move groups and items up/down the tree. You can right-click the tree instead of this button and you will see the same menu that you see when you click the "Action" button.
Fig. 2. The action menu after a right click on a group
Fig. 3. The action menu after a right click on an item
Adding a group:
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Add group..." item and you will see the Group properties dialog box on the screen (Fig. 4).
Fig. 4. Group properties.
Name – the field contains the name of the group. The name may contain any characters. By default, it is Group XXX, where XXX is the number of the group.
Update rate (msec) – the field contains the update rate of items in the group when they are read from the OPC server. The value is specified in milliseconds. By default, 1000 milliseconds, i.e. 1 second.
Dead band (%) – the field contains the value of the dead band in percent. The default is 0 percent.
Active – the checkbox defines whether the group is active. If it is selected, items from this group will be exported (items will be read from servers), if it is not selected, they will not be exported (items will not be exported). By default, the checkbox is selected.
Export valid values only – the checkbox enabled/disabled exporting only valid values. If it is selected, only those items in the group whose value is OPC_QUALITY_GOOD will be exported, if it is not selected, the quality of the item value is not taken into account. By default, the checkbox is selected.
Don't export NULL value – the checkbox allows you not to export items with null values. If it is selected, items in the group that have a null value will not be exported, if it is not selected, the null value of an item is not taken into account. By default, the checkbox is selected.
Wait till all items are updated – the checkbox enables/disables waiting till all items in the group are updated. If it is selected, items in this group will be exported only when all items in the group are updated (the "Export valid values only" and "Don't export NULL values" checkboxes are taken into account during export), if it is not selected, all items will be exported taking into account the "Export valid values only" and "Don't export NULL values" checkboxes. By default, the checkbox is selected.
Note: See the paragraph "How it works" for more details about the export algorithm.
After you specify the group properties, click the "OK" button to save the properties or the "Cancel" button to cancel it. The dialog box will be closed and a new group will appear in the tree.
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Add item..." item and you will see the Item properties dialog box on the screen (Fig. 5).
Fig. 5. Automatic mode item properties.
Servers – the list contains the list of available OPC servers.
Info – the group shows brief information about the selected OPC server.
Prog ID – the field shows the program identifier (the name of the program).
Description – the fields shows the brief description of the server.
DA support – the fields shows the supported DA.
Vendor – the field shows the name of the vendor.
Connect – the button connects the program to the server and after that items (if there are any on the server) appear in the "Items" list. It is also possible to connect to the server with a double click on the server selected in the "Servers" list.
Selecting items mode – the list allows you to select one of the modes for item selection/input. There are two modes available: Automatically retrieve items from a server and Manual mode.
Items – the list contains items available on the selected server. There is a checkbox next to each item. It enables/disables adding the corresponding item to the tree (Fig. 1) after you click the "OK" button and close the dialog box. Once a connection is established to the server, the checkboxes of all items are selected. You can select or clear a checkbox by clicking it. Also, you can use the menu (Fig. 6) opened with a right click on the list.
Fig. 6. Item menu.
Select all (Fig. 6) – select the checkboxes of all items.
Clear all (Fig. 6) – clear the checkboxes of all items.
Invert selection (Fig. 6) – invert the checkboxes of all items.
Info – the group shows information about the selected item.
ID – the column shows the item identifier. It cannot be edited.
Description – the column shows the brief description of the item. It cannot be edited.
Type – the column shows the item type. It cannot be edited.
Value – the column shows the item value. It cannot be edited.
Fig. 7. Manual mode item properties.
Items – the text field allows you to type items manually. The number of items is unlimited.
Removing an item:
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Delete" menu item and you will see the confirmation dialog box on the screen. Click the "Yes" button in this dialog box and the group or the item will be removed from the tree after that. If you change your mind, click the "No" button. The "Delete" menu item is not available when the tree is empty.
Editing a group:
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Edit..." menu item and you will see the Group properties dialog box on the screen (Fig. 4). Note: Note that a group must be selected in the tree, otherwise you will not see this menu item.
See "Adding groups:" for the description of group properties.
Note: See the paragraph "How it works" for more details about the export algorithm.
After you specify the group properties, click the "OK" button to save the properties or the "Cancel" button to cancel it.
Viewing information about an item:
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Info..." menu item and you will see the Item properties dialog box on the screen (Fig. 8).
Fig. 8. Item properties.
All item properties except the "Info" group will be unavailable. Click the "Close" button after you view the information. Note: Note that an item must be selected in the tree, otherwise you will not see this menu item. See "Adding an item:" for the description of item properties.
Assigning another name to an item:
Click the "Action" button or right-click the "OPC groups, servers and variables> tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Assign another name..." menu item and you will see the dialog box where you can type a new name for the item. Type a new name for the item and click the "OK" button – the new name of the item will appear in the tree. Note that the name must differ from those already existing in the tree, otherwise you will see the corresponding message on the screen and the item will not be renamed.
Note 1: It is this assigned item name that is used during export/import, not the one in the tree. By default, the assigned name has the same value as the value selected when the item was added.
Note 2: Note that an item must be selected in the tree, otherwise you will not see this menu item.
Moving a group or an item up:
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Up" menu item and the group or the item will move one position up. If a group or an item is the only one or if there are no groups and items at all, the menu item will be unavailable.
Moving a group or an item down:
Click the "Action" button or right-click the "OPC groups, servers and variables" tree and you will see the action menu (Fig. 2 or Fig. 3). Select the "Down" menu item and the group or the item will move one position down. If a group or an item is the only one or if there are no groups and items at all, the menu item will be unavailable.
Note: you can add any number of groups and items with different parameters. | ||||||||||||||
Ask a question about this topic
| ||||||||||||||
|