Cicode Programming Reference > Cicode Function Categories > ActiveX Objects Introduction > ObjectAssociatePropertyWithTag

ObjectAssociatePropertyWithTag

Establishes an association between an ActiveX property and a variable tag. This means that any changes made to an ActiveX object property will be mirrored in the variable tag.

Generally, ActiveX objects issue "property change notifications" to CitectSCADA whenever a change occurs to a specific property value. This notification tells CitectSCADA when to read the property value.

Note: An association will not succeed if property change notifications are not supported and the OnChangeEvent argument is left blank. Verify that the scaling and units of the associated tag are compatible with the ActiveX property values. However, some property changes do not trigger property change notifications. If this is the case, you need to choose an appropriate "on change" event instead - an event fired by the ActiveX object in response to a change. An "appropriate" event is one that happens to be fired whenever the property value changes. For example, the MS Calendar Control fires an AfterUpdate event whenever a day button is pressed.

Syntax

ObjectAssociatePropertyWithTag(sObject, sPropertyName, sTagName [, sOnChangeEvent] )

sObject:

The object instance that associates a property with a tag.

sPropertyName:

The name of the ActiveX property to associate with the tag.

sTagName:

The name of the CitectSCADA variable tag to associate with the property.

sOnChangeEvent:

The name of the "on change" event that informs CitectSCADA of a change to the ActiveX object. This is required where the ActiveX object does not automatically generate a property change notification. Choose an event that happens to be fired whenever the ActiveX object property changes, for example, the MS Calendar Control fires an AfterUpdate event whenever a day button is pressed.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

DspAnCreateControlObject, CreateObject, CreateControlObject

See Also

ActiveX Functions