For the optimization of the data transfer rate each data client (in this case the PmaOpcClientGroup object) informs the OPC server how it wants to share the specified data. By one of these optimizing parameters it is possible for the data group to set if the group is active (see the "Parameters" page and the ActiveGroup property). If the group is not active (nor other clients require these data), then the OPC server needn't update these data in its CACHE memory and thus it can update other data more often.
Another optimization is the selection of the data receipt mode. The OPC client can decide if it'll receive the data automatically (and thus it wants the OPC server to sent it the data values that were changed) or if it wants to control the data itself (read and write to the OPC server on a request).
If the OPC client is to receive the data automatically, then it must enable the update for the group (see the "Parameters" page and the Update property). If the update is enabled, then the OPC server sends changed data values of this group automatically to the client. The update can be further optimized by setting the parameters: the minimum update rate and the dead band (see UpdateRate property and Deadband property). It means that the OPC server won't sent the data to the client faster that it is defined in the minimum update rate and it won't sent the data if the change of the value is less than the dead band (the change from the last sent value to the client is meant).
If the OPC client is to read and write to the OPC server itself, then it is advisable to disable the automatic update. It is possible to leave the automatic update activated while writing, but this combination may cause that before the client writes the required value to the OPC server, this value is updated from the server. This means that the value being written into the OPC server is already there.
For similar reasons it is often desirable - if you want to read the items and to write into them at the same time - rather to create two OPC groups (two PmaOpcClientGroup objects). One group will be determined for reading and the other for writing. Thus the real value states can be better controlled.
In the PmaOpcClientGroup object, the #vars identifier enables access to the variables (of the PmVar type) defined on the "Data" page. This identifier can be used e.g. for the Pm method, or for the PP data binding in the application and in panels. For example the method pMe.Pm("opcdata/#vars/aaa") returns the aaa variable from the object named opcdata that is of the PmaOpcClientGroup type.
The variables in the PmaData object can use ExtOpcClient and register themselves directly into the PmaOpcClientGroup object. Then, on the "PmaOpcClientGroup > Data" page, it is not necessary to define any variables.
Some OPC servers (for Simatic, Schneider, Bernecker&Reiner ..) can transfer a data array (Array) in one data item (the common limitation is that all data array items must be of the same data type). If it is necessary to receive/send such data as well, then the "Data type" configurator has to be set to Variant data type for the variable (this is disabled in PmRtFree - Free runtime license).
When receiving data containing item of the Array type, the PROMOTIC system modifies this item into the standard form (e.g. the Integer values array is transformed into the Variant values array of the Integer type). Then one item from this array can be read e.g.
var arr = oOpcData.Item(x).Value;
var val = arr.GetItem(y);
When sending the data containing the item of the Array type it is necessary to save a vector, that is not in the standard form, into this item. It can be done e.g. by the Pm.TransformValue method with parameter 41 e.g.