CheckAddresses

This subroutine is not a part of the VTScada API. You must write it as part of your communications driver.

Description:

A subroutine called by a driver to check whether any of its reads need to moved, added or deleted in the existing ReadBlocks for that drive.

If so, it will rebuild reads without restarting the application or disabling and then enabling the driver tag

Returns: Nothing
Usage: Script Only.
Function Groups:  
Related to:  
Format: CheckAddresses(AddOnError)
Parameters:  
AddOnError
Required Boolean. TRUE to force a new AddRead even if VTSGetAddr returns an error when rebuilding reads

Comments

If a driver detects a PLC configuration change or other event(*) that could change the result of a VTSGetAddr check, the driver should call CheckAddresses so that all addresses of tags using that driver are re-checked.

(*) As an example, an address that previously failed a VTSGetAddr check might now pass.

Example:

Code for this module will be specific for each driver. The following is an example only of how it might be called.


If Ready && PLCModeChanged;
[
  Driver.CheckAddresses(TRUE);
  PLCModeChanged = FALSE;
]

Where, Ready is a Boolean flag in the driver indicating that the driver has started. PLCModeChanged is a Boolean flag set in the driver's Refresh module when driver's parameter, PLCMode, changes.