14.1. Analog and digital I/O Overview

From release 7-5-0 added a new web application that permits the handling of analog and digital I/O made available with the following hardware:

From release 8-4-0 added new hardware:

The application permits:

See below a couple of example screenshots.

Figure 14.1. I/O Maps index

I/O Maps index

Figure 14.2. I/O Map1 control

I/O Map1 control

Figure 14.3. I/O Automation log

I/O Automation log

GPIO/RIO/RVS device

Software Resource Mfio (Microabilis-C3)

14.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.

The RVS provides 4 Digital Inputs, 4 Digital Output.

The RIO provides 16 Digital Inputs, 16 Digital Output, 8 Analog Inputs and 8 Analog Outputs.

14.1.2. Activating GPIO device and IOHUB resource

Add the GPIO device and IOHUB resource with the following commands:

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

COMMAND EXECUTED

[11:43:33] ABILIS_CPX:a res:iohub

COMMAND EXECUTED
[Caution]Caution

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

The IOLOG must be activated with the commands:

[09:43:22] ABILIS_CPX:s p iohub iolog-act:yes

COMMAND EXECUTED

[14:38:24] ABILIS_CPX:d p iohub

RES:IoHub ---------------------------------------------------------------------
Run    DESCR:I/O_Hub_Driver
       LOG:NO        
       wdir:C:\APP\IO\
       - I/O Web Control ------------------------------------------------------
       WEBCTL-ACT:YES        webctl-maxclients:10   
       WEBCTL-XML-TOUT:60    WEBCTLXML-MIN-DELAY:50
       - I/O Log Service ------------------------------------------------------
       IOLOG-ACT:YES         iolog-size:SMALL (~50,000)

Meaning of the most important parameters:

IOLOG-ACT

Enable/disable IOLOG service [NO, YES].

iolog-size

Number of records in IOLOG database [TINY, SMALL, MEDIUM, LARGE, HUGE], where:

  • TINY corresponds to approximately 10,000 records;

  • SMALL corresponds to approximately 50,000 records;

  • MEDIUM corresponds to approximately 200,000 records;

  • LARGE corresponds to approximately 500,000 records;

  • HUGE corresponds to approximately 1,000,000 records.

[Tip]Tip

Interesting chapter: Section 61.11, “Automation log”.

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

[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: HYST:  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
       ------------------------------------------------------------------------ 
[Important]Important

The D P GPIO command shows only the lines which have been configured with a description or that have the parameters different from the default. To enforce the view of all theoretically possible 64 digital inputs, 64 digital outputs, 16 analog inputs, use D PE GPIO command.

Meaning of the most important parameters:

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).

ACT

Operation activation [NO, YES].

LIVE-EXPIRY

Expiry timeout programmed to GPIO device [10..600 sec].

D-IN

Digital Input Line identifier [1..64].

D-OUT

Digital output Line identifier [1..64].

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.

Meaning of the Analog Input Lines parameters:

A-IN

Analog Input Line identifier [1..16].

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', '.'].

HYST

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].

The following command allows the administrator to change the configuration of the resource:

s p gpio-1 parameter:value...

[Caution]Caution

To activate the changes made on the upper case parameters, execute the initialization command init res:gpio; 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

COMMAND EXECUTED

Initialize the device and save the configuration with init res:gpio-1 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                                               

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 GPIO resource permits to pilot the digital outputs state typing the command:

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

COMMAND EXECUTED

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

S S RES:Gpio-n D-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". 
[Tip]Tip

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

[Tip]Tip

Interesting chapter: Section 61.11, “Automation log”.

14.1.3. Activating MFIO resource

Add the MFIO and IOHUB resource with the following command:

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

COMMAND EXECUTED

[11:43:33] ABILIS_CPX:a res:iohub

COMMAND EXECUTED
[Caution]Caution

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

The MFIO resources must be activated with the command:

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

COMMAND EXECUTED

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

[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
       ------------------------------------------------------------------------

Meaning of the most important parameters:

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).

ACT

Operation activation [NO, YES].

D-IN

Digital Input Line identifier [1..7].

D-OUT

Digital output Line identifier [1..7].

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.

The following command allows the administrator to change the configuration of the resource:

s p mfio parameter:value...

[Caution]Caution

To activate the changes made on the upper case parameters, execute the initialization command init res: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 mfio d-out:1 descr:Gate#1 mode:pulse pulse-t:500

COMMAND EXECUTED

Initialize the device and save the configuration with init res:mfio and save conf.

[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 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 MFIO resource permits to pilot the digital outputs state typing the command:

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

COMMAND EXECUTED

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

S S RES:Mfio-n D-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". 
[Tip]Tip

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

[Tip]Tip

Interesting chapter: Section 61.11, “Automation log”.

14.1.4. Activation of the alarms for the MFIO/GPIO

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 trigger:on MAIL-RCPT:alarms@mydomain.com

COMMAND EXECUTED

[19:32:28] ABILIS_CPX:d alarm id:2

-------------------------------------------------------------------------------
ID: |[DESCR:]
    |ENABLED:|RES:              |IO:         |TRIGGER: |ACTION:
    |MAIL-RCPT:
    |MAIL-RCPT-LIST:
    |MAIL-BODY:
    |SMS-CDO:
    |DISA-USER:                 |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 trigger:on MAIL-RCPT:alarms@mydomain.com

COMMAND EXECUTED

[19:32:28] ABILIS_CPX:d alarm id:2

-------------------------------------------------------------------------------
ID: |[DESCR:]
    |ENABLED:|RES:              |IO:         |TRIGGER: |ACTION:
    |MAIL-RCPT:
    |MAIL-RCPT-LIST:
    |MAIL-BODY:
    |SMS-CDO:
    |DISA-USER:                 |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 ? trigger: io: 

Alarm management rule parameter(s):

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

Others informations about Alarm resource are available in the Section 33.1, “ALARM resource”.