Device Classes¶
Classes for managing Revolution Pi devices.
Device¶
- class revpimodio2.device.Device(parentmodio, dict_device, simulator=False)[source]¶
Bases:
objectBase class for all device objects.
The base functionality generates all IOs upon instantiation and extends the process image buffer by the required bytes. It manages its process image buffer and ensures the updating of IO values.
Base class for all Revolution Pi devices.
- __init__(parentmodio, dict_device, simulator=False)[source]¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- extend¶
Extended configuration data from piCtory.
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- outvariant¶
Output variant number.
- type¶
Device position type string.
- __bytes__()[source]¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)[source]¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)[source]¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- autorefresh(activate=True) None[source]¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- get_allios(export=None) list[source]¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list[source]¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_outputs(export=None) list[source]¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- get_memories(export=None) list[source]¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- readprocimg() bool[source]¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None[source]¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool[source]¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- writeprocimg() bool[source]¶
Write all outputs of this device to process image.
- Returns:
True if successfully executed
- Ref:
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property name¶
Returns the name of the device.
- Returns:
Device name
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
DeviceList¶
- class revpimodio2.device.DeviceList[source]¶
Bases:
objectBase class for direct access to device objects.
Container for accessing devices.
Example:
# Access device by name dio_module = rpi.device.DIO_Module_1 # Access device by position first_device = rpi.device[0] # Iterate all devices for device in rpi.device: print(f"Device: {device.name}")
- __contains__(key)[source]¶
Checks if device exists.
- Parameters:
key – DeviceName <class ‘str’> / Position number <class ‘int’>
- Returns:
True if device exists
- __delattr__(key, delcomplete=True)[source]¶
Removes specified device.
- Parameters:
key – Device to remove
delcomplete – If True, device will be removed completely
- __delitem__(key)[source]¶
Removes device at specified position.
- Parameters:
key – Device position to remove
- __getitem__(key)[source]¶
Returns specified device.
- Parameters:
key – DeviceName <class ‘str’> / Position number <class ‘int’>
- Returns:
Found <class ‘Device’> object
Base¶
- class revpimodio2.device.Base(parentmodio, dict_device, simulator=False)[source]¶
Bases:
DeviceClass for all base devices like Core / Connect etc.
Base class for Revolution Pi base modules.
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parentmodio, dict_device, simulator=False)¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- extend¶
Extended configuration data from piCtory.
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- type¶
Device position type string.
GatewayMixin¶
- class revpimodio2.device.GatewayMixin[source]¶
Bases:
objectMixin class providing piGate module detection functionality.
Mixin class providing gateway functionality for piGate modules.
ModularBaseConnect_4_5¶
- class revpimodio2.device.ModularBaseConnect_4_5(parentmodio, dict_device, simulator=False)[source]¶
Bases:
ModularBaseClass for overlapping functions of Connect 4/5.
Base class for Connect 4 and Connect 5 modules.
- property A1: int¶
Returns the state of LED A1 of the Connect.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A2: int¶
Returns the state of LED A2 from the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A3: int¶
Returns the state of LED A3 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A4: int¶
Returns the state of LED A4 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A5: int¶
Returns the state of LED A5 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- a1red¶
- a1green¶
- a1blue¶
- a2red¶
- a2green¶
- a2blue¶
- a3red¶
- a3green¶
- a3blue¶
- a4red¶
- a4green¶
- a4blue¶
- a5red¶
- a5green¶
- a5blue¶
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parentmodio, dict_device, simulator=False)¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- property errorlimit1: int¶
Returns RS485 ErrorLimit1 value.
- Returns:
Current value for ErrorLimit1 (-1 if not available)
- property errorlimit2: int¶
Returns RS485 ErrorLimit2 value.
- Returns:
Current value for ErrorLimit2 (-1 if not available)
- extend¶
Extended configuration data from piCtory.
- property frequency: int¶
Returns CPU clock frequency.
- Returns:
CPU clock frequency in MHz (-1 if not available)
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property iocycle: int¶
Returns cycle time of process image synchronization.
- Returns:
Cycle time in ms (-1 if not available)
- property ioerrorcount: int¶
Returns error count on RS485 piBridge bus.
- Returns:
Number of errors of the piBridge (-1 if not available)
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property missingdeviceorgate: bool¶
Status bit for an IO module missing or piGate configured.
- Returns:
True if IO module is missing or piGate is configured
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property overunderflow: bool¶
Module occupies more or less memory than configured.
- Returns:
True if wrong memory is occupied
- Type:
Status bit
- property picontrolrunning: bool¶
Status bit indicating piControl driver is running.
- Returns:
True if driver is running
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- property temperature: int¶
Returns CPU temperature.
- Returns:
CPU temperature in Celsius (-273 if not available)
- type¶
Device position type string.
- property unconfdevice: bool¶
Status bit for an IO module not configured with piCtory.
- Returns:
True if IO module is not configured
Core¶
- class revpimodio2.device.Core(parentmodio, dict_device, simulator=False)[source]¶
Bases:
ModularBase,GatewayMixinClass for the RevPi Core.
Provides functions for the LEDs and the status.
Revolution Pi Core module.
- a1green¶
- a1red¶
- a2green¶
- a2red¶
- wd¶
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parentmodio, dict_device, simulator=False)¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- property errorlimit1: int¶
Returns RS485 ErrorLimit1 value.
- Returns:
Current value for ErrorLimit1 (-1 if not available)
- property errorlimit2: int¶
Returns RS485 ErrorLimit2 value.
- Returns:
Current value for ErrorLimit2 (-1 if not available)
- extend¶
Extended configuration data from piCtory.
- property frequency: int¶
Returns CPU clock frequency.
- Returns:
CPU clock frequency in MHz (-1 if not available)
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property iocycle: int¶
Returns cycle time of process image synchronization.
- Returns:
Cycle time in ms (-1 if not available)
- property ioerrorcount: int¶
Returns error count on RS485 piBridge bus.
- Returns:
Number of errors of the piBridge (-1 if not available)
- property leftgate: bool¶
Status bit indicating a piGate module is connected on the left side.
- Returns:
True if piGate left exists
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property missingdeviceorgate: bool¶
Status bit for an IO module missing or piGate configured.
- Returns:
True if IO module is missing or piGate is configured
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property overunderflow: bool¶
Module occupies more or less memory than configured.
- Returns:
True if wrong memory is occupied
- Type:
Status bit
- property picontrolrunning: bool¶
Status bit indicating piControl driver is running.
- Returns:
True if driver is running
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- property rightgate: bool¶
Status bit indicating a piGate module is connected on the right side.
- Returns:
True if piGate right exists
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- property temperature: int¶
Returns CPU temperature.
- Returns:
CPU temperature in Celsius (-273 if not available)
- type¶
Device position type string.
- property unconfdevice: bool¶
Status bit for an IO module not configured with piCtory.
- Returns:
True if IO module is not configured
Connect¶
- class revpimodio2.device.Connect(parentmodio, dict_device, simulator=False)[source]¶
Bases:
CoreClass for the RevPi Connect.
Provides functions for the LEDs, watchdog and the status.
Revolution Pi Connect module.
- property wdautotoggle: bool¶
Retrieves the automatic watchdog toggle status.
- Returns:
True if automatic watchdog toggle is active
- a3green¶
- a3red¶
- x2in¶
- x2out¶
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parentmodio, dict_device, simulator=False)¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- a1green¶
- a1red¶
- a2green¶
- a2red¶
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- property errorlimit1: int¶
Returns RS485 ErrorLimit1 value.
- Returns:
Current value for ErrorLimit1 (-1 if not available)
- property errorlimit2: int¶
Returns RS485 ErrorLimit2 value.
- Returns:
Current value for ErrorLimit2 (-1 if not available)
- extend¶
Extended configuration data from piCtory.
- property frequency: int¶
Returns CPU clock frequency.
- Returns:
CPU clock frequency in MHz (-1 if not available)
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property iocycle: int¶
Returns cycle time of process image synchronization.
- Returns:
Cycle time in ms (-1 if not available)
- property ioerrorcount: int¶
Returns error count on RS485 piBridge bus.
- Returns:
Number of errors of the piBridge (-1 if not available)
- property leftgate: bool¶
Status bit indicating a piGate module is connected on the left side.
- Returns:
True if piGate left exists
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property missingdeviceorgate: bool¶
Status bit for an IO module missing or piGate configured.
- Returns:
True if IO module is missing or piGate is configured
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property overunderflow: bool¶
Module occupies more or less memory than configured.
- Returns:
True if wrong memory is occupied
- Type:
Status bit
- property picontrolrunning: bool¶
Status bit indicating piControl driver is running.
- Returns:
True if driver is running
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- property rightgate: bool¶
Status bit indicating a piGate module is connected on the right side.
- Returns:
True if piGate right exists
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- property temperature: int¶
Returns CPU temperature.
- Returns:
CPU temperature in Celsius (-273 if not available)
- type¶
Device position type string.
- property unconfdevice: bool¶
Status bit for an IO module not configured with piCtory.
- Returns:
True if IO module is not configured
- wd¶
- wd_toggle()¶
Toggle watchdog bit to prevent a timeout.
Connect4¶
- class revpimodio2.device.Connect4(parentmodio, dict_device, simulator=False)[source]¶
Bases:
ModularBaseConnect_4_5Class for the RevPi Connect 4.
Provides functions for the LEDs and the status.
Revolution Pi Connect 4 module.
- x2in¶
- x2out¶
- property A1: int¶
Returns the state of LED A1 of the Connect.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A2: int¶
Returns the state of LED A2 from the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A3: int¶
Returns the state of LED A3 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A4: int¶
Returns the state of LED A4 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A5: int¶
Returns the state of LED A5 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parentmodio, dict_device, simulator=False)¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- a1blue¶
- a1green¶
- a1red¶
- a2blue¶
- a2green¶
- a2red¶
- a3blue¶
- a3green¶
- a3red¶
- a4blue¶
- a4green¶
- a4red¶
- a5blue¶
- a5green¶
- a5red¶
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- property errorlimit1: int¶
Returns RS485 ErrorLimit1 value.
- Returns:
Current value for ErrorLimit1 (-1 if not available)
- property errorlimit2: int¶
Returns RS485 ErrorLimit2 value.
- Returns:
Current value for ErrorLimit2 (-1 if not available)
- extend¶
Extended configuration data from piCtory.
- property frequency: int¶
Returns CPU clock frequency.
- Returns:
CPU clock frequency in MHz (-1 if not available)
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property iocycle: int¶
Returns cycle time of process image synchronization.
- Returns:
Cycle time in ms (-1 if not available)
- property ioerrorcount: int¶
Returns error count on RS485 piBridge bus.
- Returns:
Number of errors of the piBridge (-1 if not available)
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property missingdeviceorgate: bool¶
Status bit for an IO module missing or piGate configured.
- Returns:
True if IO module is missing or piGate is configured
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property overunderflow: bool¶
Module occupies more or less memory than configured.
- Returns:
True if wrong memory is occupied
- Type:
Status bit
- property picontrolrunning: bool¶
Status bit indicating piControl driver is running.
- Returns:
True if driver is running
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- property temperature: int¶
Returns CPU temperature.
- Returns:
CPU temperature in Celsius (-273 if not available)
- type¶
Device position type string.
- property unconfdevice: bool¶
Status bit for an IO module not configured with piCtory.
- Returns:
True if IO module is not configured
- wd_toggle()¶
Toggle watchdog bit to prevent a timeout.
Connect5¶
- class revpimodio2.device.Connect5(parentmodio, dict_device, simulator=False)[source]¶
Bases:
ModularBaseConnect_4_5,GatewayMixinClass for the RevPi Connect 5.
Provides functions for the LEDs and the status.
Revolution Pi Connect 5 module.
- a1red¶
- a1green¶
- a1blue¶
- a2red¶
- a2green¶
- a2blue¶
- a3red¶
- a3green¶
- a3blue¶
- a4red¶
- a4green¶
- a4blue¶
- a5red¶
- a5green¶
- a5blue¶
- property A1: int¶
Returns the state of LED A1 of the Connect.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A2: int¶
Returns the state of LED A2 from the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A3: int¶
Returns the state of LED A3 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A4: int¶
Returns the state of LED A4 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- property A5: int¶
Returns the state of LED A5 of the Core.
- Returns:
0=off, 1=green, 2=red, 4=blue, mixed RGB colors
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parentmodio, dict_device, simulator=False)¶
Instantiation of the Device class.
- Parameters:
parentmodio – RevpiModIO parent object
dict_device – <class ‘dict’> for this device from piCtory
simulator – Loads the module as simulator and swaps IOs
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __setattr__(key, value)¶
Prevents overwriting the special IOs.
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- property errorlimit1: int¶
Returns RS485 ErrorLimit1 value.
- Returns:
Current value for ErrorLimit1 (-1 if not available)
- property errorlimit2: int¶
Returns RS485 ErrorLimit2 value.
- Returns:
Current value for ErrorLimit2 (-1 if not available)
- extend¶
Extended configuration data from piCtory.
- property frequency: int¶
Returns CPU clock frequency.
- Returns:
CPU clock frequency in MHz (-1 if not available)
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property iocycle: int¶
Returns cycle time of process image synchronization.
- Returns:
Cycle time in ms (-1 if not available)
- property ioerrorcount: int¶
Returns error count on RS485 piBridge bus.
- Returns:
Number of errors of the piBridge (-1 if not available)
- property leftgate: bool¶
Status bit indicating a piGate module is connected on the left side.
- Returns:
True if piGate left exists
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property missingdeviceorgate: bool¶
Status bit for an IO module missing or piGate configured.
- Returns:
True if IO module is missing or piGate is configured
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property overunderflow: bool¶
Module occupies more or less memory than configured.
- Returns:
True if wrong memory is occupied
- Type:
Status bit
- property picontrolrunning: bool¶
Status bit indicating piControl driver is running.
- Returns:
True if driver is running
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- property rightgate: bool¶
Status bit indicating a piGate module is connected on the right side.
- Returns:
True if piGate right exists
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- property temperature: int¶
Returns CPU temperature.
- Returns:
CPU temperature in Celsius (-273 if not available)
- type¶
Device position type string.
- property unconfdevice: bool¶
Status bit for an IO module not configured with piCtory.
- Returns:
True if IO module is not configured
- wd_toggle()¶
Toggle watchdog bit to prevent a timeout.
DioModule¶
- class revpimodio2.device.DioModule(parentmodio, dict_device, simulator=False)[source]¶
Bases:
DeviceRepresents a DIO / DI / DO module.
Digital I/O module.
- __init__(parentmodio, dict_device, simulator=False)[source]¶
Extends Device class for detecting IntIOCounter.
- Rev:
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- extend¶
Extended configuration data from piCtory.
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- type¶
Device position type string.
RoModule¶
- class revpimodio2.device.RoModule(parentmodio, dict_device, simulator=False)[source]¶
Bases:
DeviceRelais output (RO) module with
Relay output module.
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- extend¶
Extended configuration data from piCtory.
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- outvariant¶
Output variant number.
- type¶
Device position type string.
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property name¶
Returns the name of the device.
- Returns:
Device name
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- writeprocimg() bool¶
Write all outputs of this device to process image.
- Returns:
True if successfully executed
- Ref:
Gateway¶
- class revpimodio2.device.Gateway(parent, dict_device, simulator=False)[source]¶
Bases:
DeviceClass for the RevPi Gateway-Devices.
Provides additional functions for the RevPi Gateway devices besides the functions from RevPiDevice. Gateways are ready. IOs on this device provide the replace_io function, which allows defining custom IOs that map to a RevPiStructIO object. This IO type can process and return values via multiple bytes.
- Ref:
revpimodio2.io.IntIOReplaceable.replace_io()
Gateway module (ModbusTCP, Profinet, etc.).
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- extend¶
Extended configuration data from piCtory.
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- type¶
Device position type string.
- writeprocimg() bool¶
Write all outputs of this device to process image.
- Returns:
True if successfully executed
- Ref:
Virtual¶
- class revpimodio2.device.Virtual(parent, dict_device, simulator=False)[source]¶
Bases:
GatewayClass for the RevPi Virtual-Devices.
Provides the same functions as Gateway. Custom IOs can be defined via the replace_io functions that map to RevPiStructIO objects. This IO type can process and return values via multiple bytes.
- Ref:
Virtual device for custom applications.
- __bytes__()¶
Returns all device data as <class ‘bytes’>.
- Returns:
Device data as <class ‘bytes’>
- __contains__(key)¶
Checks if IO is on this device.
- Parameters:
key – IO-Name <class ‘str’> / IO-Bytenummer <class ‘int’>
- Returns:
True if IO is present on device
- __getitem__(key)¶
Returns IO at specified position.
- Parameters:
key – Index of the IO on the device as <class ‘int’>
- Returns:
Found IO object
- __init__(parent, dict_device, simulator=False)¶
Extends Device class with get_rawbytes functions.
- Ref:
- __int__()¶
Returns the position on the RevPi bus.
- Returns:
Position number
- __iter__()¶
Returns iterator of all IOs.
- Returns:
<class ‘iter’> of all IOs
- __len__()¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- __str__()¶
Returns the name of the device.
- Returns:
Device name
- autorefresh(activate=True) None¶
Registers this device for automatic synchronization.
- Parameters:
activate – Default True adds device to synchronization
- bmk¶
Component designator from piCtory configuration.
- catalognr¶
Catalog number of the device (deprecated).
- comment¶
Comment text from piCtory configuration.
- extend¶
Extended configuration data from piCtory.
- get_allios(export=None) list¶
Returns a list of all inputs and outputs, no MEMs.
If parameter ‘export’ remains None, all inputs and outputs will be returned. If ‘export’ is set to True/False, only inputs and outputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only in-/outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Input and Output, no MEMs
- get_inputs(export=None) list¶
Returns a list of all inputs.
If parameter ‘export’ remains None, all inputs will be returned. If ‘export’ is set to True/False, only inputs will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only inputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Inputs
- get_memories(export=None) list¶
Returns a list of all memory objects.
If parameter ‘export’ remains None, all mems will be returned. If ‘export’ is set to True/False, only mems will be returned for which the ‘Export’ value in piCtory matches.
- Parameters:
export – Only mems with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Mems
- get_outputs(export=None) list¶
Returns a list of all outputs.
If parameter ‘export’ remains None, all outputs will be returned. If ‘export’ is set to True/False, only outputs returned, for which the value ‘Export’ in piCtory matches.
- Parameters:
export – Only outputs with specified ‘Export’ value in piCtory
- Returns:
<class ‘list’> Outputs
- get_rawbytes() bytes¶
Returns the bytes used by this device.
- Returns:
<class ‘bytes’> of the Devices
- guid¶
Global unique identifier of the device.
- id¶
Device identifier from piCtory configuration.
- inpvariant¶
Input variant number.
- property length¶
Returns number of bytes occupied by this device.
- Returns:
<class ‘int’>
- property name¶
Returns the name of the device.
- Returns:
Device name
- outvariant¶
Output variant number.
- property position¶
Returns the position on the RevPi bus.
- Returns:
Position number
- readprocimg() bool¶
Read all inputs for this device from process image.
- Returns:
True if successfully executed
- Ref:
- setdefaultvalues() None¶
Set all output buffers for this device to default values.
- Returns:
True if successfully executed
- Ref:
Activate sharing of process image just for this device.
- Parameters:
activate – Set True to activate process image sharing
- syncoutputs() bool¶
Read all outputs in process image for this device.
- Returns:
True if successfully executed
- Ref:
- type¶
Device position type string.
- writeprocimg() bool¶
Write all outputs of this device to process image.
- Returns:
True if successfully executed
- Ref:
- writeinputdefaults()[source]¶
Writes piCtory default input values for a virtual device.
If default values for inputs of a virtual device are specified in piCtory, these are only set at system startup or a piControl reset. If the process image is subsequently overwritten with NULL, these values will be lost. This function can only be applied to virtual devices!
- Returns:
True if operations on the virtual device were successful