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

An error #29

Closed
Byeongdulee opened this issue Aug 19, 2021 · 4 comments
Closed

An error #29

Byeongdulee opened this issue Aug 19, 2021 · 4 comments

Comments

@Byeongdulee
Copy link

Hi,
I am trying to make my own motorRecords by modifying db and found examples under tests.
My softioc is pip installed, and it produces the error below:

pythonSoftIOC/tests] python sim_asyncio_ioc_override.py myprefix
Traceback (most recent call last):
File "sim_asyncio_ioc_override.py", line 36, in
softioc.iocInit(asyncio_dispatcher.AsyncioDispatcher(event_loop))
TypeError: init() takes 1 positional argument but 2 were given

@AlexanderWells-diamond
Copy link
Collaborator

Hi Byeongdulee. I think your problem is here:

asyncio_dispatcher.AsyncioDispatcher(event_loop)

AsyncioDispatcher doesn't accept any arguments. It certainly doesn't want to take an input event loop, as it creates one itself. If you want you can use that created dispatcher's loop for further asyncio processing, something like this:

dispatcher = asyncio_dispatcher.AsyncioDispatcher()
asyncio.run_coroutine_threadsafe(my_method(), dispatcher.loop)

@thomascobb
Copy link
Contributor

softioc.iocInit(asyncio_dispatcher.AsyncioDispatcher(event_loop))

These changes were added in master, but were not released. I will make a release later today and comment on here.

make my own motorRecords

This will not work at the moment, as pythonSoftIOC does not build in support for the motor record. There are two things that would need to be done to make that work:

Unfortunately we don't have the time to do either of those at present

Can I ask what is your use case for making an IOC with python device support for a motor record?

@Byeongdulee
Copy link
Author

Thank you Alexander and Tom.
I have been working with a PI piezo stage. The PI has updated its firmware, but the epics driver is not yet as far as I know. Hope to use the DIO of the controller programmatically, for example to send or receive a detector trigger. It could be done in other ways, but since PI's python support is available, I thought pythonsoftioc would be ideal if possible.
Another example is to make a simple IOC for the UR robot.

@thomascobb
Copy link
Contributor

If you avoid the motor record, then you could do this with pythonSoftIOC. If you need the motor record I'm afraid it won't be suitable at the moment

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

3 participants