9.1 Script type

Introduction

Script is applied to realize complex control functions. HMI compile software provide powerful function, simple operation, reliable script system, the features of script are list as follow:

1) Similar to BASIC grammatical structure;

BASIC work as the first computer language for the general public, it is easy and efficient to use.

2) Support all of program logic control structures;

Software script supports three logic control structures: order, condition, loops. It could realize complexity procedures.

3) Powerful function; Functions of script are divided into two types: system and custom function.

  • System function: the functions that system has been predefined for users.

  • Custom function: users could define a function and apply to all scripts.

  1. Support variety of data format;

Script supports integer, floating, BCD code, byte, string and etc.

Scripts have two types of running

1) Background script: Run independently during start project, screen updates have no influence and valid of all scripts.

2) Screen script: Only run under the designated screen. Screen script start running until screen is closed or switched.

And both screen and background have four modes for script

Initialize

Introduction

Initialize script divided into screen initialize script and background initialize script. Screen initialize script runs once during the initialization of screen; background initialize script runs during the loading of project.

Operating procedures

  1. Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

  1. Double click [initialize] to open script edit window, as below shows;

  1. Enter scripts in edit window;

Close

Introduction

Close script divided into screen close script and background close script. Screen close script runs once During the destroying of screen because of closing or switching; background close script runs during the closind of project (such as restart HMI, into HMI setup).

Operating procedures

  1. Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

  2. Double click [Close] to open script edit window;

  3. Enter scripts in edit window;

Timing

Introduction

The script would run for a designated time interval.

Operating procedures of creating one

1) Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

2) Double click [Timing], it would pop-up below setting window;

3) Enter scripts in edit window;

Operating procedures of editing

1) Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

3) Double click selected [Timing] to open editing window;

Operating procedures of deleting

1) Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

3) Select [Yes] to execute operation or select [No] to cancel operation;

Note:

The maximum number of timing script for each screen or background is 32.

Trigger bit

Introduction

Trigger control script is that software will check whether the designated bit meet trigger condition every 20ms. Script execute once condition is met until project closed.

Operating procedures of creating one

1) Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

2) Double click [Trigger bit], it pops-up below setting window;

Bit address: It sets trigger address for script;

Condition: detailed information as below shows;

3) Set trigger bit and condition, click [OK] to open editing window;

Operating procedures of editing

1) Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

3) Double click selected [Trigger script] to open editing window;

Operating procedures of deleting

1) Click [Background script] in project manager to enter script editor screen, or click [Screen script] in right click menu of screen to enter script editor screen;

3) Select [Yes] to execute operation or select [No] to cancel operation;

Note:

The maximum number of trigger script for each screen or background is 32.

Background Function

Introduction

Global function is a collection of codes; it can be called in any script. The method reference system function;

Operating procedures

1) Double click [Background function] in project manager;

2) Set parameters;

Operating procedures of editing

1) Click [Background function] in project manager to enter script editor screen;

3) Double click selected [Trigger script] to open editing window;

Operating procedures of deleting

1) Click [Background function] in project manager to enter script editor screen;

3) Select [Yes] to execute operation or select [No] to cancel operation;

Note:

The maximum parameters for each function are 4, and parameter name can't be unique;

Last updated