Results 1 to 3 of 3

Thread: Load and apply a hardware setting

  1. #1
    CZ Administrators Carl Zeiss Microscopy 3's Avatar
    Join Date
    Jan 2013
    Posts
    396

    Load and apply a hardware setting

    Code:
    #######################################################
    ## M I C R O S C O P E 
    ##
    ## Macro name: Load and apply a hardware setting 
    ## Required files: MyShutterClose.czhws, MyShutteropen.czhws
    ## Required hardware: microscope with motorized reflector turret
    ##
    ## LOAD HARDWARE SETTING, APPLY HARDWARE SETTING, SNAP IMAGE
    ## 
    #######################################################
    ##
    ## Remove all open images
    Zen.Application.Documents.RemoveAll()
    ##
    ## Show live image 
    Zen.Acquisition.StartLive()
    ## Define hardware setting
    hwset = ZenHardwareSetting()
    ## Load hardware setting and close shutter 
    hwset.Load('MyShutterClose.czhws')
    ## Apply hardware setting
    Zen.Devices.ApplyHardwareSetting(hwset)
    ## Load hardware settingand open shutter 
    hwset.Load('MyShutterOpen.czhws')
    ## Apply hardware setting
    Zen.Devices.ApplyHardwareSetting(hwset)
    ## Calculate exposure time
    Zen.Acquisition.AutoExposure()
    ## Snap image
    Zen.Acquisition.AcquireImage(True)
    ## Close live image
    Zen.Acquisition.StopLive()
    ##
    #######################################################

  2. #2
    Junior Member
    Join Date
    Apr 2018
    Posts
    4

    Access to czhws file

    Do you have the czhws files that you used in this script? Can you provide them?
    Thank You

  3. #3
    CZ Administrators Carl Zeiss Microscopy 3's Avatar
    Join Date
    Jan 2013
    Posts
    396
    As a HardwareSetting is a very specific file that among other things depends on the microscope and its installed devices, it usually does not make sense to share it.

    There are two approaches to generate a HardwareSetting.

    First, you can save your current HardwareSetting by using Tools Settings Editor from the menu bar. In this Dialog you can modify the HardwareSetting and save it with a certain name.

    Second, you can edit the HardwareSetting file if you have a bit of experience with XML files. Besides of changing values (in a reasonable way!) you can delete parts of the HardwareSetting that you do not want to address. This way you can generate a HardwareSetting that only sets special devices. Please keep in mind that the XML-Structure as a whole must remain valid when deleting parts of it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •