RevPiGateway / RevPiVirtual

Pictures a gateway device. This class inherits from RevPiDevice and provides all the attributes and functions of this class.

This class accommodates all Inputs, Outputs and mems as RevPiIO objects derived from the RevPiIOBase class.

In addition, you can create your own inputs / outputs, which get a specific data format via struct ().  These IOs are RevPiIOStruct object, which are also derived from RevPiIOBase.

class RevPiGateway(RevPiDevice)

NOTE: The same functions are also applicable to the RevPiVirtual:

class RevPiVirtual(RevPiGateway)

The following additional functions are provided:

get_rawbytes()

Specifies the bytes that this device uses.


reg_inp(name, startinp, frm, **kwargs)

Registers a new input with specified formatting.

  • name Name of the new Input
  • startinp Input name from which to insert
  • frm struct() formatting (1 Sign)
  • kwargs The following optional keyword parameters can be passed:
    • bmk Description for Input
    • bit Registers input as bool () at the specified bit in the Byte
    • byteorder Set byteorder “little” (Default) “big”
    • defaultvalue Standardvalue for Input, standard is 0
    • event Register function for Event Handling
    • as_thread Executes the event function as a RevPiCallback thread
    • edge Event execution at RISING, FALLING or BOTH value Change

reg_out(name, startinp, frm, **kwargs)

Registers a new output with specified formatting.

  • name Name of the new output
  • startout Output name from which to insert
  • frm struct() formatting (1 Sign)
  • kwargs The following optional keyword parameters can be passed:
    • bmk Description for Output
    • bit Registers outputs as bool () at the specified bit in the Byte
    • defaultvalue Default for output, default is 0
    • event Register function for Event Handling
    • as_thread Executes the event function as a RevPiCallback thread
    • edge Event execution at RISING, FALLING or BOTH value Change