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

units & offset updates not correct in Diffractometer #128

Closed
prjemian opened this issue Apr 21, 2021 · 2 comments · Fixed by #129
Closed

units & offset updates not correct in Diffractometer #128

prjemian opened this issue Apr 21, 2021 · 2 comments · Fixed by #129
Assignees
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

Example was revised and tested. The tests have exposed some problems with how changes in units and offset are handled by the Diffractometer() class.

Need to revise how Diffractometer() responds to changes in units and offset signals. One problem observed is how the energy signal is affected when offset is changed.

Originally posted by @prjemian in #121 (comment)

@prjemian prjemian added this to the v0.3.16 milestone Apr 21, 2021
@prjemian prjemian added the bug label Apr 21, 2021
@prjemian prjemian self-assigned this Apr 21, 2021
@prjemian
Copy link
Contributor Author

Several things are off:

  • example should use energy_units, not energy_EGU`
  • should not set hkl.diffract.Diffractometer.energy in the Diffractometer() class
  • all PV update callbacks should not set self.calc.energy, instead call self._update_calc_energy()
  • ignore the value argument in self._update_calc_energy()

prjemian added a commit that referenced this issue Apr 22, 2021
prjemian added a commit that referenced this issue Apr 22, 2021
prjemian added a commit that referenced this issue Apr 22, 2021
@prjemian
Copy link
Contributor Author

When testing including a real EPICS IOC, used PVs from a soft IOC in lieu of a real monochromator. Here's the test daatabase record file for EPICS softIoc -d registers.db test command"

# file: registers.db
#
# purpose: test example for issue #72
# connect control system energy with diffractometer

record(ao, "EPICS:energy") {
  field(DESC, "monochromator energy")
  field(PREC, 5)
  field(EGU, "keV")
  field(VAL, 12.0)
}

record(ao, "EPICS:energy:offset") {
  field(DESC, "monochromator energy offset")
  field(PREC, 5)
  field(EGU, "keV")
  field(VAL, 0.0)
}

record(bo, "EPICS:energy:lock") {
  field(DESC, "lock hkl to mono?")
  field(ONAM, "locked")
  field(ZNAM, "unlocked")
  field(VAL, 0)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant