Simple SCPI control panel to send canned commands ? - Page 1
Forum section: electronics / general

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 06, 2024, 03:15:19 pm
content: I'd like to have a small windows application, with radio buttons, that can send canned SCPI sequences to one or more instruments. Previously I've done this in C# but no longer want to program.Ideally, the application can initiate a SCPI session, would have radio buttons that can pick up their labels, and the commands sent for each button, both coming from an ini file.What's the simplest way to get there? Is there a similar utility in existence?I've read several SCPI related posts and have seen simple SCPI in python, but want a graphic solution.

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 06, 2024, 05:20:21 pm
content: I have written a program to execute SCPI commands with simple scripts. Several instruments can be used and several scripts can be executed simultaneously. A script can also be used to create a window with buttons that are linked to scripts.The supported interfaces are LXI, RawTCP, Serial, HID and USBTMC. HID currently only supports the Brymen BM869s with adapter, and for USBTMC the Microsoft WinUSB driver must be installed for each instrument.Otherwise, the program does not require any installation or drivers from the manufacturers.The scripts are simple text files.The program and the help are unfortunately only available in German. I can also compile the program in English, but translating the help is too much work for me, I don't think anyone else uses the program.Here is a screenshot of the program. The link to the program is in my profile.Peter

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 06, 2024, 06:05:08 pm
content: What did you build that with? And I also just woke up to the fact that I need to establish the SCPI session. I'm running the Siglent remote control in two instances. One is the instrument interface which is suprisingly good. The other is the home, about, LAN, SCPI interface. Now I pick up multiple line SCPI commands from an open text window and paste into the "SCPI interface" function. Got a bit lazy with that.

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 06, 2024, 06:11:50 pm
content: Quote from: EE-digger on August 06, 2024, 06:05:08 pmI created the program with PureBasic. I programmed the protocols LXI, USBTMC etc. myself. I only use the libusb-0/1-DLL for the USB instruments.Peter

author: Mickle T.
author_rank: Frequent Contributor
timestamp: August 06, 2024, 07:56:24 pm
content: I used the English version of Messinstrumente v0.4.0.13 (Alpha) with script support to study the secret functions of the Picotest M3500A firmware, as well as to calibrate this multimeter. My impressions of Messinstrumente are only positive. Thank you!

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 07, 2024, 12:42:52 am
content: Quote from: Fenstergucker on August 06, 2024, 06:11:50 pmMy German is non existent except for some old telecom test terminology. Is that small window to the left all that you need to have visible? I'm assuming those are created commands because I see an IDN to start with.

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 07, 2024, 12:45:03 am
content: Quote from: Mickle T. on August 06, 2024, 07:56:24 pmThe only version I could find now is the latest and in German, although Peter (above) seems to have offered an English build if there is interest.

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 07, 2024, 04:15:30 am
content: Quote from: EE-digger on August 07, 2024, 12:42:52 amThe small window with the buttons was created with a script. Each button executes any script.The main window can be minimized, but always remains open. A script can be executed automatically at startup, e.g. the script for the window with the buttons.I will try to translate the program and help into English, but that will take some time.Peter

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 07, 2024, 01:47:07 pm
content: How about Google translate? It seems pretty good but then I've never been the recipient

author: tszaboo
author_rank: Super Contributor
timestamp: August 07, 2024, 02:09:35 pm
content: I've been toying with Node RED lately. It unfortunately doesn't have SCPI blocks, so I'm calling python from the Node red which is super janky but it seems to work nonetheless. I hope someone could write a node red plugin for SCPI at some point, and then this could be an actual reliable way of controlling instruments. I don't know Javascript enough to do it myself.

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 08, 2024, 11:48:41 am
content: Quote from: EE-digger on August 07, 2024, 01:47:07 pmI have updated the website, for German and English. I have adapted the project so that I can now compile all versions in German and English with one click.The export for the help is also prepared, only the translation is missing. I use DeepL and gut feeling, paragraph by paragraph.Peter

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 08, 2024, 06:05:35 pm
content: Thanks. Looking forward to trying it. The links don't work yet.

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 09, 2024, 08:51:48 am
content: Quote from: EE-digger on August 08, 2024, 06:05:35 pmI have translated the program and the help into English, and the download links now work.The link to the program is in my profile, or on the left under my user name.Peter

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 09, 2024, 05:48:08 pm
content: Thank you very muchI stumbled through a few functions and should be all set. It will take a few more hours to wrap my head around the syntax (on the Basic side).I found the script starter .txt and am very happyThanks again for your work !

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 09, 2024, 06:02:02 pm
content: Quote from: EE-digger on August 09, 2024, 05:48:08 pmI am happy to help if there are problems with the script language.Peter

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 09, 2024, 07:13:09 pm
content: Fuzzy from an afternoon nap but I can't see how the script starter picks up the .txt script file. Names don't seem to match.For instance, there is a "Screen copy" button but the script for that button doesn't appear to contain that same text. The script file name is "RTB2000 - Screen copy with save dialog.txt"What brings / links them together? Where does the button get its label from?I just know the answer is going to be simple

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 09, 2024, 07:24:38 pm
content: The file name of the script is in quotation marks and then the label of the button.Here is the line from the script "Script Launcher RTB2000 - Main script.txt":Code:Scripts add "RTB2000 - Screen copy with save dialog.txt" Screen copyVariable: ScriptsFunction: addScript path: "RTB2000 - Screen copy with save dialog.txt"Label: Screen copyPeter

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 09, 2024, 07:37:47 pm
content: Thanks.It's a great tool for tasks that are performed which are button pushing intensive. It can also be used to create a "QUICK" button when the instrument has none, as long as a SCPI command exists.

author: Fenstergucker
author_rank: Regular Contributor
timestamp: August 10, 2024, 02:52:29 pm
content: Quote from: EE-digger on August 09, 2024, 07:37:47 pmThis is one of my favorite scripts for the R&S RTB2000. It reads the logic data from the history segments and saves it as a file in VCD format. The VCD file can then be opened and analyzed with Sigrok PulseView, for example.PeterCode:// R&S RTB2000// Reads the logic channel data from the history segments.// The logic data is collected and saved as a file with consecutive data.// Use the connection from the 'constants.txt' file.#$rtb// Create constants.// File name for the combined logic data.#FileAllSegments set "T:\Data\/O Logic - All segments"// Create variables.integer HistoryStartinteger HistoryStopinteger HistoryCurrentwaveform LogicSegmentwaveform LogicAllSegments// Read in the number of segments.HistoryStart function scpi read :CHANnel:HISTory:STARt?HistoryStop function scpi read :CHANnel:HISTory:STOP?HistoryCurrent set HistoryStart// Jump label for the read-in loop.label HistoryLoop// Display the first or next segment.function scpi write :CHANnel:HISTory:CURRent $HistoryCurrent// Read in the visible logic channels from the memory.LogicSegment function waveform logic memory// Summarize the logic data.LogicAllSegments add LogicSegment// Increase the counter for the next segment.HistoryCurrent add 1// Check whether all segments have already been read in.HistoryCurrent greater HistoryStop// Continue with the next segment.false goto HistoryLoop// Save the combined logic data.LogicAllSegments function save #FileAllSegments vcd// Emit a signal tone for the end.function beep information

author: EE-digger
author_rank: Frequent Contributor
timestamp: August 12, 2024, 12:05:38 pm
content: Thanks and very happy to see that there is a "beep". Could not find one.A few of my buttons:Turn on markers every Ghz across spanTurn on custom set of markers for specific antennas (like a 5 band cell antenna)From preset, find an antenna dip, center it, scale it, adjust span, measure bandwidthMore to come

author: dobsonr741
author_rank: Frequent Contributor
timestamp: August 30, 2024, 02:44:44 pm
content: Can you do or learn Python? Then pyvisa and a Jupyter notebook can give you an environment you can experiment fast. I never regretted when I pushed myself to learn Jupyter, given how data science and AI spread.

author: SanderMTI
author_rank: Contributor
timestamp: September 04, 2024, 02:04:08 am
content: I use EZGPIB to talk to instruments.With instant compile-run, and built-in GPIB comms, it is the quickest way to get something working.You can make it read ini files and spit out stuff to meters on a keystroke.However, if you insist on mice and radiobuttons, you are going to have spend more time writing the code.SanderPSEZGPIB googles right up for download.

author: RoGeorge
author_rank: Super Contributor
timestamp: September 04, 2024, 06:17:02 am
content: Quote from: EE-digger on August 06, 2024, 03:15:19 pmThere are a few ways to add a GUI in Python, posted a few attempt here on EEVblog, see if any of these helps:Fromhttps://www.eevblog.com/forum/projects/exit/Fromhttps://www.eevblog.com/forum/testgear/python-scripts-to-control-instruments-using-lxi-scpi-no-drivers-required/As for a standalone and permanent SCPI panel, I would probably use a MIDI controller pad (for its physical buttons) + a Raspberry Pi or other SBC to read the controller and send the SCPI commands over LAN or USB.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 15, 2024, 06:51:43 pm
content: Maybe this is interesting for you:https://github.com/eez-open/modular-psuIt started with a kickstarter / crowdsupply for a programmable power supply but the project got a little bit out of hand and now has a collection of over 70 repositories on github. Among it is software to create a GUI for test & measurement systems.