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

Stage movement error #81

Closed
AdvancedImagingUTSW opened this issue Jun 7, 2022 · 4 comments
Closed

Stage movement error #81

AdvancedImagingUTSW opened this issue Jun 7, 2022 · 4 comments

Comments

@AdvancedImagingUTSW
Copy link
Collaborator

We are receiving this traceback after clicking the stage movement buttons a few times (any stage movement button will do). After we receive this callback, we can no longer move the stage. @annie-xd-wang, do you have any ideas as to what might cause this?

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\MicroscopyInnovation\.conda\envs\ASLM\lib\tkinter\__init__.py", line 1893, in __call__
    return self.func(*args)
  File "C:\Users\MicroscopyInnovation\.conda\envs\ASLM\lib\tkinter\__init__.py", line 815, in callit
    func(*args)
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\ASLM\src\controller\sub_controllers\stage_gui_controller.py", line 287, in <lambda>
    self.event_id[axis] = self.view.after(250, lambda: self.parent_controller.execute('stage', position_var.get(), axis))
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\ASLM\src\controller\aslm_controller.py", line 444, in execute
    self.move_stage(args=temp)
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\ASLM\src\controller\aslm_controller.py", line 626, in move_stage
    self.model.move_stage(args)
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\ASLM\src\model\concurrency\concurrency_tools.py", line 376, in attr
    return _get_response(self, True)
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\ASLM\src\model\concurrency\concurrency_tools.py", line 392, in _get_response
    resp, printed_output = object_in_subprocess._.parent_pipe.recv()
  File "C:\Users\MicroscopyInnovation\.conda\envs\ASLM\lib\multiprocessing\connection.py", line 259, in recv
    return _ForkingPickler.loads(buf.getbuffer())
TypeError: __init__() missing 1 required positional argument: 'value'
@annie-xd-wang
Copy link
Collaborator

I guess that the stage raises some errors, however, when unpickling the error message there is another error happened. I'm not quite sure, but I can help with debugging tomorrow.

@AdvancedImagingUTSW
Copy link
Collaborator Author

AdvancedImagingUTSW commented Jun 8, 2022

Working through the errors. MesoSPIM software throws it. Their proprietary software throws it. This is not our problem. Working with their engineers to try to solve it.

Traceback (most recent call last):
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\mesoSPIM-control\mesoSPIM\src\mesoSPIM_Stages.py", line 354, in report_position
    positions = self.pidevice.qPOS(self.pidevice.axes)
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\common\gcsbasecommands.py", line 643, in qPOS
    answer = self._msgs.read(cmdstr)
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\gcsmessages.py", line 171, in read
    self._checkerror()
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\gcsmessages.py", line 339, in _checkerror
    raise exc  # Raising NoneType while only classes or instances are allowed pylint: disable=E0702
pipython.pidevice.gcserror.GCSError: Unknown command (2)
Traceback (most recent call last):
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\mesoSPIM-control\mesoSPIM\src\mesoSPIM_Stages.py", line 354, in report_position
    positions = self.pidevice.qPOS(self.pidevice.axes)
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\common\gcsbasecommands.py", line 643, in qPOS
    answer = self._msgs.read(cmdstr)
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\gcsmessages.py", line 171, in read
    self._checkerror()
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\gcsmessages.py", line 339, in _checkerror
    raise exc  # Raising NoneType while only classes or instances are allowed pylint: disable=E0702
pipython.pidevice.gcserror.GCSError: Unknown command (2)
Traceback (most recent call last):
  File "C:\Users\MicroscopyInnovation\Documents\GitHub\mesoSPIM-control\mesoSPIM\src\mesoSPIM_Stages.py", line 354, in report_position
    positions = self.pidevice.qPOS(self.pidevice.axes)
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\common\gcsbasecommands.py", line 643, in qPOS
    answer = self._msgs.read(cmdstr)
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\gcsmessages.py", line 171, in read
    self._checkerror()
  File "C:\Users\MicroscopyInnovation\.conda\envs\py37\lib\site-packages\pipython\pidevice\gcsmessages.py", line 339, in _checkerror
    raise exc  # Raising NoneType while only classes or instances are allowed pylint: disable=E0702
pipython.pidevice.gcserror.GCSError: Unknown command (2)

@zacsimile
Copy link
Collaborator

There are instructions and example code for handling this type of error and resetting the error code on that stage axis here: https://pypi.org/project/PIPython/. We just have to catch a GCSError.

@AdvancedImagingUTSW
Copy link
Collaborator Author

Nice find!

from pipython import GCSDevice, GCSError, gcserror
with GCSDevice('C-884') as pidevice:
    try:
        pidevice.MOV('X', 1.23)
    except GCSError as exc:
        if exc == gcserror.E_1024_PI_MOTION_ERROR:
            print('There was a motion error, please check the mechanics.')
        else:
            raise

and

from pipython import GCSError, gcserror
raise GCSError(gcserror.E_1024_PI_MOTION_ERROR)
>>>GCSError: Motion error: position error too large, servo is switched off automatically (-1024)

codeCollision4 added a commit that referenced this issue Jun 9, 2022
zacsimile pushed a commit that referenced this issue Jun 9, 2022
zacsimile pushed a commit that referenced this issue Jun 15, 2022
* #81 Error handling now in place

* Wired up moving frames to zarr

Co-Authored-By: Dax Collison <[email protected]>

* Thread name printing with exception

Co-Authored-By: Dax Collison <[email protected]>

* Comment

Co-Authored-By: Dax Collison <[email protected]>

Co-authored-by: Dax Collison <[email protected]>
codeCollision4 added a commit that referenced this issue Jun 22, 2022
…ackaging (#113)

* #81 Error handling now in place

* Wired up moving frames to zarr

Co-Authored-By: Dax Collison <[email protected]>

* Thread name printing with exception

Co-Authored-By: Dax Collison <[email protected]>

* Comment

Co-Authored-By: Dax Collison <[email protected]>

* Moving along on zarr saving

Co-Authored-By: Dax Collison <[email protected]>

* Update aslm_image_writer.py

Co-Authored-By: Dax Collison <[email protected]>

* Boolean flags based on stack cycle mode

Co-Authored-By: Dax Collison <[email protected]>

* Zarr array is now updated with data

Still very early and is not ready to be pulled

Co-Authored-By: Dax Collison <[email protected]>

* Removing for loops to add image to zarr array

* Updating copy to zarr function

* Updating test for image writer

* Basic Setup.py

* Synthetic Hardware Test now compatible with structure

* Basic Setup.py

* Revert "Basic Setup.py"

This reverts commit 53385f4.

* Fixing path issues for model tests to run

* Created dummy model

I put the dummy model in the aslm package bc I was having import errors trying to import modules from the test folder.

* Updated paths to absolute

Can now run aslm --sh in command line after installing and will run program

* Adding zarr for github tests

* Update dummy model and apply to tests

* Removing init from test classes

* This will now pass

Aslm Analysis test needs to be addressed as its calling an entropy funciton that doesn't exist where it maybe is supposed to

Co-authored-by: AdvancedImagingUTSW <[email protected]>
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