Commit Graph
100 Commits
Author SHA1 Message Date
akira fdfe394750 Update changelog for 2.7.0~rc1-1 release 2023-10-27 16:52:14 +02:00
akira 1f1cbfa755 Merge tag 'unstable/2.7.0_rc1' into pkg/debian_rc 2023-10-27 16:51:07 +02:00
akira 4ce33f925b packaging(deb): Create debian release candidate packages 2023-10-27 16:49:09 +02:00
akira 653f90ab90 test: Add tests directory to migrate unit tests to project 2023-10-27 15:42:18 +02:00
akira ab2703a4d3 feat: Add context manager for ios
Signed-off-by: Sven Sager <akira@narux.de>
2023-10-27 15:42:18 +02:00
akira 9a90efeaf2 chore: Increase to RC1 of upcoming Release 2.7.0 2023-10-27 15:42:18 +02:00
akira ecf91f56db style: Format everything with black (100 characters per line)
Signed-off-by: Sven Sager <akira@narux.de>
2023-10-27 15:42:18 +02:00
akira ba708fc145 style: New line length 100 characters and using black as formatter
Signed-off-by: Sven Sager <akira@narux.de>
2023-10-27 15:42:18 +02:00
akira 801efe7fb4 build: Fix Makefile targets to match GNU coding standards
Signed-off-by: Sven Sager <akira@narux.de>
2023-10-27 15:42:17 +02:00
akira 37ccac7f79 chore: Update git ignore file
Signed-off-by: Sven Sager <akira@narux.de>
2023-10-27 15:35:45 +02:00
akira 8a8873e54a feat: Import DeviceType on module level
DeviceType can be used for advanced search filters in combination with
RevPiModIOSelected.

Signed-off-by: Sven Sager <akira@narux.de>
2023-09-15 16:35:00 +02:00
akira 9ad8ae0055 feat: Add new and missing ProductTypes to pictory.py module
Signed-off-by: Sven Sager <akira@narux.de>
2023-09-15 16:35:00 +02:00
akira 0bc398e627 fix: Insert correct LICENSE.txt file to project (LGPLv2)
On February 3, the project was placed under the LGPLv2 license, with
the consent of all contributors. Unfortunately, an incorrect version
of the license was inserted into the LICENSE.txt. This is now fixed
with the text of the LGPLv2, which has been valid for RevPiModIO2
since version 2.6.0.

Refs: 7d482d49
Signed-off-by: Sven Sager <akira@narux.de>
2023-09-15 16:31:01 +02:00
akira b1bf07f004 Merge tag '2.6.1' into pkg/debian
Release 2.6.1
2023-09-09 12:04:58 +02:00
akira acc59ccaa5 chore: Release 2.6.1
Signed-off-by: Sven Sager <akira@narux.de>
2023-09-09 11:55:49 +02:00
akira b279209b2b build: Add environment variable to set alternative venv path
Signed-off-by: Sven Sager <akira@narux.de>
2023-09-09 11:17:56 +02:00
akira b02c4011d7 fix: Changed misleading text of a ProcimgWriter warning
If the IOs cannot be written quickly enough by the ProcimgWriter,
this indicates high system utilization. The cycle function itself
would trigger a different message through the lck_refresh lock.

Signed-off-by: Sven Sager <akira@narux.de>
2023-09-09 11:11:57 +02:00
akira 502bff3028 Update changelog for 2.6.0-1 release
Signed-off-by: Sven Sager <s.sager@kunbus.com>
2023-08-18 11:17:32 +02:00
akira 8f1ba0094b packaging(deb): Start packaging branch
Signed-off-by: Sven Sager <akira@narux.de>
Signed-off-by: Sven Sager <s.sager@kunbus.com>
2023-08-18 11:17:30 +02:00
akira 521a0eb589 fix: Wrong values in buffer with autorefresh and shared_procimg active
When using `autofresh` in combination with `shared_procimg`, the
outputs were written to the process image, but kept with old values
in the local buffer. A query to a set output could therefore display
an incorrect value under certain circumstances.

Closes: #25
Signed-off-by: Sven Sager <akira@narux.de>
2023-08-18 08:33:34 +02:00
akira 1afe16053d fix: Set shared_procimg value is stored in the device
Classes have accessed a global shared_procimg value during
instantiation. However, this value is managed directly for each
device individually. There can be no global value.

Signed-off-by: Sven Sager <akira@narux.de>
2023-08-17 12:28:45 +02:00
akira 596658d656 fix: autorefresch with shared_procimg writes all outputs automatic
Fixes the bug that with automatic process image update and
shared_procimg, outputs of devices are also written without automatic
update enabled.

Signed-off-by: Sven Sager <akira@narux.de>
2023-08-17 12:28:45 +02:00
akira 70a0721680 style: With shared_procimg, save changed outputs in set instead of list
In sets, elements can only occur once. Therefore, no `if` statement
has to check whether the element is already included in the list.

Signed-off-by: Sven Sager <akira@narux.de>
2023-08-17 12:28:42 +02:00
akira 4cb0194f23 chore: Release 2.6.0
Signed-off-by: Sven Sager <akira@narux.de>
2023-06-28 16:03:04 +02:00
akira 82311c9b00 fix: Colors of LEDs are now controlled correctly
The wrong colors of the LEDs on the RevPi Connect 4 were controlled when
using the A* properties.

Signed-off-by: Sven Sager <akira@narux.de>
2023-06-28 15:34:54 +02:00
akira 9c66e0c1b6 ide: Add code inspection values to project
Signed-off-by: Sven Sager <akira@narux.de>
2023-06-20 10:47:46 +02:00
akira d29e733274 build: Add sphinx to build documentation
Signed-off-by: Sven Sager <akira@narux.de>
2023-06-20 10:39:29 +02:00
akira 6f4777317e fix: Changed DevSelect from namedtuple to a class
The class can be used for filtering devices and provides the user with
more extensive documentation.

Signed-off-by: Sven Sager <akira@narux.de>
2023-06-09 08:11:12 +02:00
akira 1de435b17f fix: Adjustment of the inheritance of devconfigure
When switching to the modular approach, the addresses of a core were
accidentally adopted as a global configuration.

Signed-off-by: Sven Sager <akira@narux.de>
2023-06-08 19:01:48 +02:00
akira 40ada14b07 chore: RC version 2.6.0rc6
Signed-off-by: Sven Sager <akira@narux.de>
2023-06-08 14:31:03 +02:00
akira c8b42b5202 fix: Add modular design for RevPiStatus byte
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
2023-06-08 14:23:08 +02:00
akira 207a8e92e8 Add __about__.py to handle version number of project in one place 2023-05-13 11:57:04 +02:00
akira 3771a7847e Replaces Master-Slave with Client-Server
Expunging all occurrences of inappropriate language of the query and
response paradigm of PLC communications. We are familiar with the Modbus
terminology and fully support this change.
https://www.modbus.org/docs/Client-ServerPR-07-2020-final.docx.pdf
2023-02-07 09:38:11 +01:00
akira 7d482d498c Change license from LGPLv3 to LGPLv2 after approval of all contributors
https://github.com/mindstorm38 approved license change
https://github.com/nbuchwitz approved license change
2023-02-03 12:10:43 +01:00
akira 8ddb323f24 Update documentation 2023-01-31 20:05:04 +01:00
akira 05e4ff96ca Code and project cleanup 2023-01-20 17:08:35 +01:00
akira 1b7397e608 Improved device search function and create run_net_plc shortcut 2023-01-20 12:31:59 +01:00
akira c7b2e59063 Merge branch 'feature/deviceselect' into srclayout
# Conflicts:
#	src/revpimodio2/modio.py
#	src/revpimodio2/netio.py
2023-01-20 11:18:08 +01:00
akira 1057e6daa4 Reorder package to src-layout.
Move package to src directory and update project base files for build
process.
2023-01-19 13:20:26 +01:00
akira 36c30ae6d6 replace_io accepts keyword wordorder
Now you can set the wordorder for a replaced IO on virtual devices. This
will help you to get the right values on modbus devices.
2023-01-12 23:26:09 +01:00
akira 0dd9c2637d Read export flag from piCtory for watchdog output
The watchdog output on a revpi connect will be set as exported, if you
set the export flag in pictory.
2022-12-22 16:40:33 +01:00
akira 41e13999ad Next release 2022-04-21 15:55:31 +02:00
akira 438a76d5bb Add position numbers in warning text of all devices with equal name in piCtory
close #21
2022-04-03 08:14:50 +02:00
akira 08c9b59e48 Improve troubleshooting details on equal device names in piCtory.
Tanks Kees @kjkoster

close #21
2022-04-02 20:43:35 +02:00
akira 8f0539edfc Configure replaced ios from file before starting autorefresh
Very high load of cpu could cause cycle time warnings while apply replaced ios from file.
2022-03-25 11:57:00 +01:00
akira c635376ee2 Next release 2021-11-03 20:17:38 +01:00
akira 068732d424 Merge branch 'cycle_precision' into develop 2021-11-03 20:15:01 +01:00
akira 36ff69aaa6 Sync the first cycle with imgwriter after calling .cycleloop 2021-10-24 14:28:33 +02:00
akira c9fcc5834f Add prefire to reg_timerevent function 2021-10-24 10:53:41 +02:00
akira bc8a13da1b Warn the user faster, if the cycle time is exhausted 2021-10-24 10:50:42 +02:00
akira b90e858fef Make the cycle more precise
Measure each cycle of process image synchronisation and do not build a mean value for that.
The cycle function is now exactly timed, even if the individual runtimes are different.
2021-10-17 19:11:04 +02:00
akira 5c3568d4b8 Merge pull request #19 from nbuchwitz/fix/scope-bitaddress
Scope bit address with byte address
2021-10-16 10:47:07 +02:00
akira 577e764741 Next release 2021-09-23 16:33:35 +02:00
akira 8999e71d2e Bugfix with shared process image in cycle loop
Shared outputs was written after reading the process image for current cycle. So the values for the outputs was one cycle in the past.
2021-09-22 16:25:12 +02:00
akira 9c7c679abc Bugfix on handle default values of type byte (frm="*s") in export_file 2021-09-09 12:31:21 +02:00
akira 8607f25b37 Bugfix for offset check in piCtory file 2021-08-22 17:10:31 +02:00
akira 0edfb4ef85 Check device offsets in piCtory file and ignore IOs with wrong offsets
The modbus 150 Device has a memory gap and piCtory does not calculate the right offset of the following device - We will warn the user.
2021-07-28 07:38:34 +02:00
akira 498d200e41 The replace_io file can handle default values of type byte (frm="*s") now. 2021-07-28 07:37:20 +02:00
akira af15bd36cd Internal change RevPi*IOSelected search method
Internal device search is more flexible to expand the search functions of
RevPi*IOSelected in the future. There are no changes in usage.
2021-05-03 09:56:12 +02:00
akira a05770e4f8 Added MIO memory value mappings 2021-05-01 08:12:45 +02:00
akira 17666edb85 Merge pull request #12 from nbuchwitz/feature/product-type
introduce ProductType enum
2021-05-01 07:56:56 +02:00
akira ae8dcf7866 Next release 2021-04-18 09:14:58 +02:00
akira 89a447abb9 Bugfix: Calculate correct lengths despite IO gaps in incorrect piCtory file 2021-04-14 09:09:10 +02:00
akira 687c7ab91a Flat: Switch and Relais as real io of core class, added MEMs to pictory.py 2021-02-12 19:43:11 +01:00
akira d35b09e209 Next release 2021-01-31 19:35:29 +01:00
akira 6608bd965c Sync write of outputs with autorefresh/cycle or .writeprocimg, if shared_procimg=True
If shared_procimg=True, ModIO wrote the new set values directly to the process
image without cycle sync mechanisms. As a result, the IOs could change status
several times within the cycleloop, which is wrong.
2021-01-31 13:31:05 +01:00
akira 57c56ce207 Corrected misleading message 2021-01-17 10:21:33 +01:00
akira 2904c7b187 Next release 2021-01-14 19:08:28 +01:00
akira 38b655ad29 Merge branch 'develop' 2021-01-14 19:02:59 +01:00
akira cc9b4521e9 Only write export flag to replace_io_file, if the value was set during runtime 2021-01-13 10:36:36 +01:00
akira dc731afafd Parameter shared_procimg can be set per device
The shared_procimg Parameter is still a global parameter, but can now be set
per device as well with .shared_procimg(...) of all devices.
2020-12-16 18:46:45 +01:00
akira 6beb05577e Add blocking parameter to .cycleloop
If you want to use a cycleloop function and your own tasks, you can set
blocking=False in .cycleloop(...) call. Same as .mainloop(...) call.
2020-12-14 19:50:48 +01:00
akira 4ac1283c5b Bugfix: Set A1 - A5 LED did not work with shared_procimg=True 2020-12-14 19:41:56 +01:00
akira 79164bd41b Add support for RevPi Flat 2020-10-10 14:14:57 +02:00
akira beb7a36cc7 Set values in process image AND buffer with shared_procimg=True 2020-09-30 16:04:29 +02:00
akira 9460c4f106 Cycleloop does not raise Exception, run_plc accept debug flag.
User has to use maxioerrors = n, if the program should crash on process
image errors.
If the ProcimgWriter helper is running but get no new data for 2500 ms,
the cycleloop will print just a warning. Cycle function is paused for
that time. Most interesting for RevPi NET classes.
2020-09-09 09:47:55 +02:00
akira 6f5415a567 Add piCtory value mappings for RevPi Compact memories in pictory.py. 2020-09-08 07:26:44 +02:00
akira 963e173dc2 Redesign netio.py to prevent errors and provide clean source code 2020-08-30 10:41:52 +02:00
akira ff0f84bb03 Next release 2020-08-29 14:59:05 +02:00
akira f34d1a1a38 Restore fix c20caaa5d5 2020-08-29 14:00:37 +02:00
akira e27318f49d Merge branch 'master' of https://github.com/naruxde/revpimodio2 2020-08-29 11:39:58 +02:00
akira 8cef5222ac Next release 2020-08-29 11:39:03 +02:00
akira 990647a160 Bugfix: writeprocimg did not flush buffer on network error 2020-08-29 11:16:14 +02:00
akira c20caaa5d5 Bugfix: Wrong buffer size after network error 2020-08-26 23:27:05 +02:00
akira 5a0d88efe1 Include classes from pictory module to package __init__.py. 2020-08-17 19:52:16 +02:00
akira 5e32bd12ff Add .changed(io, edge) -> bool function to CycleTools.
You can detect changes of IO values between two cycles. The function will
return True or False.
On bit IO objects you can also use parameter edge RISING or FALLING.
2020-07-19 18:20:39 +02:00
akira 85c4babc2a Add library const PROCESS_IMAGE_SIZE should it change some day in future. 2020-07-14 19:35:50 +02:00
akira 110a366e14 IOs are callable to get or set values.
You do not have to use the .value property. Just call
the IO .io.io_name() to get the value. If you like to set a value
just pass the value to the call .io.io_name(new_value).
2020-07-11 17:13:09 +02:00
akira bf4b450bc6 Bug fix for NetIO with autorefresh=True 2020-06-24 18:24:18 +02:00
akira a7802178e9 Added .device to Cycletools, added revpimodio2.run_plc shortcut to run cycleloop
Changed readinto buffer in ProcimgWriter
2020-05-16 11:25:08 +02:00
akira a6a227e99e Watchdog for all RevPis, cycletools with .core/.io/.runtime, bugfix on MemIO for str()
All RevPis got .core.wd for Software-Watchdog with RevPiPyLoad
All RevPis has .core.wd_toggle() function to toggle watchdog bit
Cycletools has .core and .io attribute to be independent of rpi object
Cycletools has .runtime to get the actual runtime of function
2020-05-03 13:43:09 +02:00
akira d54a588a78 Return all IOs of base devices in the .io object as int() not bytes() when using .value
close #7
2020-04-29 21:20:06 +02:00
akira 9d31bb5002 Add support for RevPi Compact, better calculation of A1, A2, A3 on core object 2020-04-29 20:52:09 +02:00
akira 421cc17dbd Cleanup and new version number 2020-04-12 08:09:21 +02:00
akira c11b43507c DeprecationWarning when using direct_output - replaced by shared_procimg
close #3
2020-04-08 18:43:40 +02:00
akira 284317cef0 Moved call of cleanupfunc to exit jobs, wait mainloop end on thread (blocking=False).
close #4
2020-04-06 12:35:53 +02:00
akira ba52d6e986 Add .last cycle flag to Cycletools, better sync of loops on program end.
The .last cycle flag will be True on the last cycle, if the program received
an exit event or after calling .exit().
close #4
2020-04-06 11:10:06 +02:00
akira 95193cef8b Remove bit shifting on each get bit value and event loop 2020-03-31 19:58:35 +02:00
akira 7fd4b01b57 Protocol change on flush() 2020-03-17 20:21:31 +01:00
akira 245a5ac5cf Use struct module to pack net commands, send files with length
The struct module is more efficient than int.to_bytes.
piCtory and ReplaceIO file length in the first 4 bytes of transmission
2020-03-08 20:53:57 +01:00