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.
The Kunbus GmbH will now publish their new Jessie – Image for the Revolution Pi! Our RevPiModIO has been adapted for the new image and is now released for both versions (wheezy and jessie)!
BUGFIXES: This version also includes bug fixes and should be imported by everyone (regardless of the Jessie image)!
In addition, we are proud to announce that our module in the Jessie Image can be obtained via the Kunbus Repositories! So the installation and the update is easily made!
# Update first
pi@RevPi ~/ $ sudo apt-get update
# And install easily
pi@RevPi ~/ $ sudo apt-get install python3-revpimodio
The updates will of course be automatically imported, if you update your RevPi.
Downloads and sources