Back

Topic

[KB631]CRON.DAT sample project

Tags: Scada Basic

12 years ago
By RM
Options
Print
Applies to:

PcVue version 10.0 SP1 onwards.


Summary:

A sample project for distribution of CRON.DAT on a multi-station system using the SCADA Basic instruction CRONTAB.

The SCADA Basic program, embedded in this project, will also work with earlier versions of PcVue (8.2 or 9.0). Since PcVue 10.0 SP2 Update 26019, PcVue 11 Update 6058, PcVue 11.1 Update 6009, it is recommanded to use another technic du distribute cron.dat file, please see Automatic Broadcast of cron.dat


Details:

Presentation of the project for distribution of Cron.dat

There are three stations configured in the project. You will need to change the network node ID (name or IP address) to match your particular configuration. For the distribution to work at least 2 stations must be active.

For PcVue versions prior to 10 you must manually create the variables in the project and add the programs that automatically broadcast CRON.DAT. The variables are described in the topic Distribution of multi-table schedules. From PcVue version 10.0 onwards the variables can be created using the Application Architect.  The AA models are in the CRON library.  The programs and symbols used in the project can also be found in the library.

Distribution of CRON.DAT is managed by a SCADA Basic program that is launched whenever the file is modified. All the SCADA Basic programs used are in the CRON library. You can directly integrate this library in your project to use the automatic CRON broadcast feature.

cron_mimic_s

Project requirements

The SCADA Basic verb – CRONTAB (“NETWORKBROADCAST”) – is used to send the configuration file to all CRON.DAT PcVue’s defined in the project. The Station List – Modification Client List – is used to manage the distribution and must therefore exist. The list contains the names of all stations to receive the updated CRON.DAT. The list used in the example is called LMDFCLIENT1. (Note that this is not the default name which is LMDFCLIENT01.) If you want to use it in a single station project, you’ll need to declare the station in the modification list.

PcVue variables required: (XX represents station number, 1, 2 etc.)

  • Cron_Mgt.XX.Bdct_InProgBy : Bit variable that determines if a station will broadcast a changed CRON.DAT file. It must be produced by the server XX and consumed by all.
  • Cron_Mgt.XX.Save_ReqFor: Bit variable that determines on which stations the file CRON.DAT should be saved. It must be produced by the server and consumed by all XX.
  • Cron_Mgt.BdctRef_Requested: Bit variable used to request a distribution by the reference station of the file CRON.DAT when starting a station. It is produced by the reference station and consumed by all.
  • Cron_Mgt.CronLastModifDate : Text variable containing the reference date for the CRON.DAT file on each station.
  • Cron_Mgt.Bdct_Completed : Bit variable that is set when the distribution is complete. It is produced by the reference station and consumed by all.

Integration of programs with an existing project

The SCADA Basic programs present in the CRON library should be added to the P directory of the PcVue project using the WebScheduler.

  • The global program: The content of this program must be added to the global program of the existing project. It contains the definition of global variables and the function to change the date. Here is the definition of variables that must be configured by the user.
    • iRefStation  – The station number for the reference CRON.DAT.
    • sCronLocation – Sets the location of the file CRON.DAT. The value can be set in the program Init_CronMgt. (Set the path according to the PcVue version used.)
    • iCronCheckPeriod  – The period in seconds at which the file CRON.DAT in checked.
    • sList – The name of the list used for the dissemination of CRON.DAT file. This variable can be set in the program Init_CronMgt.
  • Program Init_CronMgt : This program allows the loading of programs and initialization of different global variables used. It also creates a file, COPY_CRON.BAT, used to copy the file CTEMP\CRON.DAT to the C folder. It can be called and executed by the startup program already present in the existing project via the SCADA BASIC PROGRAM verb (“START”, …).
  • Program CronMgt : This program contains various functions for monitoring, disstribution and saving the file CRON.DAT.Detailed description]

Sample project:Cron_Demo.zip

Created on: 20 Feb 2013 Last update: 04 Sep 2024