-
Notifications
You must be signed in to change notification settings - Fork 20
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
ENH: ND state motion FBs #163
Merged
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
…t to make it pass
…th array of variable length arrays.
Some notes about my struggles today:
|
Co-authored-by: Ken Lauer <[email protected]>
Co-authored-by: Ken Lauer <[email protected]>
Co-authored-by: Ken Lauer <[email protected]>
Co-authored-by: Ken Lauer <[email protected]>
Co-authored-by: Ken Lauer <[email protected]>
I've realized that it will not be practical to do any further review on this PR, despite there being more items to address Instead, I will do the following:
|
This was referenced Jul 14, 2023
I've created a bunch of follow-up items. Some of them are easy, some of them are urgent and need to be done before a tag, and some of them are neither. |
This was referenced Jul 27, 2023
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.
Description
This monster is ready for review if anyone is brave enough to take it on. I understand if you don't have time, I don't expect to merge it immediately as it still needs some interactive testing.
This is a really big PR, but most of the line changes are from automatic build updates rather than actual lines of written structured text. Each FB should be as close to single-purpose as possible, so hopefully they are understandable on an individual level.
The main user entry point for the code are the function blocks named e.g.
FB_PositionState1D
,FB_PositionStatePMPS2D
, and the other similarly-named bocks. These have nearly identical input/output APIs and each calls the same "Core" function blocks directly. The core function blocks fan out to include each of the various single-purpose function blocks.This PR provides new states FBs, as a replacement/upgrade of the previous states FBs, that will let us move multiple motors at once to a multi-dimensional set position coordinated with PMPS with all existing protections. The goal is to do it in a way that is easier to understand and debug and more easily testable with
TcUnit
than the previous state function block maze, without making it harder to use the state movers on beamline PLCs.The user still needs to allocate their own pragma'd enum, but the user no longer needs specific subclass incantations and instead can use the entry point function blocks and pass their enum as VAR_IN_OUT. For the multi-dimensional FBs, the user will provide one
ST_PositionState
array per motor, and otherwise the experience is nearly identical.The function blocks here are implemented up to 3D, but there's no reason why they can't be trivially expanded to 4D, 5D, ... etc., as needed.
The PMPS blocks now support dynamic parameter changes, e.g. you can completely switch out the database lookup key in your program and expect the new state to load in and be available promptly. You can also disable the various bits of the PMPS handling in code if the requirements demand it (e.g. if a specific protecting device is present).
The underlying composite function blocks pre-allocate an array of N motors rather than using variable length arrays. This is entirely because the TwinCAT compiler was very unhappy with multi-dimensional nested function blocks of variable length, and doing it this way instead made it happier.
Full set of included changes, in the order they are encountered in the diff:
DUT_
(and one unprefixed struct) have been renamed toST_
In line with theTwinCAT variable naming section in our style guide. The old names are moved to a "Deprecated" subfolder and are now "obsolete" aliases of the new names, so old code will continue to work albeit with a compiler warning.ProductVersion
has been removed from all the xml headers via project setting to reduce diff spam.nMaxStateMotorCount
andnMaxStates
have been added as global variables onMOTION_GVL
to keep track of the highest dimension and highest number of states used in the PLC, in case we want to tune the state count or motor count down.MotionConstants.MAX_STATE_MOTORS
has been added as a configurable global constant.FB_PositionStatePMPS2D
.FB_PositionState2D
.Interactive
program has been supplanted byPRG_TEST
which runs the unit tests.3.1.4024.35
so it will automatically be opened at that version. This is the correct version for running the unit tests interactively onplc-tst-motion
.Motivation and Context
How Has This Been Tested?
Lots and lots of unit tests
I think this needs some trial runs with the common component library and in TMO with the FZP before I can consider it fully tested. I mainly want to make sure that the fast faults are generated fully, and that the PV structure for the 1D function blocks did not change.
Where Has This Been Documented?
I wrote an extensive readme, but probably there is more to write and some of that readme should make it onto the confluence documention.
Pre-merge checklist
Always Newest
version (Library, *
)pre-commit
or ranpre-commit run --all-files