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

PyDMImageView not updating with images during scan #463

Closed
mdwyman opened this issue Jan 14, 2019 · 6 comments
Closed

PyDMImageView not updating with images during scan #463

mdwyman opened this issue Jan 14, 2019 · 6 comments
Assignees
Labels

Comments

@mdwyman
Copy link

mdwyman commented Jan 14, 2019

I modified the tutorial ui (main.ui) to view the output from a simulated area detector during a 1-d scan (21 points in the scan). In doing a scan, at each scan point, I get the following error in the terminal window from which pydm is launched (so it shows up 21 times for the example scan I've been running):

Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 234, in 'calling callback function'
  File "/APSshare/anaconda3/BlueSky/envs/pydm-environment/lib/python3.6/site-packages/epics/ca.py", line 539, in _onMonitorEvent
    args.usr(value=value, **kwds)
  File "/APSshare/anaconda3/BlueSky/envs/pydm-environment/lib/python3.6/site-packages/epics/pv.py", line 505, in __on_changes
    self.run_callbacks()
  File "/APSshare/anaconda3/BlueSky/envs/pydm-environment/lib/python3.6/site-packages/epics/pv.py", line 515, in run_callbacks
    self.run_callback(index)
  File "/APSshare/anaconda3/BlueSky/envs/pydm-environment/lib/python3.6/site-packages/epics/pv.py", line 537, in run_callback
    fcn(**kwd)
  File "/APSshare/anaconda3/BlueSky/envs/pydm-environment/lib/python3.6/site-packages/pydm/data_plugins/epics_plugins/pyepics_plugin_component.py", line 51, in send_new_value
    if value is not None and value != self.value:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I do not get any image in the view window. Other PVs in the window update properly (motor position, scan status). I'm not sure if this is a bug or I've simply missed a step.

My Platform
OS: RHEL7.6
Python 3.6.7
PyDM 1.6.2

I've attached the ui files:
betaScan.zip

@hhslepicka
Copy link
Contributor

@mdwyman this is a bug that was fixed by another issue. Would you mind to give it a try with the code available at master and see if it works ?

@hhslepicka hhslepicka added the bug label Jan 14, 2019
@hhslepicka hhslepicka self-assigned this Jan 14, 2019
@hhslepicka
Copy link
Contributor

I just saw that the fix was added into 1.6.3. https://github.com/slaclab/pydm/releases/tag/v1.6.3
I would any way recommend for you to use the latests since a couple of other bugs were fixed there.

@mdwyman
Copy link
Author

mdwyman commented Jan 14, 2019

I updated to the current version (1.6.5) using "conda update -c pydm-tag pydm" and the error went away as predicted. I still don't see an image though (no errors new or old in the terminal window during the scan).

An odd side effect of the update is that when I open up the UI in designer (via "Open in Designer" in the PyDM file menu) the PyDM plugins don't show up.

@hhslepicka
Copy link
Contributor

@mdwyman that is probably related to this issue in here: AnacondaRecipes/pyqt-feedstock#1
I think that during the update your qt/pyqt was updated to use the one from the main repo and not conda-forge.

The one provided by the default channel does not offer the pyqtplugin as described in the issue that I linked here. I am trying to ask for the folks at Continuum to fix the issue with the recipe but it is taking some time.

Do you mind to past here the output of your conda list | grep qt ?
Also, at the PyDM menu there is an option View > Show Connections.... Do you mind to also paste here the output of the screen?
Is your EPICS_CA_MAX_ARRAY_BYTES set correctly?

Do you mind to try this at the same terminal:

caget PelmeniNDSA:image1:ArrayData

Also, please try the following in a python or ipython session:

import epics
pv = epics.PV('PelmeniNDSA:image1:ArrayData')
print(len(pv.get())

I will try to start an IOC in here and test it as well.

@mdwyman
Copy link
Author

mdwyman commented Jan 15, 2019

(pydm-environment) [mwyman@kmp-linux2:~ ] $ conda list | grep qt
pyqt                      5.9.2            py36h05f1152_2  
pyqtgraph                 0.10.0                     py_5    conda-forge
qt                        5.9.7                h5867ecd_1  
qtpy                      1.6.0              pyh8a2030e_0    conda-forge

Here's the "Show connections" output:
ca://PelmeniNDSA:image1:ArraySize0_RBV
ca://PelmeniNDSA:scan1.EXSC
ca://PelmeniNDSA:scan1.SMSG
ca://PelmeniNDSA:scan1.CPT
ca://PelmeniNDSA:scan1.NPTS
ca://mdw:m1.TWV
ca://mdw:m1.TWF
ca://mdw:m1.DESC
ca://mdw:m1.VAL
ca://mdw:m1.DMOV
ca://mdw:m1.TWR
ca://mdw:m1.STOP
ca://mdw:m1.RBV
ca://PelmeniNDSA:image1:ArrayData

As for EPICS_CA_MAX_ARRAY_BYTES, I had set it 10000000 (the images are typically around 5M), but it appears that I had set it after starting pydm. Pydm would give the following error:
CAC: response with payload size=5505104 > EPICS_CA_MAX_ARRAY_BYTES ignored
so, I would then set EPICS_CA_MAX_ARRAY_BYTES to 10M and continue testing. However, while I was re-testing, I set the EPICS_CA_MAX_ARRAY_BYTES before starting pydm and was able to get images.

In summary, I believe my original issue is solved, but now I have the problem of the pydm tools not showing up in Designer. If I understand, I simply need to use the conda-forge version of pyqt and not the main repo version, correct?

Thanks for all the help.

@hhslepicka
Copy link
Contributor

Unfortunately that is correct. You will need the conda-forge version.
I will try to follow up again with the Issue that I have open there and in the worst case I will try to roll out a qt and pyqt at the PyDM channel later on.

@mdwyman mdwyman closed this as completed Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants