Difference between revisions of "External Data Input"
From Zenitel Wiki
(New page: ==Event description== {| border="1" cellpadding="4" ! align="left"|Event Owner: | EDI Text Config |- ! align="left"|Event type: ...) |
(→Additional information) |
||
(43 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{AI}} | ||
+ | The EDI ports are defined in AlphaPro: [[Exchange_%26_System_%28AlphaPro%29#Serial_Ports|Exchange & System -> Serial Ports]]. | ||
+ | * The input message must have a termination character | ||
+ | * Maximum 128 characters. If longer strings, the first 128 characters will be returned, the rest will be ignored. | ||
+ | * Parsing the content is done in the action string in the Event Handler | ||
+ | |||
==Event description== | ==Event description== | ||
− | + | {| | |
− | + | |- | |
− | + | |width="200pt"|'''Event Owner''': | |
− | | EDI Text Config | + | |width="300pt"|EDI Text Config |
|- | |- | ||
− | + | |'''Event type''': || 28 - External Data Input | |
− | | External Data Input | ||
|- | |- | ||
− | + | |'''Subevent''': || 1 – 10: specifies which EDI port<br>0: matches all ports | |
− | | 1 – | ||
|- | |- | ||
− | + | |'''When change to ON''': || When valid data is received on EDI port | |
− | | When valid data is received on EDI port | ||
|- | |- | ||
− | + | |'''When change to OFF''': || N/A | |
− | | N/A | ||
|- | |- | ||
− | + | |'''When related to''': || N/A | |
− | | N/A | ||
|- | |- | ||
|} | |} | ||
+ | <br> | ||
− | * | + | ==Additional information== |
− | :- | + | *Context parameters |
− | :- The | + | :- [[edi (macro)|%edi]] is the input text where termination character is excluded |
− | : | + | :- [[%sev]] is the EDI port (sub-event) |
+ | |||
+ | *Useful macros and statements | ||
+ | :* [[%scutc]] - Extract substring by byte (character) position | ||
+ | :* [[%scutf]] - Extract field, fields defined by delimiter character | ||
+ | :* [[%strlen]] - Return length of string | ||
+ | :* [[%sscan]] - Scan for string, extract rest of string after first match | ||
+ | :* [[%scmp]] - Compare strings | ||
+ | :* [[Tmp_statement|TMP]] - Set temporary variable | ||
+ | :* [[%tmp]] - Read temporary variable | ||
+ | |||
+ | {{note| The NUL character (ASCII 0x00) cannot be used in the EDI string. The processing of the string will be terminated when receiving NUL.}} | ||
+ | |||
+ | == Example == | ||
+ | When receiving the text string "Start alarm 3", terminated by Line Feed character, play alarm message 3 (8193) to group 85: | ||
+ | |||
+ | [[Image:EDI example.PNG|thumb|left|1200px|Trigger event by text string from external device]] | ||
+ | <br style="clear:both;" /> | ||
− | |||
− | |||
− | |||
− | + | [[Category:Event Handler]] | |
− | + | [[Category:Event types]] | |
− | |||
− | : | ||
− | : |
Latest revision as of 09:39, 10 October 2023
The EDI ports are defined in AlphaPro: Exchange & System -> Serial Ports.
- The input message must have a termination character
- Maximum 128 characters. If longer strings, the first 128 characters will be returned, the rest will be ignored.
- Parsing the content is done in the action string in the Event Handler
Event description
Event Owner: | EDI Text Config |
Event type: | 28 - External Data Input |
Subevent: | 1 – 10: specifies which EDI port 0: matches all ports |
When change to ON: | When valid data is received on EDI port |
When change to OFF: | N/A |
When related to: | N/A |
Additional information
- Context parameters
- Useful macros and statements
- %scutc - Extract substring by byte (character) position
- %scutf - Extract field, fields defined by delimiter character
- %strlen - Return length of string
- %sscan - Scan for string, extract rest of string after first match
- %scmp - Compare strings
- TMP - Set temporary variable
- %tmp - Read temporary variable
The NUL character (ASCII 0x00) cannot be used in the EDI string. The processing of the string will be terminated when receiving NUL. |
Example
When receiving the text string "Start alarm 3", terminated by Line Feed character, play alarm message 3 (8193) to group 85: