Direct I/O variables

System Variables - Direct I/O protocol allows to create Tags that point to optional local I/O plugin modules.

 

Install and configure Direct I/O Plug-in modules

Most HMI offer 1 or 2 slots for connecting optional plug-in modules. Slot numbers are referred in the programming software for configuration of plug-in modules. Numbering of plug-in slots is shown in figure.

Use Plug-in List available in the System Settings menu to check if I/O plug-in modules are correctly recognized in the system and what is their slot number.

 

Plug-in I/O Modules details

Plug-in I/O modules have been designed for creating simple applications with a limited number of digital I/O signals.

Module I/O configration Image

8 Digital Inputs /
6 Digital Outputs /
1 Relay Output

  • 8 optically isolated digital inputs
  • 6 optically isolated digital outputs
  • 1 relay output
2 Relay Outputs
  • 2 relay output

 

Protocol Editor Settings

From PLC Model list of Protocol Editor dialog, select Direct I/O.

 

Tag Editor Settings

Path: ProjectView> Config > double-click Tags

  1. To add a tag, click +: a new line is added.
  2. Select System Variables from the Driver list: tag definition dialog is displayed.

Element Description

Memory Type

Indicates the resource with this rule:

<module name>#<slot number> <resource type>

Variable Description
<module name>#n Diags

Reports I/O diagnostic information. Check Offset section for details

<module name>#n Inputs

Reports input status

<module name>#n Outputs Reports ouput status
Offset
Memory Type Range Description
Diags 0 - 2
Bit # Description
0

DIAG_24VOK parameter.

0 = 24V detected

1 = 24V missing

1

DIGOUT1_DIAG01 parameter.

0 = digital ouputs 1-3 not ok

1 = digital outputs 1-3 ok

2

DIGOUT1_DIAG02 parameter.

0 = digital ouputs 4-6 not ok

1 = digital outputs 4-6 ok

Inputs 0 - 7
Bit # Description
0

Digital Input 1

1 Digital Input 2
2 Digital Input 3
3

Digital Input 4

4 Digital Input 5
5 Digital Input 6
6 Digital Input 7
7 Digital Input 8
Outputs 0 - 6

Refers to 8 Digital Inputs / 6 Digital Outputs / 1 Relay Output I/O module

Bit # Description
0

Digital Output 1

1 Digital Output 2
2 Digital Output 3
3

Digital Output 4

4 Digital Output 5
5 Digital Output 6
6 Relay Output
0 - 1

Refers to 2 Relay Outputs I/O module

Bit # Channel #
0

Relay Output 1

1 Relay Output 2
Data Type
Data Type Memory Space Limits
unsignedByte 8-bit data 0 ... 255
boolean[] 1-bit data array 0 ... 1 (for each element)

Select boolean[] data type to get all resources in a boolean array.
To point or visualize a single resource, a proper Array index property has to be set when using the Tag.

Direct I/O Tags can be accessed with JavaScript programming.
For easier access from JavaScript functions it is preferable to configure Direct I/O tags as boolean[].
Example: JavaScript function to set to TRUE output channel 3

Arraysize

In case of array Tag, this property represents the number of array elements.

Note: Arraysize depends on the type of plug-in in use. In case of wrong configuration of the tag there will be no error reported, neither in HMI Logger nor in the Protocol Error Message System Variable<convert to text and insert new text here>

Conversion

Conversion to be applied to the tag.

Depending on data type selected, the Allowed list shows one or more conversions, listed below.

Value Description
BCD

Separate the byte in two nibbles, and reads them as decimal (from 0 to 9)

Example:

23 → 17 (in decimal format)

0001 0111 = 23

0001 = 1 (first nibble)

0111 = 7 (second nibble)

AB -> BA

Swap nibbles of a byte.

Example:

15D4 → 514D (in hexadecimal format)

5588 → 20813 (in decimal format)

Inv bits

Invert all the bits of the tag.

Example:

1001 → 0110 (in binary format)

9 → 6 (in decimal format)

Select the conversion and click on plus button. The selected item will be added on Configured list.

If more conversions are configured, they will be applied in order (from top to bottom of Configured list).

Use the arrow buttons to order the configured conversions