Error: An error occurred when the parameters have been applied synchronously.

Discuss macros to control the hardware functions of your ZEISS microscope
Post Reply
Stefan Maurer
Posts: 5
Joined: Wed Apr 06, 2022 8:09 pm

Error: An error occurred when the parameters have been applied synchronously.

Post by Stefan Maurer »

I have a macro that repeatedly and quickly turns on and off an LED on my Observer 7 in a for loop. Unfortunately at random iterations of the loop I get the following error:

"The ZEN Service reported the following error: An error occurred when the parameters have been applied synchronously. This maybe caused, for example, by a timeout."

If I add a Zen Application Wait element of 1s in each iteration of the loop I do not seem to get this error. Is there a way to wait for verification that the previous hardware settings apply command has been successfully executed before attempting to apply the next one, or what could be the reason for this error?

Code: Select all

position = [...]
field = [...]
exposure = 100

hw = ZenHardwareSetting()

for i in range(0,100):
        
        Zen.Application.Wait(1000) # no error if this line is added
        
        hw.SetParameter('MTBRLFieldStop', 'Position', field[i])
        Zen.Devices.ApplyHardwareSetting(hw) # this is where the sync error occurs occasionally
        
        Zen.Devices.Stage.MoveTo(position[i])
        
        hw.SetParameter('MTBLED1', 'IsEnabled', 'true')
        Zen.Devices.ApplyHardwareSetting(hw)
        
        Zen.Application.Wait(exposure)
        
        hw.SetParameter('MTBLED1', 'IsEnabled', 'false')
        Zen.Devices.ApplyHardwareSetting(hw)
almir4ig almir4ig
Posts: 1
Joined: Tue Apr 11, 2023 7:22 am

Re: Error: An error occurred when the parameters have been applied synchronously.

Post by almir4ig almir4ig »

I tried but cant find the error! Vampire Survivors
Post Reply