Dear Dojo Community,
We were wondering if it is possible to edit a measurement point of a spectrum analyzer element via an automation script. To be more specific, in our use case, we would like to edit to be able to automate the editing of a frequency offset (as indicated in the screenshot below). And if so, we are highly interested in whether there is an example of how to implement this.
What would be even better, is to be able to add and immediately apply a measurement point on every spectrum analyzer element that is part of a certain view in the Surveyor.
Can someone help us with this, please?
Hi Joachim,
Some things that can get you started:
The Class Library does have a few spectrum-related methods through the IDMSElement.SpectrumAnalyzer interface. These methods communicate directly with the SLSpectrum module to create and update presets / scripts / monitors / measurement points.
More specifically the SetMeasurementPoints method is of interest.
Caveats:
- You'll probably need to save all measurement points at one (you can use the GetMeasurementPoints method to retrieve the current ones though)
- The definition is an array of string arrays which is not well documented. An example is below:
// when true, services will be created for the measurement points
bool createServices = false;// measptdata specified ALL measurement points for the element at once.
object[] measptdata = new object[] {
new string[] {
"1", // Measurement point ID (unique per meas pt)
"7", // dma id of parameter to set (in case multiple parameters need to be set, this is ";" separated)
"123", // element id(s) of parameter to set
"100", // parameter id(s) to set
"measurement point name",
"false", // for each parameter to set, "true" if it is of string type
"111", // value(s) to set in parameter
"0", // delay time after set
"99", // read pids associated with the write parameter ids specified above
"idx1", // table indices of the parameters to set
"", // freq offset
"", // needs invert freq
"", // automation script info (to be used instead of parameter sets)
"" // amplitude correction (RN3223)
},
new string[] {
"2", // Measurement point ID (unique per meas pt)
"7;7", // dma id of parameter to set (in case multiple parameters need to be set, this is ";" separated)
"123;123", // element id(s) of parameter to set
"100;100", // parameter id(s) to set
"measurement point 2",
"false;false", // for each parameter to set, "true" if it is of string type
"111;112", // value(s) to set in parameter
"0", // delay time after set
"99;99", // read pids associated with the write parameter ids specified above
"idx1;idx2", // table indices of the parameters to set
"", // freq offset
"", // needs invert freq
"", // automation script info (to be used instead of parameter sets)
"" // amplitude correction (RN3223)
},
new string[] {
"3", // Measurement point ID (unique per meas pt)
"", // dma id of parameter to set (in case multiple parameters need to be set, this is ";" separated)
"", // element id(s) of parameter to set
"", // parameter id(s) to set
"measurement point 3",
"", // for each parameter to set, "true" if it is of string type
"", // value(s) to set in parameter
"", // delay time after set
"", // read pids associated with the write parameter ids specified above
"", // table indices of the parameters to set
"", // freq offset
"", // needs invert freq
"MyScriptName;#;PROTOCOL:1:7:59", // automation script info (to be used instead of parameter sets)
"" // amplitude correction (RN3223)
},
};
Hi, I can now confirm it’s working. I am also trying to document my findings to help improve the documentation. I marked your answer as best. ✅
Thanks, Wouter for the input. It definitely helps me to get started. I will now experiment myself and come back to this later.