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 Inputstartinp
Input name from which to insertfrm
struct() formatting (1 Sign)kwargs
The following optional keyword parameters can be passed:bmk
Description for Inputbit
Registers input as bool () at the specified bit in the Bytebyteorder
Set byteorder “little” (Default) “big”defaultvalue
Standardvalue for Input, standard is 0event
Register function for Event Handlingas_thread
Executes the event function as a RevPiCallback threadedge
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 outputstartout
Output name from which to insertfrm
struct() formatting (1 Sign)kwargs
The following optional keyword parameters can be passed:bmk
Description for Outputbit
Registers outputs as bool () at the specified bit in the Bytedefaultvalue
Default for output, default is 0event
Register function for Event Handlingas_thread
Executes the event function as a RevPiCallback threadedge
Event execution at RISING, FALLING or BOTH value Change