Hello. Thank you always for your cooperation.
I use "ZEN 2.6 system" and create a macro.
I want to get the value adjusted by AutoExposure (exp), but it doesn't work.
What should I do?
I thank you in advance for your reply.
Code:
experiment1 = Zen.Acquisition.Experiments.GetByName(ExpFileName)
Zen.Acquisition.AutoExposure(experiment1)
experiment1.SaveAs(NewFileName) # NG
gain = Zen.Devices.HardwareSettings.ActiveHardwareSetting.GetParameter("MTBLSMDetectorLine1", "DetectorGain") # NG
Get the value of AutoExposure (exp)
Hello Yosuke,
sorry, but I have not the Zen-LSM setup on my computer that allows me to test your case but my first try would be to have a look at the collection that comes back from
Zen.Devices.HardwareSettings.ActiveHardwareSetting.GetAllParameterNames()
If this is not successful, then please have a look at the Experiment-File (after saving it), which is an XML-file.
Open it with an editor and search for HardwareSettings and then HardwareSetting. You will find a HardwareSetting for each track.
Now search for the master gain value you want to read.
To read the value via macro first save the experiment,
E.g.:
Experiment = Zen.Acquisition.Experiments.ActiveExperiment
Experiment.Save()
read it with an XML-Reader (.Net-Library or Python-Library) and finally get the value via the path etc. of the XMP-structure.
Please have a look at the documentation on the internet how to work with XML-Files in Python
I hope this helps ...
sorry, but I have not the Zen-LSM setup on my computer that allows me to test your case but my first try would be to have a look at the collection that comes back from
Zen.Devices.HardwareSettings.ActiveHardwareSetting.GetAllParameterNames()
If this is not successful, then please have a look at the Experiment-File (after saving it), which is an XML-file.
Open it with an editor and search for HardwareSettings and then HardwareSetting. You will find a HardwareSetting for each track.
Now search for the master gain value you want to read.
To read the value via macro first save the experiment,
E.g.:
Experiment = Zen.Acquisition.Experiments.ActiveExperiment
Experiment.Save()
read it with an XML-Reader (.Net-Library or Python-Library) and finally get the value via the path etc. of the XMP-structure.
Please have a look at the documentation on the internet how to work with XML-Files in Python
I hope this helps ...
Thank you very much.
I could get the value with the following code.
Experiment = Zen.Acquisition.Experiments.ActiveExperiment
Experiment.SaveAs (TmpExpFile)
When reading an XML file, using "xml.etree.ElementTree" results in the following error:
System.Xml.XmlException: The root level data is invalid.Line 1, position 1.
Is it a development environment problem?
By the way, “ConfigParser” works.
I could get the value with the following code.
Experiment = Zen.Acquisition.Experiments.ActiveExperiment
Experiment.SaveAs (TmpExpFile)
When reading an XML file, using "xml.etree.ElementTree" results in the following error:
System.Xml.XmlException: The root level data is invalid.Line 1, position 1.
Is it a development environment problem?
By the way, “ConfigParser” works.