13.1. Analog and digital I/O Overview

See below a couple of example screenshots.

Figure 13.1. I/O Maps index

I/O Maps index

Figure 13.2. I/O Map1 control

I/O Map1 control

Software Resource Gpio

Software Resource Mfio (Microabilis-C3)

13.1.1. Physical connections

The IOBOX provides 8 digital inputs, 4 digital output and 2 analog inputs.

The Mfio embedded in Microabilis-C3 provides 7 digital Inputs and 7 Digital Outputs.

13.1.2. Activating MFIO, GPIO and GPIOPC devices and resources

Add the GPIO device and GPIOPC resource with following commands:

[11:43:32] ABILIS_CPX:_a dev:gpio-1

COMMAND EXECUTED

[11:43:33] ABILIS_CPX:_a res:gpiopc-1

Add the MFIO resource with following commands:

[12:34:17] ABILIS_CPX:a res:mfio
[Caution]Caution

Remember to save the configuration using save conf and an Abilis restart are required (i.e. with warm start command).

The GPIO and GPIOPC resources must be activated with the commands:

[09:43:22] ABILIS_CPX:_s p gpiopc-1 act:yes

COMMAND EXECUTED

[09:52:19] CPX_ANTEK-PBX:_d p gpiopc

RES:GpioPc --------------------------------------------------------------------
Run    DESCR:General_Purpose_I/O_Panel_Collector
       LOG:NO        ACT:YES  maxclients:10   XML-TOUT:60    XML-MIN-DELAY:50
- I/O Service ----------------------------------------------------------
wdir:C:\APP\IO\

[10:10:53] ABILIS_CPX:_d p gpio-1
RES:Gpio-1 --------------------------------------------------------------------
Run    DESCR:
       LOG:NO               ACT:YES              LIVE-EXPIRY:10
       -------+-------------------- Digital Input lines -----------------------
       D-IN:  | [DESCR:]
       -------+----------------------------------------------------------------
       1      | 1
       2      | 2
       3      | 3
       4      | 4
       5      | 7
       6      | 5
       7      | 6
       -------+-------------------- Digital Output lines ----------------------
       D-OUT: | [DESCR:]
              | MODE:    PULSE-T:    PULSE-GAP:
       -------+----------------------------------------------------------------
       1      | 1
       2      | 2
       3      | 3
       4      | 4
       -------+-------------------- Analog Input lines ------------------------
       A-IN:  | [DESCR:]
              | UNIT:    MIN:    MAX:    ALM-LO: ALM-HI: HIST:   UPD:    POLL:
       -------+----------------------------------------------------------------
       1      | C        20      21      20      21      5.0     1.0     1.0
       2      | C        -10     40      0.0     40      5.0     1.0     1.0
       ------------------------------------------------------------------------ 

Corresponding command for MFIO:

[12:38:18] ABILIS_CPX:s p mfio act:yes    

COMMAND EXECUTED

[12:38:27] ABILIS_CPX:d p mfio

RES:MfIo ----------------------------------------------------------------------
Run    DESCR:Abilis_Multi_Function_IO_Interface
       LOG:DS        ACT:YES  
       -------+-------------------- Digital Input lines -----------------------
       D-IN:  | [DESCR:]
       -------+----------------------------------------------------------------
       -------+-------------------- Digital Output lines ----------------------
       D-OUT: | [DESCR:]
              | MODE:    PULSE-T:    PULSE-GAP:
       -------+----------------------------------------------------------------
       1      | Gate#
              | PULSE    500          250
       2      | Test
       ------------------------------------------------------------------------

Use the following command to display resource parameters; the command d p gpio-1 ? displays the meaning of all parameters.

[10:43:32] ABILIS_CPX:_d p gpio-1 ?

Gpio resource parameter(s):

DESCR:     Resource description. From 0 up to 79 Alphanumeric extended
           characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation
           marks (E.g.: "str1 str2")
LOG:       State changes log and alarm generation [NO, D, S, A, L, T, ALL] [+E]
           (D: Debug Log; S: System Log; A: Alarm view; L: Local audible alarm;
            T: SNMP traps; +E: Extended Log of state changes, see ref. manual)
ACT:       Operation activation [NO, YES]
LIVE-EXPIRY: Expiry timeout programmed to GPIO device [10..600 sec]
---------- Digital Input lines ------------------------------------------------
D-IN:      Digital Input Line identifier [1..64]
DESCR:     Description of Digital Input Line.
           From 0 up to 60 characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation marks
           (E.g.: "str1 str2")
---------- Digital Output lines -----------------------------------------------
D-OUT:     Digital output Line identifier [1..64]
DESCR:     Description of Digital Output Line.
           From 0 up to 60 characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation marks
           (E.g.: "str1 str2")
MODE:      Operatinal mode [VALUE, PULSE]
PULSE-T:   Duration of ON pulse [1..4294967295 ms]        <Only for MODE:PULSE>
PULSE-GAP: Minimum OFF time after ON pulse [1..65535 ms]  <Only for MODE:PULSE>
---------- Analog Input lines -------------------------------------------------
A-IN:      Analog Input Line identifier [1..16]
DESCR:     Description of Analog Input Line.
           From 0 up to 60 characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation marks
           (E.g.: "str1 str2")
UNIT:      Unit of subsequent values. Empty or from 1 up to 8 characters
           (e.g. kWh, J, Volts, m, km, miles, myunit). Case is preserved.
MIN:       Value corresponding to 0x0000. It must be < MAX.
           String representing a floating point number from -9999 to +9999.
           From 1 up to 6 characters in ['+', '-', '0'..'9', '.'].
MAX:       Value corresponding to 0x03FF. It must be > MIN.
           String representing a floating point number from -9999 to +9999.
           From 1 up to 6 characters in ['+', '-', '0'..'9', '.'].
ALM-LO:    Low threshold for alarm. It must be < ALM-HI and >= MIN, autoadjust
           against MIN.
           String representing a floating point number from -9999 to +9999.
           From 1 up to 6 characters in ['+', '-', '0'..'9', '.'].
ALM-HI:    High threshold for alarm. It must be > ALM-LO and <= MAX, autoadjust
           against MAX.
           String representing a floating point number from -9999 to +9999.
           From 1 up to 6 characters in ['+', '-', '0'..'9', '.'].
HIST:      Hysteresis for ALM-LO and ALM-HI for returning to NORMAL state.
           String representing a floating point number from -9999 to +9999.
           From 1 up to 6 characters in ['+', '-', '0'..'9', '.'].
UPD:       Difference that must occur between the last value delivered and the
           current value read in order to make a new value delivery.
           Absolute value, valid for positive and negative variations.
           String representing a floating point number from -9999 to +9999.
           From 1 up to 6 characters in ['+', '-', '0'..'9', '.'].
POLL:      Polling period [0.1..300.0 sec] 

Corresponding command for MFIO:

[12:38:32] ABILIS_CPX:d p mfio ?

MfIo resource parameter(s):

DESCR:     Resource description. From 0 up to 79 Alphanumeric extended
           characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation
           marks (E.g.: "str1 str2")
LOG:       State changes log and alarm generation [NO, D, S, A, L, T, ALL] [+E]
           (D: Debug Log; S: System Log; A: Alarm view; L: Local audible alarm;
            T: SNMP traps; +E: Extended Log of state changes, see ref. manual)
ACT:       Operation activation [NO, YES]
---------- Digital Input lines ------------------------------------------------
D-IN:      Digital Input Line identifier [1..7]
DESCR:     Description of Digital Input Line.
           From 0 up to 60 characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation marks
           (E.g.: "str1 str2")
---------- Digital Output lines -----------------------------------------------
D-OUT:     Digital output Line identifier [1..7]
DESCR:     Description of Digital Output Line.
           From 0 up to 60 characters. Case is preserved. Spaces are allowed.
           Strings holding spaces must be written between quotation marks
           (E.g.: "str1 str2")
MODE:      Operatinal mode [VALUE, PULSE]
PULSE-T:   Duration of ON pulse [1..4294967295 ms]        <Only for MODE:PULSE>
PULSE-GAP: Minimum OFF time after ON pulse [1..65535 ms]  <Only for MODE:PULSE>
[Caution]Caution

To activate the changes made on the upper case parameters, execute the initialization command init res:gpio ( init res:mfio for MFIO); while to set act the changes made on the lowercase parameters a save conf and an Abilis restart are required (i.e. with warm start command).

Example: to set a pulse of 500 ms on digital out number 1 to open the gate #1 type the following command:

[12:38:32] ABILIS_CPX:s p gpio-1 d-out:1 descr:Gate#1 mode:pulse pulse-t:500

Corresponding command for MFIO:

[12:38:32] ABILIS_CPX:s p mfio d-out:1 descr:Gate#1 mode:pulse pulse-t:500

Initialize the device and save the configuration with init res:gpio-1 ( init res:mfio for MFIO) and save conf.

[18:50:51] ABILIS_CPX:d p gpio-1

RES:Gpio-1 - Not Saved (SAVE CONF), Not Refreshed (INIT) ----------------------
       ------------------------------------------------------------------------
Run    DESCR:
       LOG:NO               ACT:YES              LIVE-EXPIRY:10
       -------+-------------------- Digital Input lines -----------------------
       D-IN:  | [DESCR:]
       -------+----------------------------------------------------------------
       1      | 1
       2      | 2
       3      | 3
       4      | 4
       5      | 7
       6      | 5
       7      | 6
       -------+-------------------- Digital Output lines ----------------------
       D-OUT: | [DESCR:]
              | MODE:    PULSE-T:    PULSE-GAP:
       -------+----------------------------------------------------------------
       1      | Gate#1
              | PULSE    500          250                                               

Corresponding command for MFIO:

[18:50:51] ABILIS_CPX:d p mfio

RES:MfIo ----------------------------------------------------------------------
Run    DESCR:Abilis_Multi_Function_IO_Interface
       LOG:DS        ACT:YES  
       -------+-------------------- Digital Input lines -----------------------
       D-IN:  | [DESCR:]
       -------+----------------------------------------------------------------
       -------+-------------------- Digital Output lines ----------------------
       D-OUT: | [DESCR:]
              | MODE:    PULSE-T:    PULSE-GAP:
       -------+----------------------------------------------------------------
       1      | Gate#
              | PULSE    500          250
       ------------------------------------------------------------------------

The GPIO resource allows to view the state of each digital input/output line and to read values from analog inputs.

[13:44:42] ABILIS_CPX:d d gpio-1

RES:Gpio-1 --------------------------------------------------------------------
       STATE:UP             USB-STATE:CONNECTED      
       - Digital Input Lines State --------------------------------------------
        1..16| off off off off off off off off .   .   .   .   .   .   .   .   
       17..32| .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   
       33..48| .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   
       49..64| .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   
       ------------------------------------------------------------------------
       - Digital Output Lines State -------------------------------------------
        1..16| off off off off .   .   .   .   .   .   .   .   .   .   .   .   
       17..32| .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   
       33..48| .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   
       49..64| .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   
       ------------------------------------------------------------------------
       - Analog Input Lines ---------------------------------------------------
             | State  Value   Unit     ADC    | State  Value   Unit     ADC
       ------+--------------------------------+--------------------------------
        1.. 2| LOW    0.0     %        1      | LOW    0.0     %        1      
        3.. 4| .      .       .        .      | .      .       .        .      
        5.. 6| .      .       .        .      | .      .       .        .      
        7.. 8| .      .       .        .      | .      .       .        .      
        9..10| .      .       .        .      | .      .       .        .      
       11..12| .      .       .        .      | .      .       .        .      
       13..14| .      .       .        .      | .      .       .        .      
       15..16| .      .       .        .      | .      .       .        .      
       ------------------------------------------------------------------------

The MFIO resource allows to view the state of each digital input/output line.

[08:29:04] ABILIS_CPX:d d mfio

RES:MfIo ----------------------------------------------------------------------
       Abilis_Multi_Function_IO_Interface                                      
       STATE:ACTIVE
       - Digital Input Lines State --------------------------------------------
        1..7| off off off off off off off 
       ------------------------------------------------------------------------
       - Digital Output Lines State -------------------------------------------
        1..7| off off off off off off off 
       ------------------------------------------------------------------------

The GPIO resource permits to pilot the digitals outputs state typing the command:

[11:14:46] ABILIS_CPX: s s res:gpio-1 d-out:1 ON | OFF

[19:03:43] ABILIS_CPX:s s res:gpio-1 d-out: ?

S S RES:Gpio-nD-OUT:val ON|OFF     Set status of Digital Output Line [ON, OFF]
                                    of the specified Gpio resource

D-OUT:     One value in the range [1..64] or a range of values 'xx-yy'
           or a list of values 'xx,yy,...' separated by ',' (comma) or
           "A" or "ALL". 

Corresponding command for MFIO:

[11:14:46] ABILIS_CPX: s s res:mfio d-out:1 ON | OFF

[19:03:43] ABILIS_CPX:s s res:mfio d-out: ?

S S RES:Mfio-nD-OUT:val ON|OFF     Set status of Digital Output Line [ON, OFF]
                                    of the specified Gpio resource

D-OUT:     One value in the range [1..64] or a range of values 'xx-yy'
           or a list of values 'xx,yy,...' separated by ',' (comma) or
           "A" or "ALL". 

In case of Digital or Analog input variation is possible to activate alarms.

Example: send an e-mail if Digital Input 1 becomes ON

[19:06:49] ABILIS_CPX:d p alarm

RES:Alarm ---------------------------------------------------------------------
Run    DESCR:Alarms_manager
       LOG:NO        ACT:YES            fifo-size:100
       MAIL-FROM:SYS (AbilisCPX<AbilisCPX@abilis>)
       MAIL-RCPT:#
       MAIL-BODY:STANDARD
       SMS-SENDER:CP-PI             SMS-CDO:#                              

[19:06:49] ABILIS_CPX:a alarm id:2 enabled:yes res:gpio-1 action:mail io:d-in-1 monitor:on MAIL-RCPT:alarms@mydomain.com


[19:32:28] CPX_ANTEK-PBX:_d alarm id:2

-------------------------------------------------------------------------------
ID: |[DESCR:]
    |ENABLED:|RES:              |IO:         |MONITOR: |ACTION:
    |MAIL-RCPT:
    |MAIL-RCPT-LIST:
    |MAIL-BODY:
    |SMS-CDO:
    |DISA-USER:                 |DISA-PIN:   |DISA-SERVICE:
    |DISA-CDO:                  |DISA-CGO:
-------------------------------------------------------------------------------
2     YES      Gpio-1             D-IN-1       ON        MAIL
     - MAIL -------------------------------------------------------------------
alarms@mydomain.com
     #
     SYS
------------------------------------------------------------------------------- 

Corresponding command for MFIO:

[19:06:49] ABILIS_CPX:a alarm id:2 enabled:yes res:mfio action:mail io:d-in-1 monitor:on MAIL-RCPT:alarms@mydomain.com


[19:32:28] CPX_ANTEK-PBX:_d alarm id:2

-------------------------------------------------------------------------------
ID: |[DESCR:]
    |ENABLED:|RES:              |IO:         |MONITOR: |ACTION:
    |MAIL-RCPT:
    |MAIL-RCPT-LIST:
    |MAIL-BODY:
    |SMS-CDO:
    |DISA-USER:                 |DISA-PIN:   |DISA-SERVICE:
    |DISA-CDO:                  |DISA-CGO:
-------------------------------------------------------------------------------
2     YES      Mfio            D-IN-1       ON        MAIL
     - MAIL -------------------------------------------------------------------
alarms@mydomain.com
     #
     SYS
------------------------------------------------------------------------------- 

To see the help online use the following command:

[19:06:49] ABILIS_CPX:a alarm id:2  res:gpio-1 action:mail ? monitor : io: 

Alarm management rule parameter(s):

MONITOR:   Alarm/event to be monitored [NONE, TRAP, ALARM-ON, ALARM-OFF,
           ALARM-*, ON, OFF, LOW, NORMAL, HIGH, *]
           'TRAP', 'ALARM-ON', 'ALARM-OFF' are allowed only for IO equal to #;
           'TRAP' is allowed only for ACTION not equal to DISA-CB;
           'ON', 'OFF', '*' are allowed only for Digital lines;
           'LOW', 'NORMAL', 'HIGH', '*' are allowed only for Analog lines.
IO:        Input/output line for which the alarm/event is monitored. "#" or
           - "D-IN-n", where 'n' can be
             - for GPIO Digital IN line, [1..64, *];
             - for MFIO Digital IN line, [1..7, *];
           - "D-OUT-n", where 'n' can be
             - for GPIO Digital OUT line, [1..64, *];
             - for MFIO Digital OUT line, [1..7, *];
           - "A-IN-n", where 'n' can be [1..16, *], for GPIO Analog IN line;
           - "A-OUT-n", where 'n' can be [1..16, *], for GPIO Analog OUT line;
                                                 <Only for Gpio/MfIo resources>
[Tip]Tip

Others information about Alarm resource are available in the Section 32.1, “ALARM resource”.

Information about management I/O via WEB Chapter 66, Automation.