Author Topic: GPIB scripting?  (Read 2572 times)

0 Members and 6 Guests are viewing this topic.

Offline bitovodTopic starter

  • Contributor
  • Posts: 16
  • Country: cz
GPIB scripting?
« on: March 18, 2026, 09:02:57 am »
Hello,

is there any replacement for the combination of QuickBASIC (or HP BASIC) and an ISA GPIB card for scripting/programming over GPIB?

There are many examples of controls in the device manuals, but I currently don't know how to try or use them.

Yes, I've heard of EZGPIB, but I've never been able to get it to work satisfactorily with the AR488 - that's probably the only reasonable replacement I know of, but unfortunately there's no further development or customization to be expected there.

Do you know of any other solution?

Thanks.
« Last Edit: March 18, 2026, 09:05:27 am by bitovod »
 

Offline pdenisowski

  • Super Contributor
  • ***
  • Posts: 1309
  • Country: us
  • Product Management Engineer, Rohde & Schwarz
    • Test and Measurement Fundamentals Playlist on the R&S YouTube channel
Re: GPIB scripting?
« Reply #1 on: March 18, 2026, 09:40:53 am »

Most GPIB programming I see these days is all using SCPI with VISA (and your choice of programming language - usually Python).  What device are you trying to control?
Test and Measurement Fundamentals video series on the Rohde & Schwarz YouTube channel:  https://www.youtube.com/playlist?list=PLKxVoO5jUTlvsVtDcqrVn0ybqBVlLj2z8
 
The following users thanked this post: abeyer

Online IanJ

  • Supporter
  • ****
  • Posts: 2213
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Re: GPIB scripting?
« Reply #2 on: March 18, 2026, 09:51:48 am »
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Odysee: https://odysee.com/@IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1553
  • Country: gb
Re: GPIB scripting?
« Reply #3 on: March 18, 2026, 09:56:09 am »

Yes, I've heard of EZGPIB, but I've never been able to get it to work satisfactorily with the AR488 - that's probably the only reasonable replacement I know of, but unfortunately there's no further development or customization to be expected there.

There is a problem in that EZGPIB expects to find a modem control line - DSR, I think - to indicate that the adapter is ready. AR488 normally uses CDC serial emulation which doesn't have this. It might conceivably work with an old arduino having an FTDI serial chip.
 
 

Offline bitovodTopic starter

  • Contributor
  • Posts: 16
  • Country: cz
Re: GPIB scripting?
« Reply #4 on: March 18, 2026, 04:28:59 pm »
My problem is general, I can communicate with Keithley 199 or 2000 from the terminal without any problems.

Now it occurred to me that I can use any language for scripting that can communicate via a serial channel - so both Python (which I haven't learned) and even "ugly" modern BASIC - I think QB64. The only difference will probably be when opening the channel.

The disadvantage, of course, will be the limited transfer speed compared to a full-fledged GPIB converter, but that is a general feature of the AR488.

That should work, I'll try it tonight.
« Last Edit: March 18, 2026, 05:01:26 pm by bitovod »
 

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2653
  • Country: us
    • KE5FX.COM
Re: GPIB scripting?
« Reply #5 on: March 18, 2026, 05:07:08 pm »
Suggestion: get comfortable with writing plain-language specs for LLMs to follow, rather than programs or scripts for ephemeral languages.  What we used to call 'programming' is now a robot's job, especially when it comes to small standalone applications like this.

Disregard those who tell you this is bad advice; they're badly mistaken.

 

Offline PascalNE

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: gb
    • Personal Website
Re: GPIB scripting?
« Reply #6 on: March 18, 2026, 07:46:32 pm »
Suggestion: get comfortable with writing plain-language specs for LLMs to follow, rather than programs or scripts for ephemeral languages.  What we used to call 'programming' is now a robot's job, especially when it comes to small standalone applications like this.

Disregard those who tell you this is bad advice; they're badly mistaken.


I'm sorry but that is terrible advice, LLMs will not have knowledge of communication with the AR488, nor will they know about communicating with the Keithley 199 or 2000 (which will be the bulk of the program since the rest is just serial communication) You should be able to use any language you are comfortable with, as it really is just simple serial commands the rest is just giving the instrument the right commands, which in the case of the 2000 is their implementation of SCPI. For the 199 it's a little more complex but it is all in the manual.
« Last Edit: March 18, 2026, 07:49:31 pm by PascalNE »
Move slow and break things
 
The following users thanked this post: mikerj

Offline artag

  • Super Contributor
  • ***
  • Posts: 1553
  • Country: gb
Re: GPIB scripting?
« Reply #7 on: March 18, 2026, 08:36:45 pm »
Well, that sounds like a challenge
Place your bets, ladies and gentlemen :).
 

Offline PascalNE

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: gb
    • Personal Website
Re: GPIB scripting?
« Reply #8 on: March 18, 2026, 09:27:53 pm »
Sorry to OP for the diversion.
But having tried it I can confirm it was wrong on all counts. It completely ignored the AR488 and tried to use NI488.2 (incorrectly) . All of the commands it sent were wrong mostly being SCPIish commands (the 199 does not use SCPI) but also some just made up ones. Someone familiar with LLMs should know they do not have the knowledge to work with niche projects like the AR488 and it definitely doesn't have intricate knowledge of multimeters from 1987.   :--
 
Code: [Select]
using System;
using NationalInstruments.NI4882; // Ensure you have NI4882 or a suitable GPIB library installed

class Program
{
    static void Main(string[] args)
    {
        // Initialize the GPIB session
        const int deviceAddress = 2; // Adjust to your device's GPIB address
        const string gpibInterface = "GPIB0"; // Change if necessary
        Device keithley199;
       
        try
        {
            // Create a GPIB session
            GpibSession session = new GpibSession(gpibInterface);
            keithley199 = new Device(session, deviceAddress);
           
            // Configure the Keithley 199
            ConfigureKeithley(keithley199);
           
            // Take a measurement
            double measurement = TakeVoltageMeasurement(keithley199);
           
            // Output the measurement
            Console.WriteLine($"Voltage Measurement: {measurement} V");
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
        finally
        {
            // Cleanup
            if (keithley199 != null)
            {
                keithley199.Close();
            }
        }
    }
   
    static void ConfigureKeithley(Device keithley)
    {
        // Set the Keithley to voltage measurement mode
        keithley.Write("*RST"); // Reset the device
        keithley.Write("FUNC 'VOLT'"); // Set function to voltage
        keithley.Write("VOLT:RANG AUTO"); // Set voltage range to auto
        keithley.Write("VOLT:DC:NPLCycles 10"); // Set filter setting (optional)
    }

    static double TakeVoltageMeasurement(Device keithley)
    {
        // Initiate measurement and read value
        keithley.Write("INIT"); // Start the measurement
        System.Threading.Thread.Sleep(1000); // Wait for measurement to complete (adjust as necessary)
       
        // Read the measured voltage
        string result = keithley.Read("FETCh?");
        return double.Parse(result);
    }
}
Move slow and break things
 

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2653
  • Country: us
    • KE5FX.COM
Re: GPIB scripting?
« Reply #9 on: March 18, 2026, 11:22:27 pm »
If your model doesn't know about multimeters from 1987, and can't look up what it needs to know on the web, then you're using the wrong model.  Use a better model.

But yeah, AR488 and other weird homebrew GPIB adapters will be largely out of distribution.  The right strategy is probably to have it write the code for an NI488.2 or perhaps Prologix interface, then revise it manually to use the AR488.  Alternatively, ensure that the model has access to the AR488's documentation (which, again, it really should be able to find by default, assuming it can do web searches.)
 

Offline PascalNE

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: gb
    • Personal Website
Re: GPIB scripting?
« Reply #10 on: March 19, 2026, 12:01:51 am »
If your model doesn't know about multimeters from 1987, and can't look up what it needs to know on the web, then you're using the wrong model.  Use a better model.

But yeah, AR488 and other weird homebrew GPIB adapters will be largely out of distribution.  The right strategy is probably to have it write the code for an NI488.2 or perhaps Prologix interface, then revise it manually to use the AR488.  Alternatively, ensure that the model has access to the AR488's documentation (which, again, it really should be able to find by default, assuming it can do web searches.)
I disagree with most of what you have said there, but see no point in arguing about LLMs on this post.

I would just say to OP if you want to actually understand the code you are writing, don't use LLMs.(they will not be capable anyway) You can use any language you like as long as you know how to interact with a serial port, and from there on it's just about working out which commands to send. Which are on the 2000 and 199s datasheets.  If you want an example I'm sure someone would be able to provide one.  :-+
Move slow and break things
 

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2653
  • Country: us
    • KE5FX.COM
Re: GPIB scripting?
« Reply #11 on: March 19, 2026, 12:40:42 am »
I would just say to OP if you want to actually understand the code you are writing, don't use LLMs.(they will not be capable anyway)

Reading things like that, at this point, is like watching two trucks speeding towards each other on the highway, one with a drunk driver behind the wheel.  Some poor schlub who has no idea what's going on is about to find out the hard way, and there's nothing you can do. 

You flash your headlights, you wave your hand frantically through your open window, you lean on the horn... but they don't look up.
 

Offline Tony_G

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB scripting?
« Reply #12 on: March 19, 2026, 01:04:45 am »
Suggestion: get comfortable with writing plain-language specs for LLMs to follow, rather than programs or scripts for ephemeral languages.  What we used to call 'programming' is now a robot's job, especially when it comes to small standalone applications like this.

Disregard those who tell you this is bad advice; they're badly mistaken.

Just to follow up on this comment, I thought I'd give the LLM-driven programming idea a go. Even though I could write it myself, I wanted to see what someone could do without manual intervention, just asking the LLM to do something.

This is the work in progress for a Rigol DP832A control app - Windows (WPF-based),  Command Line (Spectre.CLI), and unit tests - I fed GitHub Copilot the PDF files of the DP832A and the Programming Guide, and then just asked Copilot to write the app. I started from "please create a project to control a DP832".

While it won't win any UX design awards, it does work, and it did a surprisingly good job.

Here is the code if you're interested - https://github.com/TGoodhew/DP832

TonyG

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2653
  • Country: us
    • KE5FX.COM
Re: GPIB scripting?
« Reply #13 on: March 19, 2026, 01:09:03 am »
What model does Copilot use these days?  Is it tied to GPT 5.4?  I've never tried it, not being an IDE guy.  Looks like Codex CLI defaults to 5.4, but again not much experience with it compared to Opus 4.6 in Claude Code.

Edit #1: the GUI looks very nice!  Being completely .NET-illiterate, I had to use Codex to build it, and watching the process made me very glad I didn't try to bulldoze my way through it manually.

Edit #2:  It now supports the AR488, at least in theory (I don't have one, or a DP832 for that matter.)  8)



Took about 10 minutes of crunching in Codex.  I literally know nothing of the underlying language or toolchain -- and I don't need to.  If it doesn't work, I'll tell it what's wrong, so it can fix it. 

This was the prompt I used:

  This directory contains an application that controls a
  DP832 power supply via TCP/IP or the NI488.2 GPIB
  API.  Please modify it to support the AR488 GPIB
  interface as well.  Documentation for the AR488 can be
  found at https://sigrok.org/wiki/AR488.  You will want
  to add 'AR488' to the list of Connection radio
  buttons that currently includes GPIB and TCPIP.
  Serial port setting controls will then need to appear in
  the connection control area, in the case where the user
  selects AR488.  Any questions, ASK.


This is what programming looks like now. 
« Last Edit: March 19, 2026, 02:11:41 am by KE5FX »
 

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 952
  • Country: se
Re: GPIB scripting?
« Reply #14 on: March 19, 2026, 06:04:26 am »
I get that the point was to show the capabilities of LLM's but the DP832 doesn't have a GPIB interface to begin with.

Yes, there's an option to buy Rigols "backwards" USB/GPIB-converter that connects to the DP832 USB-host port and interfaces existing GPIB infrastruture (if you hade it) but then connecting THAT to an AR488 to go back to USB/serial makes no practical sense.
 
The following users thanked this post: guenthert, PascalNE

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2653
  • Country: us
    • KE5FX.COM
Re: GPIB scripting?
« Reply #15 on: March 19, 2026, 06:14:48 am »
I get that the point was to show the capabilities of LLM's but the DP832 doesn't have a GPIB interface to begin with.

Yes, there's an option to buy Rigols "backwards" USB/GPIB-converter that connects to the DP832 USB-host port and interfaces existing GPIB infrastruture (if you hade it) but then connecting THAT to an AR488 to go back to USB/serial makes no practical sense.

True, if it were a little smarter, it would push back and tell me to just use a direct connection. I would expect that to take another generation or two, but it'll happen, I'm sure.

Just for fun, I asked Codex to add SCSI support, but to its credit it didn't fall for it.

Quote
>Can you also add SCSI support?
-----------------------------------------
Do you mean SCPI or SCSI?

This app already uses SCPI commands over the transport layer. If you meant SCSI, that is a different interface/protocol entirely and would need a separate device access path.
 

Offline PascalNE

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: gb
    • Personal Website
Re: GPIB scripting?
« Reply #16 on: March 19, 2026, 09:03:02 am »
True, if it were a little smarter, it would push back and tell me to just use a direct connection. I would expect that to take another generation or two, but it'll happen, I'm sure.

Proving my exact point  :palm: I am completely aware it's capable of general purpose coding, but even if you give it a manual it is not capable of getting all the neccesary contect(like seeing if the device actually has a GPIB port) I have naively tried this exact thing and only ended up in a world of errors and having to go back and learn it anyway. I'm also aware it will get better, but that isn't right now is it.
Move slow and break things
 

Online IanJ

  • Supporter
  • ****
  • Posts: 2213
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Re: GPIB scripting?
« Reply #17 on: March 19, 2026, 02:14:39 pm »
The use of AI in coding……if you think you can give it a brief outline and expect good results then you are in for a world of pain. However, if you keep on top of it, lots of direction, do’s and do not’s with each post then it’s well capable of giving you great code.
Trust me…..:)

Ian
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Odysee: https://odysee.com/@IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 

Offline Tony_G

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB scripting?
« Reply #18 on: March 19, 2026, 03:43:39 pm »
I get that the point was to show the capabilities of LLM's but the DP832 doesn't have a GPIB interface to begin with.

Yes, there's an option to buy Rigols "backwards" USB/GPIB-converter that connects to the DP832 USB-host port and interfaces existing GPIB infrastruture (if you hade it) but then connecting THAT to an AR488 to go back to USB/serial makes no practical sense.

I wasn't specifically commenting on GPIB(HPIB, 488.2, etc) but instead on writing instrument control code with an LLM, my apologies I should have been clearer.

That said, the way the code is talking to the DP832 is via the National Instruments VISA library over TCPIP. This VISA library is also how you can talk to instruments with a GPIB interface. I have an NI GPIB-ENET/1000 that connects all my old HP instruments via GPIB cables and 32704A extenders and I use VISA to talk to all of them.

The key point though is that LLMs are no longer a mismatch for agentic building of scoped solutions.

Just my opinion based on this work.

TonyG
« Last Edit: March 19, 2026, 03:48:45 pm by Tony_G »
 

Offline Tony_G

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB scripting?
« Reply #19 on: March 19, 2026, 03:46:42 pm »
What model does Copilot use these days?  Is it tied to GPT 5.4?  I've never tried it, not being an IDE guy.  Looks like Codex CLI defaults to 5.4, but again not much experience with it compared to Opus 4.6 in Claude Code.

I used Claude Sonnet 4.6 (it was Sonnet, I think the version was 4.6). It didn't do a bad job but as IanJ mentioned you do have to keep the prompts focused, test at each step and iterate as needed.

In my test though, I didn't do a code review deliberately (I just accepted it when prompted for the review) to see what happens, I did do actual testing of the device under control.

Working on a different project (my WWVB emulator), I had to switch to Claude Code as GitHub Copilot/Sonnet introduced a bug that I couldn't find that stopped the emulator working. I had to rollback to my last manual coding checkin and then use Claude Code to recreate the things I wanted Copilot to do. So there is still a lot of competition for best tooling.

TonyG
« Last Edit: March 19, 2026, 03:50:44 pm by Tony_G »
 

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2653
  • Country: us
    • KE5FX.COM
Re: GPIB scripting?
« Reply #20 on: March 19, 2026, 05:32:49 pm »
Proving my exact point  :palm: I am completely aware it's capable of general purpose coding, but even if you give it a manual it is not capable of getting all the neccesary contect(like seeing if the device actually has a GPIB port) I have naively tried this exact thing and only ended up in a world of errors and having to go back and learn it anyway. I'm also aware it will get better, but that isn't right now is it.

Yes, it pretty much is right now.  But it's like the Sorcerer's Apprentice sketch in 'Fantasia.'  You are still programming and you can't let yourself forget that.  It will do what you tell it (eventually) and it will do a good job (eventually), but supervision and validation is still your responsibility.

The model doesn't know or care if there is a 'real' GPIB port on the power supply, or if it has to be added externally as an option.  It is not fair to expect it to.  From my reading of the manual (and Tony may correct me here), if you add the option, it does have a perfectly legitimate GPIB port.  It may not be a good way to get the job done, but that's your call, not HAL's.  Not yet. 

Getting back to the OP's problem of controlling an older DMM, that is actually an easier problem, since unlike the power supply, the DMM won't fry anything if misprogrammed.  I don't have one of those here, or (again) one of the AR488 adapters, but I have no doubt that if I were to, say, tell Claude or Codex to write a program to control an HP 3478A from the same era, using (say) a Prologix adapter which is very similar to the AR488, that it would only take a few minutes to get it working.

I also have no doubt that if I just went to the freebie chatgpt.com page and told it, "Write a program to control <whatever> with an AR488", the result would be comparable to what you got when you (apparently) did the same thing.  Again, it reads like English, and it is English, but it's still a program, and has to be treated as such. 

Even the Claude/Codex version probably won't work the first time, but guess what: that would also be true if you or I had written it.  I agree that the free ChatGPT output may not be worth bothering with, or arguing about.

So there is still a lot of competition for best tooling.

Opus 4.6 is a step change over Sonnet.  I don't have enough experience using Codex/Copilot for programming to say how it compares to Opus 4.6, except to say that I was impressed with how 5.4 Medium handled the modification to your code above, but I do have enough experience with Opus 4.6 to be favorably impressed with it. 
 
The following users thanked this post: Tony_G

Offline Sparks-Components

  • Newbie
  • Posts: 8
  • Country: tw
Re: GPIB scripting?
« Reply #21 on: March 20, 2026, 09:12:36 am »
I’m currently running a setup with a TR6143, HP3457A, and Keithley 2182 using the open-source MeterCare GPIB. These old units are "moody"—if you let an LLM guess, it will hallucinate modern SCPI commands for 80s gear every time.

My workflow to avoid the "world of pain":

Manual Verification: I test every command (DDC/SCPI) through a terminal first. Check for termination chars (\n, \r, EOI) and timing issues.

The "Grammar" Layer: Wrap those verified commands into a "VISA-lite" Python class or a JSON dictionary.

AI for the Grunt Work: Then I feed that "Source of Truth" to the AI (Roo Code / VS Code) to build the GUI or logging logic.

Bottom line: Use the AI to handle the UI and boilerplate, but you must provide the "Grammar" yourself. Test first, scale second.
 
The following users thanked this post: PascalNE

Offline Tony_G

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB scripting?
« Reply #22 on: March 20, 2026, 08:18:21 pm »
I wanted to step back and try this again.

My environment is Visual Studio Code with the Claude Code extension installed.

As I was the original PdM on C#, I'm going with that and the .NET Framework 4.7.2. This means I will be using the NI 488.2 and VISA libraries.

The repo is located here if you want to look at it:

https://github.com/TGoodhew/HP8273BLLMTest

I asked Claude Code to create a console app that would talk to my 8673B. This is NOT a SCPI instrument so I provided Claude the PDF of how to talk to it. Here is the full exchange I had to create a console utility that can set frequency and power (these are just my prompts, not what Claude responded with):

Code: [Select]
Can you create a C# command line project that uses the .NET Framework 4.7.2? Please do it in this folder and call it HP8273BLLMTest

Please add the National Instruments 488.2 and VISA assemblies to this project

Great - Please add a HelloWorld output and tell me how to build and run the app from inside VS Code

Please copy the PDF located here "C:\Users\Tony\OneDrive\Documents\Manuals\8673B User.pdf" into the project

Please add Spectre.Console.Cli to the project. You can read about it here https://spectreconsole.net/cli

Ok. Please remvoe the "Hello World" output and create two command line options. The first is to set the frequency. The second is to set the power. The GPIB address of the 8673B is 19. Review the PDF file and use the National Instruments VISA library to talk to the 8673B.

I built the project but got this error:
  *  Executing task: cmd /c 'C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\MSBuild.exe' HP8273BLLMTest\HP8273BLLMTest.csproj /p:Configuration=Debug /p:Platform=AnyCPU

MSBuild version 18.4.0+6e61e96ac for .NET Framework
Build started 3/20/2026 12:54:18 PM.

Project "C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj" on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
  C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /fullpaths /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\IVI Foundation\VIS
  A\Microsoft.NET\Framework32\v4.0.30319\VISA.NET Shared Components 8.0.2\Ivi.Visa.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFra
  mework\v4.7.2\mscorlib.dll" /reference:"C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.NI4882.dll" /reference:"C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v4.0.30319\NI VISA.NET 26.0\NationalInstr
  uments.Visa.dll" /reference:C:\Users\Tony\.nuget\packages\spectre.console.cli\0.53.1\lib\netstandard2.0\Spectre.Console.Cli.dll /reference:C:\Users\Tony\.nuget\packages\spectre.console\0.53.1\lib\netstandard2.0\Spectre.Console.dll /reference:C:\Users\Tony\.nuget\packages\system.buffers\4
  .6.1\lib\net462\System.Buffers.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.DataSetExtensions.dll" /refere
  nce:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll" /reference:C:\Users\Tony\.nuget\packages\system.memory\4.6.3\lib\net462\
  System.Memory.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Numerics.dll" /reference:C:\Users\Tony\.nuget\pa
  ckages\system.numerics.vectors\4.6.1\lib\net462\System.Numerics.Vectors.dll /reference:C:\Users\Tony\.nuget\packages\system.runtime.compilerservices.unsafe\6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framew
  ork\.NETFramework\v4.7.2\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.Linq.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\netstandard.dll" /debug+
   /debug:full /filealign:512 /optimize- /out:obj\Debug\HP8273BLLMTest.exe /subsystemversion:6.00 /target:exe /utf8output /deterministic+ /langversion:7.3 Commands\FrequencyCommand.cs Commands\PowerCommand.cs Instruments\HP8673B.cs Program.cs Properties\AssemblyInfo.cs "obj\Debug\.NETFrame
  work,Version=v4.7.2.AssemblyAttributes.cs"
  Compilation request HP8273BLLMTest, PathToTool=C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe
  CommandLine = ' /noconfig'
  BuildResponseFile = '/nowarn:1701,1702 /fullpaths /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v4.0.30319\VISA.NET Shared Components 8.0.2\Ivi.Vis
  a.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dll" /reference:"C:\Program Files (x86)\National Instrum
  ents\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.NI4882.dll" /reference:"C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v4.0.30319\NI VISA.NET 26.0\NationalInstruments.Visa.dll" /reference:C:\Users\Tony\.nuget\packages\spectre.console.cli\0
  .53.1\lib\netstandard2.0\Spectre.Console.Cli.dll /reference:C:\Users\Tony\.nuget\packages\spectre.console\0.53.1\lib\netstandard2.0\Spectre.Console.dll /reference:C:\Users\Tony\.nuget\packages\system.buffers\4.6.1\lib\net462\System.Buffers.dll /reference:"C:\Program Files (x86)\Reference
   Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramew
  ork\v4.7.2\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll" /reference:C:\Users\Tony\.nuget\packages\system.memory\4.6.3\lib\net462\System.Memory.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Micro
  soft\Framework\.NETFramework\v4.7.2\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Numerics.dll" /reference:C:\Users\Tony\.nuget\packages\system.numerics.vectors\4.6.1\lib\net462\System.Numerics.Vectors.dll /re
  ference:C:\Users\Tony\.nuget\packages\system.runtime.compilerservices.unsafe\6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.dll" /reference:"C:\Program Files (x86)\Ref
  erence Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.Linq.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\netstandard.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\HP8273BLLMTest.exe /subsy
  stemversion:6.00 /target:exe /utf8output /deterministic+ /langversion:7.3 Commands\FrequencyCommand.cs Commands\PowerCommand.cs Instruments\HP8673B.cs Program.cs Properties\AssemblyInfo.cs "obj\Debug\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"'
  Attempting to create process 'C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\Roslyn\VBCSCompiler.exe' "-pipename:sKDdMrdzGu9E4kpXABqaTwSAdKXFM3pYmc3iY17skOo"
  Successfully created process with process id 33236
  Attempt to open named pipe 'sKDdMrdzGu9E4kpXABqaTwSAdKXFM3pYmc3iY17skOo'
  Attempt to connect named pipe 'sKDdMrdzGu9E4kpXABqaTwSAdKXFM3pYmc3iY17skOo'
  Named pipe 'sKDdMrdzGu9E4kpXABqaTwSAdKXFM3pYmc3iY17skOo' connected
  Begin writing request for HP8273BLLMTest
  End writing request for HP8273BLLMTest
  Begin reading response for HP8273BLLMTest
  End reading response for HP8273BLLMTest
C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\FrequencyCommand.cs(22,29): error CS0115: 'FrequencyCommand.Execute(CommandContext, FrequencyCommand.Settings)': no suitable method found to override [C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj]
C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\FrequencyCommand.cs(8,25): error CS0534: 'FrequencyCommand' does not implement inherited abstract member 'Command<FrequencyCommand.Settings>.Execute(CommandContext, FrequencyCommand.Settings, CancellationToken)' [C:\Users\Tony\source\Test\H
P8273BLLMTest\HP8273BLLMTest.csproj]
C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\PowerCommand.cs(22,29): error CS0115: 'PowerCommand.Execute(CommandContext, PowerCommand.Settings)': no suitable method found to override [C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj]
C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\PowerCommand.cs(8,25): error CS0534: 'PowerCommand' does not implement inherited abstract member 'Command<PowerCommand.Settings>.Execute(CommandContext, PowerCommand.Settings, CancellationToken)' [C:\Users\Tony\source\Test\HP8273BLLMTest\HP
8273BLLMTest.csproj]
  CompilerServer: server - server processed compilation - HP8273BLLMTest
Done Building Project "C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj" (default targets) -- FAILED.


Build FAILED.

"C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj" (default target) (1) ->
(CoreCompile target) ->
  C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\FrequencyCommand.cs(22,29): error CS0115: 'FrequencyCommand.Execute(CommandContext, FrequencyCommand.Settings)': no suitable method found to override [C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj]
  C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\FrequencyCommand.cs(8,25): error CS0534: 'FrequencyCommand' does not implement inherited abstract member 'Command<FrequencyCommand.Settings>.Execute(CommandContext, FrequencyCommand.Settings, CancellationToken)' [C:\Users\Tony\source\Test
\HP8273BLLMTest\HP8273BLLMTest.csproj]
  C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\PowerCommand.cs(22,29): error CS0115: 'PowerCommand.Execute(CommandContext, PowerCommand.Settings)': no suitable method found to override [C:\Users\Tony\source\Test\HP8273BLLMTest\HP8273BLLMTest.csproj]
  C:\Users\Tony\source\Test\HP8273BLLMTest\Commands\PowerCommand.cs(8,25): error CS0534: 'PowerCommand' does not implement inherited abstract member 'Command<PowerCommand.Settings>.Execute(CommandContext, PowerCommand.Settings, CancellationToken)' [C:\Users\Tony\source\Test\HP8273BLLMTest\
HP8273BLLMTest.csproj]

    0 Warning(s)
    4 Error(s)

Time Elapsed 00:00:00.92

 *  The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command cmd /c 'C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\MSBuild.exe' HP8273BLLMTest\HP8273BLLMTest.csproj /p:Configuration=Debug /p:Platform=AnyCPU" terminated with exit code: 1

Can you push this to my GitHub account and create a public repository for the code?

Yes, make it public and just use the HP8273BLLMTest as the repo name

Bugger - I just installed the GitHub CLI stuff - Can you do it now?

Ok - I just authenticated - Can you do it now?

Thank you - Please create a README.md file that explains what a 8673B is and what commands this application provides. Additionally provide links and commentary on the NI VISA and 488.2 files so that people can find what they are.

I can confirm that the app did in fact set the frequency and power of the 8673B - I'm pretty impressed about the ability of the models to build device control apps when provided with the documentation. It is surprisingly good.

You still need to test and confirm, and as I discovered, when bugs get introduced, they can be hard to find, but still, for someone who is just getting into this type of stuff they are really quite good.

TonyG
« Last Edit: March 20, 2026, 10:24:21 pm by Tony_G »
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1553
  • Country: gb
Re: GPIB scripting?
« Reply #23 on: March 21, 2026, 08:10:23 am »

But yeah, AR488 and other weird homebrew GPIB adapters will be largely out of distribution.  The right strategy is probably to have it write the code for an NI488.2 or perhaps Prologix interface, then revise it manually to use the AR488.  Alternatively, ensure that the model has access to the AR488's documentation (which, again, it really should be able to find by default, assuming it can do web searches.)

But AR488 pretty much is the prologix interface. I'm not sure how far it's now been extended from the initial version but it was based on the same syntax, and prologix is probably as well documented as the overpriced big-company hardware with their painful proprietry runtime environments.
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1553
  • Country: gb
Re: GPIB scripting?
« Reply #24 on: March 21, 2026, 08:14:34 am »
The use of AI in coding……if you think you can give it a brief outline and expect good results then you are in for a world of pain. However, if you keep on top of it, lots of direction, do’s and do not’s with each post then it’s well capable of giving you great code.
Trust me…..:)

Ian

So it gets to do the interesting part (building the architecture and writing the code) badly and I get to debug it and give it corrections to design it properly which won't propagate beyond my instance except by the very inefficient mechanism of providing more examples. Which already exist except with less bugs

I could engage a junior programmer and they'd learn and grow. The LLM won't, and if it ever does it will only benefit the companies currently raping the industry.

I don't quite see the appeal.

« Last Edit: March 21, 2026, 08:18:16 am by artag »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->