Code a Mimic Script
When you have displayed the Script Editor for a Mimic, you can use it to code a new Mimic script or edit an existing Mimic script. (For information on the Script Editor, see Display the Script Editor for a Mimic).
To code a Mimic script, you need to have an in-depth knowledge of VBScript. You also need an appreciation of the ClearSCADA-specific functions and properties that are available for use in your Mimic scripts.
ClearSCADA provides a range of functions and properties that you can use in your Mimic scripts. These ClearSCADA-specific functions and properties derive from ClearSCADA Script Objects, which include:
- Application objects
- Menu objects
- Form objects (some of the Form functions and properties return another type of object called a ControlObject which also has its own functions and properties).
- Mimic objects (these objects have functions and properties that are only available for use in Mimic scripts).
- Server objects (some of the server functions and properties return another type of object called a ServerObject which also has its own functions and properties).
NOTE: There is also an Alarm Banner object, but it is only available for use with Alarm Banner Scripts.
Collectively, the categories of script objects are sometimes referred to as global objects.
So, in your Mimic scripts, you can use the following functions and properties:
- Global Functions. These are functions that are available for each type of script object.
- Application Functions and Properties
- Menu Functions
- Form and Control Object Functions and Properties
- Mimic Functions and Properties
- Server and ServerObject Functions and Properties.
When coding a script, you can use the script’s context sensitive menu to access useful features such as Cut, Copy, Paste, Find, Replace, Go To, various Breakpoint options for debugging, and also the Libraries option for referencing Script Libraries (see Using a Script’s Context Sensitive Menu).
There are also several keyboard shortcuts that you can use when editing a script. The following table summarizes the supported key strokes.
Key(s) | Action |
---|---|
CTRL + A |
Selects all of the text in a script. |
CTRL + F |
Displays the Find window. You can use the Find window to locate specified characters in the code. |
CTRL + G |
Displays the Go To Line window. You can use the Go To Line window to move the cursor to a specific line in the code. |
CTRL + H |
Displays the Replace window. You can use the Replace window to locate and replace specified characters in the code. |
CTRL + Home |
Moves to the cursor to the start of the script. |
CTRL + End |
Moves the cursor to the end of the script. |
CTRL + right arrow key |
Moves the cursor to the next word in the script. |
CTRL + left arrow key |
Moves the cursor to the previous word in the script. |
CTRL + up arrow key |
Scrolls the script up. |
CTRL + down arrow key |
Scrolls the script down. |