123 lines
4.6 KiB
Markdown
123 lines
4.6 KiB
Markdown
---
|
||
task: Create trigger groups, classes and objects with quick load files
|
||
version: R1.03
|
||
source: IM 36K10G10-01EN §5.1–5.3; IM 36K10L10-01EN §3; IM 36K10J10-01EN §5.6; practiced with CI-Eng-Sample 2026-09-30 (full remove/reload with three classes and objects)
|
||
status: verified
|
||
---
|
||
|
||
# Trigger groups, classes and objects via quick load
|
||
|
||
Load in this order, each with `dssqld -i <file>.qli -l <file>.qlo` and check `Errors` = 0:
|
||
items the classes need (template items, attached items) → trigger groups → classes → objects.
|
||
Remove in reverse (objects, classes, trigger groups) with `NAME`-only files and `dssqld -r`.
|
||
Run `dssqld` from the folder that holds the files and use short relative names (ISS-020).
|
||
|
||
## 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"
|
||
```
|
||
|
||
Other fields: `ACTIVATION_TIME`, `DEACTIVATION_TIME`, `TRIGGER_ONCE` (1 = run once when an
|
||
object is activated), `CORRECT_DAYLIGHT`. A class or object without a trigger group only runs
|
||
on signal triggers, timers and `TRIGGER` statements.
|
||
|
||
## 2. Class (`CLASS_DF`, name max 16 characters; the language allows 15)
|
||
|
||
The source goes in the `METHOD` memo field between `@"` and `"@` on their own lines.
|
||
`COMPILE` 1 compiles it on load; `PF_LANGUAGE` is `Traditional` (default) or `Java` and cannot
|
||
be changed later; `TRIGGER_1`…`TRIGGER_8` attach trigger groups; `PRIORITY` 0–999 picks the
|
||
executor (installed: `OPCEXE1` 0–249 … `OPCEXE4` 750–999).
|
||
|
||
```
|
||
@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;
|
||
"@
|
||
```
|
||
|
||
Several classes (also mixed languages) can share one file and one `@FIELDS` line; leave unused
|
||
fields as `""`. See `examples/CI-Eng-Sample/06_class_df.qli`.
|
||
|
||
**Check the compile**: export the class with a filter file and read the flags after the source:
|
||
`VALID_METHOD` = 1 means compiled; `ATTR_PROMPT_n` shows the class's prompts;
|
||
`RESET_REQUIRED`, `OBJECTS`, `OBJECTS_RESET` matter when changing a class (`change-reset-class.md`).
|
||
|
||
```
|
||
@SELECT
|
||
'NAME = "CIENG_TANK"'
|
||
@CLASS_DF
|
||
```
|
||
`dssqld -e cls.qli filter.qli -l cls.lst`
|
||
|
||
**Compile errors** (verified, Traditional): with `COMPILE` 1 on insert, a class that does not
|
||
compile is **not inserted at all** — the `.qlo` only says `DSI-E-OPCCOMERR, Compilation failed
|
||
with n error(s)`. To see the errors, insert the class with `COMPILE` 0, then update it with
|
||
`dssqld -m` and `NAME,COMPILE,LISTING_WANTED` = `"<class>",1,1`: the update fails the same way
|
||
but the class's `LISTING` field (export as above) now shows the numbered source with
|
||
`**** ERROR: …` after the faulty line. Fix the `METHOD` field and compile again.
|
||
Class language: `traditional-class.md` and `java-class.md`.
|
||
|
||
## 3. Object (`OBJECT_DF`)
|
||
|
||
Full name (its section must exist), class, and `ATTR_VALUE_n` = answer to the class's n-th
|
||
prompt:
|
||
|
||
```
|
||
@FIELDS
|
||
NAME,DESCRIPTION,CLASS,ATTR_VALUE_1
|
||
|
||
@OBJECT_DF
|
||
"CI-Eng-Sample.DEMO.INCR1","Counts DEMO.COUNTER every second","CIENG_INCR",""
|
||
"CI-Eng-Sample.TANK1.CALC","Tank 1 volume (capacity 200 m3)","CIENG_TANK","200"
|
||
```
|
||
|
||
Other fields: `TRIGGER_1`…`8` (object's own trigger groups), `PRIORITY`, `CONTROL_ITEM`
|
||
(item whose status blocks/stops the object and whose value is `STEP`), `ITEMS_MAY_EXIST`
|
||
(allow linking to items that already exist instead of creating them), `LEAVE_ITEMS` (keep
|
||
created items when the object is deleted), `DEBUG`.
|
||
|
||
The item a plain `SIGNAL` names must exist. If the class refuses the object (`ERROR` in the
|
||
prolog, Java `cancel()`, missing item) the row counts as an error and the `.qlo` shows the
|
||
reason (e.g. `OPC-E-INFO, <text>`); nothing is left behind.
|
||
|
||
## Check
|
||
|
||
- Items the object writes: `itmval -g -n <item>` a few seconds apart (sample: `DEMO.COUNTER`
|
||
rises by one per second).
|
||
- Which item each signal got: export `OBJECT_SIGNAL_DF` with filter
|
||
`'OBJECT = "<object>"'`; attribute values: `OBJECT_ATTR_VAL` (same filter).
|
||
- Run state: `opcdbg` (task `opcdbg-checks.md`).
|
||
|
||
## Remove
|
||
|
||
```
|
||
@FIELDS
|
||
NAME
|
||
|
||
@OBJECT_DF
|
||
"CI-Eng-Sample.TANK1.CALC"
|
||
```
|
||
Then `CLASS_DF`, then `TRIGGER_DF`. Deleting an object also deletes the items and sections it
|
||
created (verified); items it only attached stay.
|
||
|
||
Example files: `examples/CI-Eng-Sample/05_trigger_df.qli`, `06_class_df.qli`,
|
||
`07_object_df.qli`, `86_` to `88_remove_*.qli`.
|