Back

Topic

[KB143]How to start a SCADA Basic Program when a mimic opens

Tags: Scada Basic, Scripting

15 years ago
By RM
Options
Print
Applies to:

PcVue all versions.


Summary:

This article describes how to make a SCADA Basic Program run when a particular mimic opens.
From version 11.0 onwards it is not necessary to use this manual configuration as you can select the program in the Window configuration dialog.


Details:

You can start a SCADA Basic procedure automatically when a mimic opens.

Solution

  1. Open the Options dialog from the main menu (Configure.Options).
  2. In the File Format section, set the default format for saving mimics to ‘Ascii format’.

Configure_Options_dialog_Mimics_in_ASCII

  1. Save the mimic (i.e. in ASCII format).
  2. Open the mimic in a text editor.
  3. Locate the section on Window Properties (starting with W,BEGIN and ending with W,END).
  4. In the line containing BEFORE,””,””,””,””  specify the Program name, branch, procedure name (if used) and arguments for the program.
  5. Save and close the file.

If the program is already loaded (e.g. at start-up, see below) when the mimic is opened, the specified  program or procedure will run.

Example

In the example below when a mimic MyMimic is opened, the procedure MyProcedure in the INIT program is called.

ASCII32,24,6,2005,16:30,46
W,BEGIN,”MyMimic”,”Mimic1″,””
TEMPLATE,””,0,0,0,0,0,0,0,0,0,0,0,0,1
POSITION,208,0
SIZE,498,337,498,337,0,0,0,1024,768,486,299
BACKCOLOR,236,233,216,0,0,0
TITLE,1,”Mimic1″,””
STYLE,1,1,1,1,0,1,0,1,1,1,1,1,1,0,0,0,0
GRID,1,1,8,8,160,160,160,0,0,0
LAYERS,65535
RIGHTS,0,1,0.000000,64.000000,1,65535,0,0
INCLUDED,0,0,0,0,0
LINK,1,””,””,””,””
LINK,2,””,””,””,””
LINK,3,””,””,””,””
LINK,4,””,””,””,””
LINK,5,””,””,””,””
LINK,6,””,””,””,””
LINK,7,””,””,””,””
LINK,8,””,””,””,””
LINK,9,””,””,””,””
LINK,10,””,””,””,””
BACKBMP,””,0,0
BACKOBJECT,””,0,0
BEFORE,”INIT”,””,”MyProcedure”,””
EVENTS,1
BINOBJ,”MyMimic.binary”
W,END
VBA_REFERENCES,BEGIN
“stdole”, 2, 0, “{00020430-0000-0000-C000-000000000046}”
VBA_REFERENCES,END
FONTS,BEGIN
FONTS,END
COLORS,BEGIN
COLORS,END

Notes

  • In the example above, the program is started without branch or arguments. You must leave the corresponding fields empty (i.e. only use “”).
  • Only alphanumeric characters (and underscore) are allowed in the names of SCADA Basic programs and procedures. Spaces are not allowed.
  • Program arguments (10 maximum), must be separated with commas, e.g. Arg1, Arg2, Arg3.

Further information

To make a program load when PcVue starts, see the topic Project Start-up Options in the main Help.


Created on: 05 Nov 2010 Last update: 13 May 2024