-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data path and synchronisation, and refactoring #17
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A lot of changes related to data path and synchronisation and to general code readability.
Issues approached
Closes #15. The final idea was a FIFO buffer on the PLC that then required data to be streamed via TCP to the adapter. This ensures that nothing is missed - Modbus was simply not reliable enough no matter what buffer implementation was used.
Approaches #11. The 50Hz readings are now written to a file along with some to-be-defined secondary readings.
Approaches #12 in that the graph adapter has been removed now that it is not associated with file writing. The data stored has been moved into the main livex class.
References #16 in that the mechanism to trigger the cameras has been decided - an external source and not the main PLC. This is for consistency reasons.
References #3. Some UI elements have been 'componentised' to make future changes easier.
Changes made
+ PLC code completely refactored. The looping tasks are moved to their own files with any relevant functions.
~ PLC now operates on interrupts instead of comparison timers and millis(). At present, that's one timer for the 'secondary' functions (default 200Kus) and a pin interrupt for the PID readings.
~ A decision made about the data synchronisation, this PLC is too busy to consistently also manage cameras. It consistently sends signals at least one millisecond out from a regular period even if the average is perfect. This will be manged by an external device (TBD, another smaller PLC?), which will also trigger the PID readings from the PLC to ensure that these are in-time with the data
+ Buffer added to PLC. Values are added to this in the 'pid task' (which is to be renamed?) and removed from this when written via TCP in the 'comms task'.
+ The 50Hz data is now streamed via TCP to the adapter. This queues up data and the adapter will read this data at a rate of twice the pid frequency (defined in config) so that it can catch up.
+ Adapter now writes data to a file. The name is fixed right now so it just appends to that file whenever you click 'acquire'.
+ FileWriter class now exists independently of graph adapter
- Graph adapter is gone, the temperature monitoring graph is now in the livex adapter with a retention defined in the config.
+ Added a lot of options to livex.cfg to make these values easier to adjust
~ Some config options changed
~ Controls (auto set point control, thermal gradient, motor) moved to their own Python files to match PID and reduce clutter in
livex.py
. This includes definition of address dictionaries for these classes inmodbusAddresses.py
.~ Controls moved to their own React components to make this easier to edit in future
Future notes