This update fixes the following errors:
- Bug fix when using duplicate device names in piCtory. The devices and IOs were not accessible!
NOTE: The naming of the devices should always be unique, without special characters and comply with the Python guidelines!!!
- The .cycleloop() could not be restarted after exiting. This bug has been fixed.
- VirtualDevices in the very old piCtory 1.0 version are now incremented from position number 64 (Kunbus default). These got previously position -1 and smaller.
- The device functions .get_allios(), .get_inputs() and .get_outputs() will not provide None objects. This occurred if not all bits of a byte were replaced with .replace_io(“name”, frm = “?”).
- The bool() conversion of an IO object now properly returns False if the value is 0.
- The .frm attribute of a replaced IO returns the pure formatting character.
- The .wait(…) function of the IOs checks the parameters passed.
- Further improvements to the code.
- Complete code check with unittest including coverage check.
Version 2.0.2 is stable!
After many test hours and a few minor improvements, RevPiModIO 2 is now FINAL! 😀
INFOS about the new version will be available soon!
In addition to the new, simplified syntax, we have added a new parameter “delay” for
.reg_event (...) and the new function
After many months of development and new features, we have now released the final version!
RevPiModIO Version 1
In addition to a few refinements and a bugfix with the byte order of the default values, this version is worthy to get the version number 1 😀
This version is still maintained, but we have learned by the development and the version 2 is in the starting holes! Look at the new syntax, which also offers many advantages in an interactive Python shell on the RevPi!
RevPiModIO version 2
There is a new update for the use of the analog module AIO.
- IOs of the analog module are instantiated with “signed=True”. This activates the value calculation with a sign. Otherwise, the value -1 would be 65535 and negative values would not be allowed in assignments.
With this update you can program more PLC with less Python code.
- The new
cycleloop reads the inputs, executes the passed function and writes the outputs in the set cycle time “
If you call
.devices.cycleloop(cyclefunction) in your program, it blocks at this point and cyclically executes the function “
cyclefuntkion“. To this function an instance of class RevPiCycletools() is passed, which includes tools such as clock markers, edge flags, or timer objects.
- New function for easy exit a cyclic or event-based program
- If the set update rate of the process image (
auto_refresh) is exceeded, you will get a warning – each time!
auto_refresh values greater than 1000 milliseconds could produce errors with
- Module closes faster with
- The module no longer blocks exit when using the Python shell’s interactive mode
Today we publish an update!
- A “byteorder” can now be configured for all IOs of the classes RevPiIO() and RevPiStructIO(). This is important for the int () conversion for values that are more than one byte long, e.g. At RevPi gateways (default is “little”)
- The class attribute “signed” has been inserted for the RevPiIO() class. This can be set to True if the int() conversion of the bytes() with sign is desired.
Particularly interesting for “counters” of the DI, DO and DIO modules, which in the case of down counting, otherwise display 65535.
rpi.devices["dio"]["Counter_1"].signed = True
rpi.devices[ "dio"][ "Counter_1"].value
Which would now show -1.
- Magic method __contains__ added to RevPiDevicelist and RevPiDevice. Now, queries are possible in the form of “dio02” in rpi.devices and “I_1” in rpi.devices [“dio02”], which check whether a device name is present or an IO name.
- RevPiDevicelist now also supports the Build-In function len (rpi.devices), which returns the number of devices including Core.
- RevPiDevicelist has got the new function writedefaultinputs(self, virtual_device).
- And other important internal changes that make this update necessary.
This version has a few small bug fixes, which occur under certain conditions.
- Should an error occur on the / dev / piControl0 device, e.g. due to a reset, this error is normally caught. In the version starting from 0.15.0, however, this raises an error itself 🙁
- If you use auto_refresh and the RevPiModIO is newly instantiated within the same program without call .cleanup(), the auto_refresh mode does not terminate cleanly.
- Fixed monitoring mode
- Since version 0.8.8, reg_event can also be used to register outputs in event monitoring. However, these were not evaluated.
NOTE: RevPiModio.devices.wait(…) Function is no longer compatible with previous versions!
We reworked our RevPiModIO module! This gives us better performance at .readprocimg () / .writeprocimg () and consumes fewer resources.
The RevPiModio.devices.wait (…) function has been completely rewritten. The old version had a return value of only True or False. It was not possible to evaluate the different cancel conditions, but this is urgently needed.
The Returned value is now an int() value! Values less than or equal to 0 are a successful wait, values greater than 0 are triggered abort conditions, such as the exitevent or the timeout.
More detailed in our Documentation.
In addition, all RevPiModIO.devices . * Procimgdev () functions have been removed as they have been marked as superfluous. Alternatively, the function can be performed by parameter transfer of the device to RevPiModIO.devices. * Procimg (device).You could also submit a list here RevPiModIO.devices. * Procimg ([device1, device2]).
More detailed in our Documentation.