Author Topic: Simple SCPI control panel to send canned commands ?  (Read 1454 times)

0 Members and 3 Guests are viewing this topic.

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Simple SCPI control panel to send canned commands ?
« on: August 06, 2024, 03:15:19 pm »
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.
« Last Edit: August 06, 2024, 03:17:47 pm by EE-digger »
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #1 on: August 06, 2024, 05:20:21 pm »
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
 
The following users thanked this post: Mickle T., Kean, pdenisowski

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #2 on: August 06, 2024, 06:05:08 pm »
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.
« Last Edit: August 06, 2024, 06:08:34 pm by EE-digger »
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #3 on: August 06, 2024, 06:11:50 pm »
What did you build that with?
I 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
 

Offline Mickle T.

  • Frequent Contributor
  • **
  • Posts: 478
  • Country: ru
Re: Simple SCPI control panel to send canned commands ?
« Reply #4 on: August 06, 2024, 07:56:24 pm »
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!
 
The following users thanked this post: Fenstergucker

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #5 on: August 07, 2024, 12:42:52 am »
What did you build that with?
I 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

My 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.
 

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #6 on: August 07, 2024, 12:45:03 am »
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!

The 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.
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #7 on: August 07, 2024, 04:15:30 am »
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.
The 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
« Last Edit: August 07, 2024, 04:18:14 am by Fenstergucker »
 

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #8 on: August 07, 2024, 01:47:07 pm »
How about Google translate?  It seems pretty good but then I've never been the recipient  :-DD :-DD
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7760
  • Country: nl
  • Current job: ATEX product design
Re: Simple SCPI control panel to send canned commands ?
« Reply #9 on: August 07, 2024, 02:09:35 pm »
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.
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #10 on: August 08, 2024, 11:48:41 am »
How about Google translate?  It seems pretty good but then I've never been the recipient  :-DD :-DD
I 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
 

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #11 on: August 08, 2024, 06:05:35 pm »
Thanks.  Looking forward to trying it.  The links don't work yet.
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #12 on: August 09, 2024, 08:51:48 am »
Thanks.  Looking forward to trying it.  The links don't work yet.
I 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
« Last Edit: August 09, 2024, 04:45:10 pm by Fenstergucker »
 
The following users thanked this post: Kean

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #13 on: August 09, 2024, 05:48:08 pm »
Thank you very much  :-+  I 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 happy  :scared:

Thanks again for your work !
« Last Edit: August 09, 2024, 05:49:53 pm by EE-digger »
 
The following users thanked this post: Fenstergucker

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #14 on: August 09, 2024, 06:02:02 pm »
It will take a few more hours to wrap my head around the syntax (on the Basic side).
I am happy to help if there are problems with the script language.

Peter
 

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #15 on: August 09, 2024, 07:13:09 pm »
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  :)
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #16 on: August 09, 2024, 07:24:38 pm »
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: [Select]
Scripts add "RTB2000 - Screen copy with save dialog.txt" Screen copy
Variable: Scripts
Function: add
Script path: "RTB2000 - Screen copy with save dialog.txt"
Label: Screen copy

Peter
« Last Edit: August 09, 2024, 07:26:12 pm by Fenstergucker »
 

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #17 on: August 09, 2024, 07:37:47 pm »
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.
 

Offline Fenstergucker

  • Contributor
  • Posts: 36
  • Country: at
    • Private Website
Re: Simple SCPI control panel to send canned commands ?
« Reply #18 on: August 10, 2024, 02:52:29 pm »
It's a great tool for tasks that are performed which are button pushing intensive.

This 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.

Peter

Code: [Select]
// 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 HistoryStart
integer HistoryStop
integer HistoryCurrent
waveform LogicSegment
waveform 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
 
The following users thanked this post: Kean, EE-digger

Offline EE-diggerTopic starter

  • Frequent Contributor
  • **
  • Posts: 380
  • Country: us
Re: Simple SCPI control panel to send canned commands ?
« Reply #19 on: August 12, 2024, 12:05:38 pm »
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 span
Turn 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 bandwidth

More to come  :)

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf