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

SM300: Issue with definition and use of MSTP macros #7349

Open
2 tasks
boeuf-codes opened this issue Sep 12, 2022 · 0 comments
Open
2 tasks

SM300: Issue with definition and use of MSTP macros #7349

boeuf-codes opened this issue Sep 12, 2022 · 0 comments

Comments

@boeuf-codes
Copy link
Contributor

boeuf-codes commented Sep 12, 2022

Where?

SM300 - st-common.cmd

How?

When IOCs SM300_02 and SM300_03 were created, some issues with macro definitions surfaced
(See: #4461)

First, config.xml claims to set a default value for MSTP1 and MSTP2 of 200, but this seems to be inconsistent: when MSTP1 and MSTP2 macros are not set, and are accessed in st-common.cmd file by the following, their logs error with macLib: macro <...> is undefined.

dcalc("VELO1", "15000/$(MSTP1)", 1, 2)  # Feed rate / steps to give velocity
dcalc("VELO2", "15000/$(MSTP2)", 1, 2)  # Feed rate / steps to give velocity

More importantly, the value of MSTP1 and MSTP2 are hard-coded to exactly 200 and 1000 respectively a couple lines below:

# 2^data format * Gear factor denomentor / Gear factor numerator
dcalc("MSTP1", "100*10/5", 1, 1) 
dcalc("MSTP2", "100*10/1", 1, 1) 

Thus, any value given to MSTP1 and MSTP2 will only affect the value of the VELO macros, since MSTP1 and MSTP2 immediately defect to their hard-coded values above - which seems bizarre.

In order to refactor this behaviour, it would be worth discussing how valid the above logic is in regards to how these IOCs are actually used, and how to reflect that more coherently in this file.

Acceptance criteria

  • Discuss how the MSTP and VELO macros should be defined in order to reflect their use by scientists.
  • Refactor st-common.cmd to reflect the above.

How to Test

verbose instructions for reviewer to test changes
(Add before making a PR)

@boeuf-codes boeuf-codes changed the title [Instrument or device name, e.g. WISH]: [Brief description of issue] SM300: Issue with definition and use of MSTP macros Sep 12, 2022
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