Products > Test Equipment
Open source EEZ Studio for accessing your (SCPI) instruments
dpenev:
--- Quote ---The following code contain an error, for default frequency startFrequency should be used (that's the answer why default value didn't work):
--- Code: ---var defaultValues = {
starFrequency: 1000
};
--- End code ---
[/code]
--- End quote ---
Oh it is not only my lack of javascript experience. It seems I have to go and check my eyes ;)
--- Quote ---Don't know how you came up with this code:
--- Code: ---if (!values || (values.startFrequency !== values.startFrequency)) {
//session.deleteScriptLogEntry(); //Do I need this?
return;
}
--- End code ---
--- End quote ---
I came up to this myself as a way to check if any value is entered (it is not NaN) and if cancel is pressed.
It seems this is working for me.
--- Quote ---... but something like this is applicable:
--- Code: ---if (!values) {
// user clicked on Cancel button
return;
}
--- End code ---
--- End quote ---
This code doesn't check for empty box + Enter but with working defaults I think it is not an issue.
--- Quote ---The following lines are required, so the answer is, yes:
--- Code: ---connection.acquire(); //Do I need this?
connection.release(); //Do I need this?
--- End code ---
Please give us some time, and Martin will try to prepare for you a script skeleton that could be used for collecting data from your instrument.
--- End quote ---
Thank you very much!
dpenev:
--- Quote from: prasimix on March 01, 2019, 10:53:55 am ---Hi again, in add_chart_sample.js you can see how to create a graph from comma separated values that Siglent should generate with TRACe:DATA? command as you reported in #31.
--- Code: ---var defaultValues = {
startFrequency: 1234
};
var values = await input({
title: "Enter Start Frequency",
fields: [
{
name: "startFrequency",
unit: "frequency",
displayName: "Start frequency",
type: "number"
}
]
}, defaultValues);
connection.acquire();
await connection.command(`FREQuency:STARt ${values.startFrequency}`);
var data = await connection.query("TRACe:DATA? 1");
session.addChart({
description: "This is description",
data,
samplingRate: 1000, // 1000 samples per second
offset: 0,
scale: 1,
format: 4, // CSV string
unit: "frequency",
color: "rgb(255,250,205)", // line color on black backround
colorInverse: "rgb(51,51,0)", // line color on white background
label: "This is y-axis label"
});
connection.release();
--- End code ---
--- End quote ---
Thank you. I will try this as a second step after I finish my simple shortcut buttons.
dpenev:
Hello I have created a few shortcut buttons for SSA3032X.
Attached is the project file and the extension
I want to implement a drop down list selection.
Is this supported and if yes can you give an example?
prasimix:
--- Quote from: dpenev on March 04, 2019, 09:41:31 am ---I want to implement a drop down list selection.
Is this supported and if yes can you give an example?
--- End quote ---
Yes, check an example here: enter_start_frequency.js
dpenev:
OK I have prepared a pull request with some ssa shortcuts. More stuff on the way.
Sent from my MI NOTE Pro using Tapatalk
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version