# Types of Blocks

Blocks are categorized as: Trigger Block, Operation Block, Value Block, Logic Block, and Expression. You can drag and drop these blocks from the Library to build a script.

Block is used in a Script/Global Script.

Category | Script | Global Script
Triggers |  |
Operations |  |
Values |  |
Logics |  |
Expression |  |

#### Limits

- Maximum 1000 actions per screen, content, and global script.

- Maximum 1000 operations per action or script section.

## Trigger Block

A trigger is an event that executes an operation. You can also set multiple operations to be executed for one trigger.

For more details, see List of Triggers.

Note: Each script can use only one trigger.

Blocks | Description
| [When] - Set the trigger condition. [Do] - Add the operation block to run. Note: Blocks are different for each triggers. Depending on the trigger block, set the content of the value block to condition.

(Example 1)

Run the operation every 5 seconds.

(Example 2)

Run the operation on a change in the Var1 value.

## Operation Block

Operation block is for executing the defined function.

For more details, see List of Operations.

Blocks | Description
| Set the operation to run. Note: Blocks are different for each operations. Depending on the operation block, you can combine and run value blocks and logic blocks.

(Example 1)

When the operation is run, a buzzer makes a beeping sound.

(Example 2)

When the operation is run, 1 is assigned to Var1.

Note:

- In an Operation block, if you use a value block or logic block that includes a variable with bad quality, the operation works as follows:

- If the variable is used as the target of a write operation, the operation is executed and the Operation Result is True.

- If the variable value is used in a read operation, the operation is skipped and the Operation Result is False.

- Script operations execute, in order, one at a time. However, as the following operations may take some time to complete, they can be interrupted by another trigger operation so operations run simultaneously.

- [Export Alarm Data]

- [Export Log Data]

- [Export Operation Log]

- [Data Logging] - [ClearLogging]

- [Recipe]

- [Security] - [Export]

- [Security] - [Import]

- [Array]*

- [Azbil]

- [File Management]

- [Remote File Management]

- [Delay]

- [Block Trend] - [Clear And Draw]*

- [Block Trend] - [Draw]*

- [Equipment]

*When using local variables only, the operation completes without being interrupted by another trigger operation.

- In general, the following operations cannot be interrupted. However, when one of these operations is used with an array element that is specified indirectly, the operation can be interrupted by another trigger operation so operations run simultaneously.

- [Value Change]

- [String Value Change]

- [Convert Numeric to String]

- [Convert Float to String]

- [Convert String to Numeric/Float]

- [Get String Length]

- [Extract String (Left/Right)]

- [Extract String (Middle)]

- [Search String]

- [Screen Change]

- [Content Change]

- [Log Custom Message]

- [Language Change]

- [File Management]

- [Debug Print]

When there are multiple triggers that run the same operation, an operation interrupted by another trigger operation could change the operation order, resulting in different output.

For example, in the diagram below, Operation 2 in Trigger 2 is run before Operation 2 in Trigger 1. Operation 2 in Trigger 1 is run only after Export Log is complete.

## Value Block

Value block refers to the value of a specified variable or property. You can read or overwrite values that are stored using a value block.

For more details, see Values.

Note: To specify a property in a value block, use a period (.). For example, to specify the text color in NumericDisplay1, set "NumericDisplay1.TextColor".

## Logic Block

The If / If Else block executes an operation depending on the condition specified.

The following logic block runs the defined calculation or logical comparison, and outputs the result.

- Math
- Comparison Condition
- Logical Condition
- Not

For more details, see Logic.

## Expression

The expression block returns result of expression. For more details of expression blocks, see Expression.

For more details of expression converter, see Expression.