Bugfix for context managers.
- Add context manager for ios
- Remove deprecated parameter ‘direct_output’ from ModIO classes
- Check offset values of the devices for integers
- Check if the length of the previous IO overlaps with the new IO
- Add support for RO device
- Add context manager for modio instance
With the new context managers, the IOs can be more easily combined with your own cycles. When entering the context manager, the inputs are read, within the context manager outputs are stable and will not change on hardware and when exiting, all outputs are written.
import revpimodio2 revpi = revpimodio2.RevPiModIO() with revpi.io: revpi.io.O_1.value = not revpi.io.O_1.value
autorefresh=True argument does not have to be set in this case, as the context manager takes care of updating the process image.
- Fixes an error when using autofrefresh and
shared_procimg. Under certain circumstances, it could happen that an output was set, but the internal buffer still returned the previous value.
- Fixes an error when using
shared_procimg. In which all outputs were always written, even if a device had not activated
- Texts written more clearly for warnings.
replace_iofunction now accepts the keyword
wordorder. This makes it now possible to put several words, e.g. from a Modbus device, in the correct order.
- The new function
run_net_plccan be used like
run_plcto use the Revolution Pi directly as a PLC over the network.
- License was changed from LGPLv3 to LGPLv2 with the consent of all contributors.
- The RevPi Connect 4 is now supported.
- Fixes a bug for switching the LEDs on the Revolution Pi (all)
- Replace IO file is applied before the start of Auto-Refresh, otherwise there could be cycle warnings.
- Improved output in the texts of warnings when the same device names are used.
It is strongly recommended to install this update when using
.cycleloopdid not maintain its defined cycle time under certain circumstances (different runtimes of the cycle function)! Depending on the case, the cycle function was executed too often or too seldom than expected. With this version, the cycle time is adhered to exactly and a warning is issued if the cycle function takes to long.
- Fixes bug in
.replace_ioto replace more than 8 bits of a >1 byte long IO object (thanks Nico)
prefireparameter can now also be passed to the
.reg_timereventfunction. This is analogous to
- Fixes errors when using
shared_procimgwhen querying the output status, especially in
.cycleloop(...). The status of set outputs was one cycle behind. So the values of the outputs in the next cycle were still at the old status.
- Offset check of the entire process image and omission of overlapping IOs. When using several old Modbus 150 devices, the offsets of the IOs do not match. Overlapping is now prevented by omitting the IOs.
- The export file can now handle replaced IOs in byte format (s).
- MIO memory mapping values added.
- Corrects errors in the length specifications of the memory areas from the process image if the piCtory configurations have gaps. This has been discovered so far with the “Modbus Master 150” module. The error means that the IOs of modules behind the incomplete module are not correctly synchronized.
- Flat: Switch button and relay are now available as real IO objects in the
- Fixes cycle problem with
As soon as a new value was assigned to an output, RevPiModIO immediately wrote it into the process image. Outputs may only be written to the process image after the cycle function has been completely processed (when using
.cycleloop) or after calling
The error is not relevant when using
- Implementation of RevPi Flat (still without .core IOs).
- Hardening of NetIO (process image over the network).
- The call
.cycleloopnow accepts an optional blocking parameter. If you do not want the Cycleloop to be executed exclusively,
blocking=Falsecan be set – Same as blocking parameter of the
shared_procimgcan now be set per device. This makes it possible, for example, to use only the core module as shared and the rest as exclusive.
Each device now has the function
shared_procimg=True, the new values are now also immediately set in the
- Bugfix: When
.core.AnLEDs were not set.
.exportflag of replaced IOs can be adjusted in the program at runtime. This setting is will be saved by
.export_replaced_ios()in the configuration file – read from there.