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

MvInterface: wm wait for connection? #1125

Open
slactjohnson opened this issue Apr 12, 2023 · 1 comment
Open

MvInterface: wm wait for connection? #1125

slactjohnson opened this issue Apr 12, 2023 · 1 comment

Comments

@slactjohnson
Copy link
Contributor

Current Behavior

The wm method tries to immediately return, without waiting for the PV to connect.

Expected Behavior

This is in contrast with the user_readback signal, which implements a timeout.

Context / environment

This lead to a SmarAct motor class erroring out when attempting to use it as part of a script.

Steps to Reproduce (for bugs)

Script:

from pcdsdevices.epics_motor import SmarAct
motor = SmarAct('LM1K2:MCS2:01:m10', name='tst diag motor')
print(motor.wm())
@ZLLentz
Copy link
Member

ZLLentz commented Apr 12, 2023

Pros:

  • user scripts and interactive use less likely to error in confusing ways

Cons:

  • scripts that run with never-connecting devices get slowed down
  • some movable devices may not require full connection to return their position

Maybe implement similar to:

def wm():
    try:
        return self.position
    except DisconnectedError:
        self.wait_for_connection()
        return self.position

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