The Virtual I/O Device is a software-based expansion module without a physical hardware interface. It serves as a virtual I/O interface and reserves a defined memory area in the process image of the RevPi. Various software components can access the data in this memory area. It becomes available immediately after being written.

The Virtual I/O Device can be used for:

  • Data exchange between PLCs and Linux applications

  • Integration with IT/cloud systems

  • Using Node-RED as an integration or visualization tool

  • Transferring measured values or states to a database

  • Writing setpoints or control commands from an external source to a PLC

It thus serves as a central interface between automation and IT applications without requiring additional communication protocols.

Configuration #

An expansion module is configured as part of the module configuration of the Revolution Pi system, i.e. a RevPi base module with expansion modules. This is possible via the application PiCtory or, if applicable, directly in the development environment, e.g. via CODESYS.

Note

CODESYS and PiCtory cannot be used in parallel for configuration. An existing configuration via PiCtory will be overwritten by a configuration via CODESYS.

The virtual devices OPC UA Server and MQTT Client can only be used via PiCtory.

The Virtual I/O Device is arranged in PiCtory like a physical module on the Configuration Board and configured in the Value Editor, see Configuring Inputs and Outputs.

PiCtory Virtual Device

Two variants are available:

  • Virtual Device 32 Byte for simple byte access

  • Virtual Device 32 Byte (Ext.) for typed data mapping

Virtual Device 32 Byte

Position

64

Offset

13

Data access

Byte-oriented, linear access to bytes

Inputs

INP 1 … 32, Unit BYTE

Outputs

OUT 1 … 32, Unit BYTE

Virtual Device 32 Byte (Ext.)

Position

65

Offset

77

Data access

Typed, access via bits, bytes, words, and DWords

Inputs

INP 1 … 48, Unit BOOL
INP 1 … 10, Unit BYTE
INP 1 … 4, Unit WORD
INP 1 … 2, Unit DWORD

Outputs

OUT 1 … 48, Unit BOOL
OUT 1 … 10, Unit BYTE
OUT 1 … 4, Unit WORD
OUT 1 … 2, Unit DWORD

Access via Software Components #

The inputs and outputs of a Virtual I/O Device can be accessed via various software components that utilize the RevPi process image.

Typical access options include:

  • PLC applications, e.g., via I/O mapping in CODESYS

  • Node-RED via RevPi Nodes

  • Linux applications such as Python modules, e.g., RevPiModIO2

Access is achieved via the configuration parameters stored in the process image, such as variable names and offsets. These can be accessed in the PiCtory application using the function Export.

PiCtory Export

Example: Using piTest, you can read the 32 bytes of the virtual inputs starting at offset 11 using the command piTest -r 11,32.

Note
  • Values in the input section of the RevPi device are written by external applications and read by the PLC.

  • Values in the output section of the RevPi device are written by the PLC and read by external applications.

Further Resources #