Skip to content

K10CR1 disconnect ? and conflict with Thorlabs spectrometer in discover_stage() #15

@LeoMonn

Description

@LeoMonn

Hello,

Thank you for your code. I'm currently using it to make a UI.
It appears there is an when using discover_stages() if the stages have already been "discovered", preventing me to use them. Also, when I import and find another Thorlabs instrument such as a spectrometer, a conflict appears again preventing to discover the stages.
My fix for now was to write:

try: 
    from thorpy.comm.discovery import discover_stages
    try: #Checking if the 2 stages have already been discovered 
        if len(stages)==2:
            print(stages)
        else:
            raise("error stages")
    except:
        stages = list(discover_stages())
        print(stages)
except:
    print('failed to import thorpy.comm.discovery or load the stages')
    pass

basically the idea was just to go around both problems, allowing my code to not work sometimes and forcing me to kill the current kernel and start a new one (using spyder 3).
For my first problem, I fell like a fix could be to disconnect the stages. Is this possible ? Is there another fix that could do the job properly ?
For the second problem, it seems like I can fix this by forcing to load the stages before the thorlabs spectrometer, which in my case is not very convenient. Is this a known issue ?

Thank you
Best regards,

Léo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions