Details:
At project startup, HDS performs configuration and integrity check on each configured database. To do this, HDS must have access to the database server and to each database. Once these initializations are done, if a database link is broken then HDS switches to write mode in temporary .hds files as explained in (How .hds files work ?). If the database initialization phase could not be done at project startup, please note that the mechanism of writing to temporary files does not work. In this case, users should be informed immediately so that they can re-establish the link to the concerned database and restart the project. This article provides an example of a Scada Basic function to be executed at project startup to warn the user if this happens. In this example the database is named DB1 and the project is single-station. The script and the method should therefore be adapted to your architecture. For example, it will be useless to open a warning mimic if PcVue is running as a service, in which case it is better to force a general alarm created for this purpose.
A screenshot of the attached sample mimic:
Sample Scada Basic script:
sub main() ‘The following 6 lines are used to alert the user in case of a DB1 database initialization problem (replace DB1 by another database name depending on your project) If (Variable(“STATUS”, “@System.HDS.DB1.Disconn”, 1)==0) Then ‘Variable does not exist? If the DB is not available the first time the project is started Window(“OPEN”, “HdsWarning”, “@System.HDS.DB1.Disconn” ); ‘Open the warning mimic with system variable name as branch End If If (Variable(“STATUS”, “@System.HDS.DB1.Disconn”, 2)==0) Then ‘Variable is invalid? If the variables have already been created but the DB is not accessible Window(“OPEN”, “HdsWarning”, “@System.HDS.DB1.Disconn” ); ‘Open the warning mimic with system variable name as branch End If end sub
Sample mimic: HdsWarning.zip
Sample script: PROGEXECUTED.zip
|