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

Beckhoff: switch to using AdsDriver #7522

Closed
2 tasks done
rerpha opened this issue Dec 8, 2022 · 2 comments
Closed
2 tasks done

Beckhoff: switch to using AdsDriver #7522

rerpha opened this issue Dec 8, 2022 · 2 comments
Assignees
Labels

Comments

@rerpha
Copy link
Contributor

rerpha commented Dec 8, 2022

As a developer I would like to try and use https://github.com/Cosylab/adsDriver as a replacement for tcioc as this means we can avoid having to use a TPY file/fixed PLC memory addresses and instead use some sort of mapping file to just serve the PLC vars we need.

The TPY file has given us grief a few times, i spent ages (more than a whole week) trying to figure out why it wasn't working when working on #6097 so decided to give AdsDriver a try. It has proved to work fairly well against the PLC in r106 as well as a local PLC after a fix which has been submitted upstream. Overall AdsDriver is much simpler as it is only really doing 1 thing (serving ADS vars) rather than 3 (parsing a TPY, mapping these to epics types, then serving them ads read/write)

Acceptance criteria

  • both above repos are modified (and pushed upstream if possible?) to compile on windows
  • AdsDriver is tested against a real PLC and a simulated one
@rerpha rerpha changed the title Beckhoff: try out AdsDriver [Timebox: ? Beckhoff: try out AdsDriver [Timebox: ?] Dec 8, 2022
@rerpha rerpha added the proposal label Dec 8, 2022
@rerpha rerpha self-assigned this Dec 19, 2022
@rerpha
Copy link
Contributor Author

rerpha commented Dec 19, 2022

I have been a bit cheeky and done this - it seems to work well as a drop in replacement for tcioc and gets round the annoying TPY changes which are taking up lots of time (on SANDALS for example)

Freddie managed to get it building on windows, and working against the system-installed twincat/ads library (rather than the github one) it works very well to provide us with two-way ADS comms.

There are a few quirks which are based on races between ADS, which updates very quickly (every 1ms!) and our epics motor record which updates every 200ms, so I have asked the maintainers if it'd possible to add an ioc shell command or modify their AdsOpen() method to make the poll rate configurable. some of the numbers below dont move due to a deadband as well i think.

Here you can see it in action, with axis 11 being "theta" of a reflectometry virtual instrument:
adsdriver

@rerpha
Copy link
Contributor Author

rerpha commented Dec 20, 2022

PRs for this- i propose that we switch from tcioc to adsdriver as it seems to work well and does not rely on the TPY file. Below should be a drop-in replacement for using tcioc, instead of using a tpy file we now just have a template file for each axis.

ioc: ISISComputingGroup/EPICS-ioc#760
beckhofftestrunner: https://github.com/ISISComputingGroup/BeckhoffTestRunner/pull/16/files
release notes (this closes multiple issues)
#7509
#7513
#7534

@rerpha rerpha changed the title Beckhoff: try out AdsDriver [Timebox: ?] Beckhoff: switch to using AdsDriver Dec 20, 2022
@rerpha rerpha added this to the SPRINT_2022_11_24 milestone Dec 20, 2022
@rerpha rerpha removed the proposal label Dec 20, 2022
@rerpha rerpha added 8 13 and removed 8 labels Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants