This class represents a single input or output of a module and allows the byte or bitwise access to its value.
Classes that inherit from RevPiIOBase:
- RevPiIO extends access to values to get or set them as int ().
- RevPiStructIO self-defined IOs for RevPiGateway objects.
class RevPiIOBase(offset, valuelist, readonly, byteproc, byteorder)
offset
device offset in Process imagevaluelist
Datalist for object creationreadonly
True for Inputs and Mems, False for outputsbyteproc
local buffer of Process imagebyteorder
“little” or “big” for int() calculation in RevPiIO class, if there are more more than one byte
All values are passed by the RevPiDevice class.
The following attributes are provided:
bmk
Description of the IO is taken from piCtory.
defaultvalue
Default value of the IO that is set when RevPiDevicelist.setdefaultvalues().
length
Length of process Image in Bytes.
For bit-oriented IOs, only the zeroth bit has the length 1!
name
Returns the name of the IO.
value
Returns or sets the value as byte () / bool (), depending on instantiation.
This is dependent on how the IOs in piCtory are configured byte () or bool ().
The following functions are provided:
get_absaddress()
Returns the byte address of the IO in the process Image
get_address()
Returns byte address of the IO on the device
get_value()
IO value as bytes () or bool (), which contains this IO
set_value(value
IO value as bytes () or bool () to which this IO is to be set