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

devMotorAsyn: remove initEvent in init_record() #167

Conversation

tboegi
Copy link
Contributor

@tboegi tboegi commented Aug 11, 2020

When the motorRecord is initialized, init_record() is called.
For asynMotors init_record() calls init_controller() in devMotorAsyn.c

From here, the encoder ratio is send to the driver.
After doing that, the code "locks" the execution waiting for a callback
to call epicsEventSignal(pPvt->initEvent) which "unlocks" the code.

As Mark Clift points out, this code can be simplified and the initEvent
can be removed.

Mark Rivers suggested to use the asynFloat64SyncIO interface,
which locks the asyn port when calling the driver.

@kmpeters
Copy link
Member

I don't understand why the motorResolution_ parameters is removed and why motorResolutionString is renamed motorRecResolutionString

@tboegi tboegi force-pushed the asynMotor-remove-initEvent branch from e3f7e3a to fe884ce Compare August 12, 2020 19:44
@tboegi
Copy link
Contributor Author

tboegi commented Aug 12, 2020

I don't understand why the motorResolution_ parameters is removed and
why motorResolutionString is renamed motorRecResolutionString
Neither do I.
I removed the second commit, sorry for confusion.

When the motorRecord is initialized, init_record() is called.
For asynMotors init_record() calls init_controller() in devMotorAsyn.c

From here, the encoder ratio is send to the driver.
After doing that, the code "locks" the execution waiting for a callback
to call epicsEventSignal(pPvt->initEvent) which "unlocks" the code.

As Mark Clift points out, this code can be simplified and the initEvent
can be removed.

Mark Rivers suggested to use the asynFloat64SyncIO interface,
which locks the asyn port when calling the driver.
@tboegi tboegi force-pushed the asynMotor-remove-initEvent branch from fe884ce to 9064380 Compare October 12, 2020 06:20
@kmpeters kmpeters merged commit 891a66e into epics-modules:master May 15, 2023
@kmpeters kmpeters added this to the R7-3 milestone May 23, 2023
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.

2 participants