# How many trigger resources can be used in a single trigger program?

### 问题：

How many trigger resources can be used in a single trigger program?

### 答案：

A trigger program is made up of one or more states up to 16. Only one state is active at a time. Each state is made up of one or more clauses. If you use more than four trigger event resources in a state, you can have up to four clauses per state. However, if you have four or fewer trigger event resources in a state, you can define up to 16 clauses per state.

Clauses are made up of two parts: an If statement, that defines the data event of interest, and the Then statement, which specifies the action taken when the If statement is true. You can define up to eight events per If statement and up to eight trigger actions per Then statement.

In any given trigger program there is a maximum of 18 possible trigger resources that can be used (there are also constraints on specific combinations of recognizers). In any given trigger clause there is a maximum of 8 possible trigger resources that can be used.