Apply hardware setting

In this subforum specific Topics concerning ZEN Core, e.g workbenches, are discussed
Post Reply
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Apply hardware setting

Post by user-6033 »

Hi,

I have problems to set parameters in the Hardware setting. I have attempted different methods. The first problem is just to apply the active hardware setting. For example:

hw = Zen.Devices.ReadHardwareSetting()
Zen.Devices.ApplyHardwareSetting(hw)

This only results in an error message telling that an error occurred when the parameters have been applied synchronously. This maybe caused for example by a timeout.

I have also tried just to set one single parameter:
hw = ZenHardwareSetting()
hw.SetParameter('MTBRShutter', 'IsClosed', 'False')

However, it just says that Component 'MTBRShutter' does not exist. The same happen with other parameters. I saw that this might not work for Zen Blue 2.6 or earlier, we have Zen 2 Core 2.5 with the latest hotfix. I assume that this may be correct that this should not be possible.

What I do not really understand is that when I save an active hardwaresetting after I have reading it to "hw". The resulting file is quite short. Before Zen 2 Core v2.5 the file was much longer and I was also able to load it, and set parameters. Please find below an example of a plain readhardwaresetting:

<?xml version="1.0" encoding="utf-8"?>
<HardwareSetting Name="JustReadHardware.czhws">
<ParameterCollection Id="MTBCamera_MTBTube_Cameraport.Axiocam506c">
<TheoreticalTotalMagnification Status="Valid" IsActivated="true" IsReadOnly="true">50</TheoreticalTotalMagnification>
<TotalMagnification Status="Valid" IsActivated="true" IsReadOnly="true">50</TotalMagnification>
<DefaultScalingUnit Status="Valid" IsActivated="true" IsReadOnly="true">µm</DefaultScalingUnit>
<RoiCenterOffsetX Status="Valid" IsActivated="true" IsReadOnly="true">0</RoiCenterOffsetX>
<RoiCenterOffsetY Status="Valid" IsActivated="true" IsReadOnly="true">0</RoiCenterOffsetY>
<TotalAperture Status="Valid" IsActivated="true" IsReadOnly="true">0.8</TotalAperture>
</ParameterCollection>
</HardwareSetting>

If I use getparameters etc, there are many other active components and it feels that this is only a short subset.

Finally, is there a way to clear the Hardwaresetting collection? If I attempt to load the same hardwaresetting a second time after some changes then often there is a complaint that an item with that name already exist in the collection and the name has to be unique.

Best regards
Fredrik Olsson
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Hello Fredrik Olsson,

... it just says that Component 'MTBRShutter' does not exist ...

This is correct as MTBRShutter really does not exist.
There is a MTBRLShutter (ReflectedLight) or MTBTLShutter (TransmittedLight).

We have done some refactoring of the HardwareSetting and your subjects should all be covered.
All this will come with the next version of Zen Core.
Post Reply