| Details:
You can start a SCADA Basic procedure automatically when a mimic opens.
Solution
- Open the Options dialog from the main menu (Configure.Options).
- In the File Format section, set the default format for saving mimics to ‘Ascii format’.

- Save the mimic (i.e. in ASCII format).
- Open the mimic in a text editor.
- Locate the section on Window Properties (starting with W,BEGIN and ending with W,END).
- In the line containing BEFORE,””,””,””,”” specify the Program name, branch, procedure name (if used) and arguments for the program.
- 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.
|