Skip to content
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

BUG: reverse the in/out order in the in/out example fbs to match their enum #209

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

ZLLentz
Copy link
Member

@ZLLentz ZLLentz commented Feb 2, 2024

Description

Reverse IN and OUT indices for the example state FBs to match the enum, because if the order is wrong then IN sends us to OUT and vice versa.
See https://github.com/pcdshub/lcls-twincat-motion/blob/master/lcls-twincat-motion/Library/DUTs/E_EpicsInOut.TcDUT

Motivation and Context

closes #208

How Has This Been Tested?

Fixes the remaining issue in pcdshub/lcls-plc-kfe-rix-motion#61

Where Has This Been Documented?

only here

Pre-merge checklist

  • Code works interactively
  • Test suite passes locally
  • Code contains descriptive comments
  • Libraries are set to Always Newest version (Library, *)
  • Committed with pre-commit or ran pre-commit run --all-files

astPositionState[1] := stIn;
astPositionState[2] := stOut;
// Assemble the states array, matching the enum values (OUT is 1, IN is 2)
astPositionState[1] := stOut;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-review thought before I leave today: this should probably look more like this:

astPositionState[E_EpicsInOut.OUT] := stOut

@ZLLentz
Copy link
Member Author

ZLLentz commented Feb 6, 2024

The unit tests pass, provided you don't run them on the BSD PLCs... this is new to me and something I'll have to resolve as part of the TwinCAT CI project.

I'd appreciate if I could get 1 sanity check on this. The diff is pretty straightforward and doesn't require a full understanding of the library.

Copy link

@slactjohnson slactjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZLLentz ZLLentz merged commit 65936fe into pcdshub:master Feb 6, 2024
9 checks passed
@ZLLentz ZLLentz deleted the bug_reversed_inout branch February 6, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IN and OUT reversed in provided in/out FB
2 participants