68 lines
1.9 KiB
Markdown
68 lines
1.9 KiB
Markdown
---
|
||
task: Create a trigger group, class and object with quick load files
|
||
version: R1.03
|
||
source: IM 36K10G10-01EN §5.1–5.3; IM 36K10J10-01EN §5.6; practiced with CI-Eng-Sample 2026-09-30
|
||
status: verified
|
||
---
|
||
|
||
# Trigger group, class and object via quick load
|
||
|
||
Load in this order (each with `dssqld -i <file>.qli -l <file>.qlo`, check `Errors` = 0);
|
||
remove in reverse (object, class, trigger group) with `NAME`-only files and `dssqld -r`.
|
||
|
||
**1. Trigger group** (`TRIGGER_DF`, name max 16 characters):
|
||
|
||
```
|
||
@FIELDS
|
||
NAME,DESCRIPTION,TRIGGER_INTERVAL
|
||
|
||
@TRIGGER_DF
|
||
"CIENG_1S","CI-Eng-Sample one second trigger","1 seconds"
|
||
```
|
||
|
||
**2. Class** (`CLASS_DF`, name max 16 characters). The source goes in the `METHOD` memo field,
|
||
between `@"` and `"@` on their own lines; `COMPILE` 1 compiles it on load; `TRIGGER_1`
|
||
attaches a trigger group:
|
||
|
||
```
|
||
@FIELDS
|
||
NAME,DESCRIPTION,PF_LANGUAGE,TRIGGER_1,COMPILE,LISTING_WANTED,METHOD
|
||
|
||
@CLASS_DF
|
||
"CIENG_INCR","Count CI-Eng-Sample.DEMO.COUNTER 1..100","Traditional","CIENG_1S",1,1,\
|
||
@"
|
||
CLASS CIENG_INCR;
|
||
PROLOG
|
||
SIGNAL INPUT := "CI-Eng-Sample.DEMO.COUNTER";
|
||
BODY
|
||
METHOD UP_AND_DOWN;
|
||
BODY
|
||
IF (INPUT >= 100) THEN
|
||
INPUT := 0;
|
||
ENDIF;
|
||
INPUT := INPUT + 1;
|
||
ENDMETHOD UP_AND_DOWN;
|
||
ENDCLASS CIENG_INCR;
|
||
"@
|
||
```
|
||
|
||
The item a `SIGNAL` names must exist first (or be created by the class with `FROM … MAKE`).
|
||
|
||
**3. Object** (`OBJECT_DF`): full name in its section, and the class:
|
||
|
||
```
|
||
@FIELDS
|
||
NAME,DESCRIPTION,CLASS
|
||
|
||
@OBJECT_DF
|
||
"CI-Eng-Sample.DEMO.INCR1","Counts DEMO.COUNTER every second","CIENG_INCR"
|
||
```
|
||
|
||
## Check
|
||
|
||
Run `itmval -g -n CI-Eng-Sample.DEMO.COUNTER` a few seconds apart: the value rises by one per
|
||
second. To inspect a class, export it with a filter file (`@SELECT`, then
|
||
`'NAME = "<class>"'`, then `@CLASS_DF`).
|
||
|
||
Example files: `examples/CI-Eng-Sample/05_trigger_df.qli`, `06_class_df.qli`, `07_object_df.qli`,
|
||
`86_` to `88_remove_*.qli`.
|