Post by Carl Gundel on Jan 21, 2021 12:19:16 GMT -5
The way that this typically has been made to work with Liberty BASIC is to find some sort of USB adapter (perhaps to GPIB?) that has a device driver that makes it work like a serial port. Then using the OPEN "COM..." command in Liberty BASIC to control it.
I read they have a connections module but the place to ask would be on their forum. That said there has been a few posts about talking to gadgets over LAN. Michael Molinari posted some code a while back controlling a lamp. I am sure we have seen other posts. Not my forte.
Post by Chris Iverson on Jan 21, 2021 13:45:30 GMT -5
I wonder what "USB" means. Is it a fully custom made driver made specifically for that device, or is it a USB-to-Serial adapter like a lot of devices use?
If it's a USB-to-Serial adapter, you might be able to interact with the COM port it creates yourself.
If it's a custom USB device driver, there's not much you can do without knowing exactly how to interact with it, and if Keysight hasn't published any documentation on the interface, you might have no choice but to rely on their software to do the communication.
Despite the "serial" in the name, USB is not comparable to the old-school serial bus, where you just plug in some wires and get or send a stream of bits. USB is actually quite strict and regimented, and even the drivers/libraries that would let you seemingly communicate arbitrarily with devices(libusb or WinUSB) have to follow the strict guidelines of it.
Heck, pretending to be an RS232 serial device is a feature that's built in to the USB protocol definition(part of the USB Communications class of devices, RS232 has its own subclass), and not just hacked into it by conversion hardware, simply because of how complicated USB communication can really be.
Post by Brandon Parker on Jan 21, 2021 21:41:27 GMT -5
Since the Keysight 33511B has a built-in web server, you might be able to peruse that and find a page that has all of the data you need. Then you could possibly use HTTPGet$() to pull that page with the data and parse the data out of the return from HTTPGET$().
Windows 7 Home Premium 64-bit Intel(R) Quad Core(TM) i5 CPU M 430 @ 2.27GHz 4GB DDR3 RAM
- The original Keysight USB-to-GPIB convertor does not make a virtual COM port, it makes a dedicated USB port. So that does not work. _ Maybe there are USB-to-GPIB convertors that make a virtual port. I would love to try one. But I hesitate to buy one without knowing it is going to work. - I have a Keithley PCI-488 PCI-to-GPIB card, but it won't install with any driver I try. Quickbasic has a GPIB library and can work with this card, but since I cannot get the PCI card to work, no luck so far. - The build-in-webserver provides possibilities to set up the instrument remotely, but does not allow to send commands or retrieve data, unless you use Matlab or Labview, or use the command screen within that server.
So no luck so far . I think I have to move forward with LabView on this one.
Post by Brandon Parker on Jan 23, 2021 17:44:12 GMT -5
I do not believe GPIB.32.DLL is a standard Windows DLL. You likely have it due to working with the equipment and installing something previously.
Try this and see what you have returned from the function Open "GPIB.32.DLL" For DLL As #gpib
Print sendGPIBCommand(16, "volt +2.0")
Function sendGPIBCommand(ud, cmdString$) cmdString$ = cmdString$;chr$(0) cnt = Len(cmdString$) CallDLL #gpib, "ibcmd", ud As long, _ cmdString$ As ptr, _ cnt As long, _ sendGPIBCommand As long End Function
That is considering "volt +2.0" is a valid command. Do you have a command set for the device?
Also, your second link appears to not be working at least for me.
Good news! LB can send commands to the PCI GPIB card.
Brandon pointed me in the right direction, but it needed some more effort. 1. My assumption that the GPIB DLL is a standard DLL is not correct, like Brandon said. You need to install the 2019 version of this DLL from the National Instruments website. 2.Install the complete 2019 package from the National Instrument labview site. Here is the link
Use the default choices. The installation takes some time, let it finish. After installation you should have the GPIB-32.DLL and also the complete package, with all documentation. So now you also have the complete API and DLL manual
3. Locate the GPIB-32.DLL file on your PC. On my 32-bit PC it is in C:\windows\System32\GPIB-32.DLL. On my 64-bit PC it is in c:\windows\SysWOW64\GPIB-32.DLL 4. In LB I needed to point to the complete path on my 32-bit PC. On my 64-bit PC the complete path is not necessary. 5. With the code below the Keysight 33511 steps through 3 frequencies and 3 voltages. 6. I could not get to work using a function, the subroutine approach as in my code works however. 7. Now the code works on the PCI GPIB card I feel confident enough to order a USB-to-GPIB adapter.
If more people are interested in the results, let me know. In that case I will publish further results.
Open "c:\windows\System32\GPIB-32.DLL" For DLL As #gpib