AddContributor

(VTScada-Layer function. Must be called with a leading backslash.)

Description: Adds a contributor to a container.
Returns: Nothing
Usage: Script Only.
Function Groups: Containers and Contributors
Related to: DeleteContributor |GetContributors |PContributor |
Format: \AddContributor(HandleName, ArrayName, CountName, ContainerObj, ContributorObj, IndexAddress, Value, CountIncrement, ContributorType);
Parameters:  
HandleName
Required. The name of the handle variable in the container module.
ArrayName
Required. The name of the variable in the ContainerObj parameter, that holds an array of values to which the contributor is to be added.
The ArrayName parameter may be invalid if there is no such array in the container.
CountName
Required. The name of the variable in the ContainerObj parameter, that holds a count of the current number of this type of contributor.
CountName may be invalid if no such variable exists in the ContainerObj. Not all contributors need to be counted.
Note that CountIncrement determines the initial change in the count and the contributor must maintain the count.
ContainerObj
Required. The object value of the container tag module.
ContributorObj
Required. The object value of the new contributor to add to the container.
IndexAddress
Required. The address pointer of the variable holding the contributor index.
Value
Required. May be Invalid. The current numeric value to set in the container's ArrayName array.
Value may be Invalid. Value may also be updated at any time by the contributor by scoping into the ArrayName array in the container, and setting the array element at the index that will be set in the variable pointed to by IndexAddress.
CountIncrement
Required. The numeric value that will be added to the variable in the container that has the same name as CountName.
CountIncrement's value is usually a "1" or a "0", indicating whether the contributor is actively contributing its value. The contributor will increment or decrement the value of the CountName variable as the corresponding state of the contributor changes.
ContributorType
Optional string identifier.
Using an alarm contributor as an example, this is might be "HH", "H", "LL", "L", etc.
Comments:

Used only when writing custom tags with code (as opposed to creating them from Context tags). See: Containers, Contributors and Site Tags

This function can be called from the contributor.

Example:

Refer to the tag template provided in the Examples sub-folder of your VTScada installation.