Actions

Difference between revisions of "External Data Input"

From Zenitel Wiki

(Example)
Line 1: Line 1:
 +
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
 +
* Parsing the content is done in the action string in the Event Handler
 +
 
==Event description==
 
==Event description==
 
{|  
 
{|  
Line 19: Line 24:
  
 
==Additional information==
 
==Additional information==
*Input message
 
:- The EDI port is defined in the ‘Serial Ports’ Setup
 
:- The input message must have a termination character. Max 128 char.
 
:- Parsing the content is done in the action string in the Event Handler
 
 
 
*Context parameters
 
*Context parameters
 
:- [[Edi (macro)|%edi]] is the input text where termination character is excluded
 
:- [[Edi (macro)|%edi]] is the input text where termination character is excluded

Revision as of 22:10, 30 September 2008

The EDI ports are defined in AlphaPro: Exchange & System -> Serial Ports.

  • The input message must have a termination character
  • Maximum 128 characters
  • 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 – 4: 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
- %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
  • %sscan - Scan for string, extract rest of string after first match
  • %scmp - Compare strings
  • TMP - Set temporary variable
  • %tmp - Read temporary variable


Example

EDI - External Data Input (3).jpg

The rule below will allow you to issue commands to EDI port like this:

  • Input command on EDI serial port: connect,101,103
- Generates internal command $CALL L101 L103
  • Input command on EDI serial port: disconnect,101,103
- Generates internal commands $C L101
tmp 0 "%scutf(%edi,\,,0)"
tmp 1 "%scutf(%edi,\,,1)"
tmp 2 "%scutf(%edi,\,,2)"
if %scmp(%tmp(0),connect)
 $CALL L%tmp(1) L%tmp(2)
 stop
endif
if %scmp(%tmp(0),disconnect)
 $C L%tmp(1)
endif