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

Callback fails when state machine in PLC overwrites requested value #13

Open
mac-kan opened this issue Nov 14, 2024 · 3 comments
Open

Comments

@mac-kan
Copy link
Contributor

mac-kan commented Nov 14, 2024

With the ads module, it is possible to setup an output record, e.g. BO (EnableAxis), to control a BOOL variable (bEnable) in a Beckhoff PLC. It is possible to add an info tag to the record definition to allow callbacks to update the BO record in case the PLC variable has been updated from the PLC. See example:

record(bo, "$(P)$(M1)$(B)EnableAxis") {
    field(DESC, "Enable axis")
    field(PINI, "1")
    field(TSE,  "-2")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),0,1)ADSPORT=852/LightShutterSystem.aFbLightShutter$(C)[$(CH)].stAxis.stControl.bEnable?")
    field(ZNAM, "Zero")
    field(ONAM, "One")

    info(asyn:READBACK, "1")
}

Problem:
*A state machine is used in the PLC to govern if the BOOL variable bEnable is allowed to only be FALSE.
*A pvput is made to EnableAxis to turn the value to TRUE: pvput EnableAxis 1
*The requested value of TRUE is directly overwritten by the state machine in the PLC to FALSE.
=> The callback is not updating the BO record to FALSE, but remains TRUE.

@tboegi
Copy link
Contributor

tboegi commented Nov 14, 2024

Is that
bEnable?
with a question mark ?

@mac-kan
Copy link
Contributor Author

mac-kan commented Nov 14, 2024

Yes, the OUT field address ends with "bEnable?".

@tboegi
Copy link
Contributor

tboegi commented Nov 18, 2024

Yes, the question mark is needed to enable the readback functionality
inside the driver.
The "old" codebase (v2.0.2) did rely on notifications, which do not work.
The "new" codebase (v2.1.0) allows to use a 1 second poll instead.
I need to figure out, how to configure it.

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

No branches or pull requests

2 participants