Author Topic: AR488 Arduino-based GPIB adapter  (Read 237016 times)

0 Members and 1 Guest are viewing this topic.

Offline artag

  • Super Contributor
  • ***
  • Posts: 1070
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #700 on: May 12, 2021, 04:01:50 pm »
There's a sigrok driver for the 3457A - have you tried it ?
I'd be interested to know whether it's useful, as I maintain the 34401A version.

The sigrok display utilities are more aimed at continuous datalogging rather than presenting the full feature set as  NX-1997's utility does. But if the sigrok drivers could be used to extend the capacity of the utility it might be useful for a much wider selection of meters.
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1324
  • Country: ca
Re: AR488 Arduino-based GPIB adapter
« Reply #701 on: May 13, 2021, 12:42:29 am »
Hi, I created the ultimate HP 3478A control and data logging software for the ar488 adapter. It has everything that you can ask for. Measurement Graph, math waveforms, statistics, histogram, etc. Works with Windows 10, 8, 7.
If you have a HP 3478A then please, try it and give me feedback. I will be creating similar software for 34401A, 3457A, 3456A.

Hi Nx-1997,

Nice program but there are some issues with the buttons. Please see attached.
Fear does not stop death, it stops life.
 
The following users thanked this post: Nx-1997

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1324
  • Country: ca
Re: AR488 Arduino-based GPIB adapter
« Reply #702 on: May 13, 2021, 03:07:01 am »
Ok, the buttons are ok now but in the Config window if I click on ++ver button, it refuses to connect to the instrument after that. I don't know what settings it changed in the AR488, I reprogrammed it and it connected again.

Edit: Also, if I may suggest, take a look at these two projects:
https://www.eevblog.com/forum/projects/project-extending-hp3478a-functionality/
https://www.eevblog.com/forum/testgear/free-hp3478a-multimeter-control-program/msg2136739/#msg2136739

Lmester's program works with both, AR488 and Kirill's adapter. I think would be just a matter of accepting a different string to ++ver command to make your program work with Kirill's adapter.
« Last Edit: May 13, 2021, 03:18:23 am by Miti »
Fear does not stop death, it stops life.
 

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: AR488 Arduino-based GPIB adapter
« Reply #703 on: May 13, 2021, 03:20:18 am »
Only the ++addr command is used to change the address, everything else is default. If you have a pro micro version then just click the ++rst button, it will reset the controller back to default settings. Probably better to have one controller per instrument.
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1324
  • Country: ca
Re: AR488 Arduino-based GPIB adapter
« Reply #704 on: May 13, 2021, 03:27:15 am »
I tried ++rst but it didn’t work for me. Also, it didn’t work with Luke’s program either. I had to reprogram it to start working again.
Yes, I use Pro Micro.
Fear does not stop death, it stops life.
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 910
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #705 on: May 13, 2021, 09:35:59 am »
I played with the software briefly yesterday evening and limited testing showed it works nicely for me.

Do have a question though: did I overlook something or is there currently no way to save settings?  That would be neat to have 😀
 

Online Echo88

  • Frequent Contributor
  • **
  • Posts: 826
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #706 on: May 13, 2021, 03:48:33 pm »
Finally came around to testing the AR488-library on my Arduino Mega board connected to a stripped GPIB-cable.
It worked immediately in Controller Mode when communicating with my HP 34401A and also worked in Device Mode when my USB-GPIB-HS spoke to it via Python.
Im thrilled to see it working out of the box directly :-+

Im still a bit overwhelmed by the many commands and therefore have a few questions about the Device Mode (regarding my planned use of the Device Mode with the library: https://www.eevblog.com/forum/projects/ar488-arduino-based-gpib-adapter/msg3449932/#msg3449932 )

In Device Mode the AR488 isnt capable of responding to a *IDN?-command with an answer, i assume?
It would be nice to actually be able to use DipSwitches to set the address in Device Mode, so one wouldnt need to connect to the Arduino to change the address in software. Will that be integrated into the library in the future?
I assume the Arduino is busy with the AR488-library and so i should use another µC to actually do my rather slow and amateur-programmer stuff like switching relays with its associated delays or is the library not bothered by it due to using interrupts for the time critical response stuff?
How do the LLO/LOC-commands coming from a controller influence the Device Mode actually? I can see the usage, but would expect that the Arduino in Device Mode activate two outputs for LEDs like "Front Panel Disabled" and "Remote Control Active" when seeing those commands?

Sorry for the many questions, i just think that your library could enable many hobbyists to build instruments with GPIB-capability, apart from the usage as a very nice and low cost controller.  :)

Is there a way to donate to you WaveyDipole? Couldnt find a way to do that on Github.
 
The following users thanked this post: WaveyDipole

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21681
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: AR488 Arduino-based GPIB adapter
« Reply #707 on: May 13, 2021, 10:37:57 pm »
Putting this here as it's the most recently active thread, and, I think is compatible anyway?

I've made a humble start to my own tooling.  It's more of a script than an app:
https://github.com/T3sl4co1l/tekcap
I.. don't particularly feel like making a windowed version with common dialogs and remote controls and all that, but that's entirely possible for someone to do...  Think the most likely additions I would make, would be querying HARDCopy FORMat and setting default extension from that, or detecting known extensions to set FORMat respectively.  Maybe add some metadata, like echo out current waveform settings or something.  Or just dump through all the IMMediate MEASurements just because, Idunno.

Not sure what I'll do for my other instrument (HP 8590A), it resets configuration when addressed... PITA to use with hybrid controls like this.

Also, it's probably doable with generic / portable library functions, not Windows calls?  Not sure, I took a glance at serial port use and it looks very different in *nix, and I'm not sure simply fopen() has enough configuration settings to get to the same place.  Could write the output file that way, of course.  Anyway, the calls and settings are pretty obvious, not a big deal if porting is needed.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #708 on: May 14, 2021, 02:26:28 pm »
Finally came around to testing the AR488-library on my Arduino Mega board connected to a stripped GPIB-cable.
It worked immediately in Controller Mode when communicating with my HP 34401A and also worked in Device Mode when my USB-GPIB-HS spoke to it via Python.
Im thrilled to see it working out of the box directly :-+

Glad it worked!

In Device Mode the AR488 isnt capable of responding to a *IDN?-command with an answer, i assume?

Since its in device mode, it can't send GPIB commands to query another instrument. However, if you are thinking that as a device it might respond to *idn? from a controller just like an instrument does, then that functionality is not currently implemented but could be added. I will add it to the work log.

It would be nice to actually be able to use DipSwitches to set the address in Device Mode, so one wouldnt need to connect to the Arduino to change the address in software. Will that be integrated into the library in the future?

DIP switches require GPIO pins to detect their state and we don't have any spare on the smaller boards such as the Uno, Nano and Micro/Leonardo, but on the Mega that functionality could perhaps be added. I am also working on another development that might make it possible to implement DIP switches on the smaller boards as well. Another one for the work log.

I assume the Arduino is busy with the AR488-library and so i should use another µC to actually do my rather slow and amateur-programmer stuff like switching relays with its associated delays or is the library not bothered by it due to using interrupts for the time critical response stuff?

Obviously the more the microprocessor has to service the more processing cycles will be used which will impact on performance. I don't think switching a handful of GPIO pins and reading a response would be terribly onerous, particularly on a Mega 2560 which has better performance than a Nano, Uno or Micro Pro. Having said that, it is possible to link two Arduino boards via SPI, I2C or Serial and appropriate signalling could be implemented to have the second board respond to specific GPIB commands. That would allow one board to run the GPIB bus and the other to service the device hardware (relays etc) without one impacting much on the other.

Using interrupts on the Arduino does not seem as beneficial for controlling program flow as initially imagined. The interrupt service routine needs to be simple and fast, ie. set a variable which is then processed next time around the loop. The response is quicker in that the variable is set immediately the interrupt triggers, but one still has to wait for the next iteration of the loop before being able to process that variable and take the appropriate action. I am beginning to think that it would probably probably be easier and just as fast to check the state of the required pin as and when required during the process loop.

How do the LLO/LOC-commands coming from a controller influence the Device Mode actually? I can see the usage, but would expect that the Arduino in Device Mode activate two outputs for LEDs like "Front Panel Disabled" and "Remote Control Active" when seeing those commands?

Again, not currently implemented but could easily be done.

Sorry for the many questions, i just think that your library could enable many hobbyists to build instruments with GPIB-capability, apart from the usage as a very nice and low cost controller.  :)

Is there a way to donate to you WaveyDipole? Couldnt find a way to do that on Github.

I am happy to answer any questions and thank you for the ideas.
« Last Edit: May 14, 2021, 06:56:36 pm by WaveyDipole »
 
The following users thanked this post: Echo88

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #709 on: May 14, 2021, 06:45:50 pm »
Nx-1997 and T3sl4co1l, thank you for your software contributions.
 
The following users thanked this post: Nx-1997

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #710 on: June 01, 2021, 12:35:44 pm »
@WaveyDipole:

Your Twilight-Logic/AR488_Store repository is down or removed?

Should I continue to use your AR488 program to work on the Tektronix 4924 Emulator?

Thanks!
 

Offline Vivis

  • Contributor
  • Posts: 14
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #711 on: June 02, 2021, 01:30:37 am »
Tried posting this in the beginners sections but didn't get a response after a few days so i figured I'd repost here to see if anyone can help.

I have an HP1630D I'm trying to get an inverse assembler on. I've built the AR488 and can get the HP to respond to button press commands and rst, but i can't quite get an assembler to load. Honestly, I'm not even sure I'm sending it right. I've been trying to send the files via coolterm's send text/binary file function. The best I can get out of the 1630 is a CRC error. I have been able to successfully invoke the TC command but have not been able to reload the config that TC generates.

Thanks for any suggestions in advance
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1070
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #712 on: June 02, 2021, 02:34:22 pm »
A 1630 uses HP-IL for mass storage and can probably do the same thing over HP-IB. There are emulators for HP-IB mass storage that are used by various HP computers.

I don't know how much of a project it is, but it might be worthwhile linking AR488 to those emulators so you can have a cheap storage emulator on PC. I think the  existing one uses standard NI or HP bus cards.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #713 on: June 03, 2021, 05:05:16 pm »
@WaveyDipole:

Your Twilight-Logic/AR488_Store repository is down or removed?

Should I continue to use your AR488 program to work on the Tektronix 4924 Emulator?

Thanks!

That is very strange. Just had a look and it is still there as a private repository and you are still configured as a collaborator. I tried to send you another invitation but the system will not let me because you are already a collaborator.
Maybe its a GitHub glitch?

 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #714 on: June 03, 2021, 05:58:06 pm »
Tried posting this in the beginners sections but didn't get a response after a few days so i figured I'd repost here to see if anyone can help.

I have an HP1630D I'm trying to get an inverse assembler on. I've built the AR488 and can get the HP to respond to button press commands and rst, but i can't quite get an assembler to load. Honestly, I'm not even sure I'm sending it right. I've been trying to send the files via coolterm's send text/binary file function. The best I can get out of the 1630 is a CRC error. I have been able to successfully invoke the TC command but have not been able to reload the config that TC generates.

Thanks for any suggestions in advance

Is it a text file or a binary file? How long is the file?

Arduinos have a very small serial buffer and there is no handshaking control. This is OK for short commands or one liners of a few bytes, but if a large amount of text or data is being sent in one go, then the process might be running into buffer overflows which would cause data to be lost and hence possibly the CRC errors. If the file is binary code, certain files bytes (e.g. CR [0x0D], LF [0x0A] and ESC [0x1B]) would need to be escaped. It might help to send one line or a chunk of no more than, say, 64 - 128 bytes at a time and have a short delay of a few milliseconds in between which could be done using a script.


« Last Edit: June 03, 2021, 06:00:27 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #715 on: June 03, 2021, 06:05:39 pm »
@WaveyDipole:

Your Twilight-Logic/AR488_Store repository is down or removed?

Should I continue to use your AR488 program to work on the Tektronix 4924 Emulator?

Thanks!

That is very strange. Just had a look and it is still there as a private repository and you are still configured as a collaborator. I tried to send you another invitation but the system will not let me because you are already a collaborator.
Maybe its a GitHub glitch?

I figured it out - I am using a replacement laptop, so I had to re-authenticate to github and log back in to access the AR488-Store and download it to this laptop.
 

Offline Vivis

  • Contributor
  • Posts: 14
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #716 on: June 04, 2021, 12:08:51 am »
The file is binary and just under 5149 bytes with the escapes added. I will try sending shorter pieces and if that works, whip up a python script to both escape the necessary chars and send it in manageable chunks. 
Thanks for a place to start!
 

Offline Vivis

  • Contributor
  • Posts: 14
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #717 on: June 04, 2021, 01:42:52 am »
It might help to send one line or a chunk of no more than, say, 64 - 128 bytes at a time and have a short delay of a few milliseconds in between which could be done using a script.

No Dice-- when i manually send data, as soon as it hits 128 bytes in size (no matter if i send in 32, 64 or 128 byte chunks), I always get flashing "WARNING Awaiting HP-IB transfer".
When I send ++read, I get "Bytes read:1 gpibReadByte: timeout waiting for DAV to go LOW" in return and a repeat of "WARNING Awaiting HP-IB transfer" on the analyzer. Tried changing the timeout to the max 32000 and it still doesn't work
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #718 on: June 05, 2021, 04:19:57 pm »
Thank you for reporting back. The delay needs to be shorter than the timeout so that the controller does not drop out of the send loop.  and and subsequent transmission will be viewed as a new chunk of information. It sounds like "WARNING Awaiting HP-IB transfer" is the HP1603D's way of saying that it was expecting more data. Since the transmission was no complete and the instrument is still waiting, it is not yet ready to send anything back, hence no response to the expected handshake when attempting to ++read.

I had a thought to implement XON/XOFF to provide at least some kind of handshaking. Software handshaking is not ideal, but it is still supported by most terminal programs. Otherwise there would be a need to implement some custom form of software handshaking. I will do some experimenting and testing to determine what can be accomplished.
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1070
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #719 on: June 06, 2021, 12:02:05 pm »
It may be possible to avoid this on the 32u4 version by relying on the USB handshake, which I think will stall the transfer until bytes are read from / written to the UART buffer.
 

Offline Vivis

  • Contributor
  • Posts: 14
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #720 on: June 06, 2021, 09:06:39 pm »
I'll give it a try with my Leonardo and see what happens.
 

Offline Vivis

  • Contributor
  • Posts: 14
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #721 on: June 07, 2021, 04:55:59 am »
Ok, got a config and 2 separate IA's to load at this point, so I think it's all set.
I did not end up trying the Leonardo due to getting the nano to work.
Changed a few things, so I'm not sure if the below config is %100 necessary, but it works for me and will hopefully work for other 1630/1 owners
AR488 config:
eos: 3
eoi: 1
eor: 7
read_tmo_ms: 1200
eot_enable: 0

Make sure to escape 1B first (otherwise you'll have a lot of extra 1B's in your binary file!) then escape 0D, 0A, and 2B

See attachments for Coolterm config:

I think the combo of changing the transmit character delay to 3ms (there was none before) and setting eos to 3 is what did the trick.

Thanks All!


« Last Edit: June 07, 2021, 04:58:57 am by Vivis »
 
The following users thanked this post: artag

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #722 on: June 07, 2021, 07:08:29 am »
Again, thank you for reporting back. Setting EOS to 3 to removes line terminators which is usually a necessary step when sending binary data. Instead, the EOI signal is used to indicate the end of the transmission, which is what you have done. Setting eot_enable to zero is the default setting so probably does not have an effect here unless it was already set to 1 for some reason.

Glad you worked it out in the end. Use of EOI for binary data transmission is covered in the manual but I really should have thought of that. Sorry I missed it.
« Last Edit: June 07, 2021, 07:21:23 am by WaveyDipole »
 

Offline Vivis

  • Contributor
  • Posts: 14
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #723 on: June 07, 2021, 04:56:08 pm »
I actually had EOI set to 1 before. I'm taking a guess it was EOS that made the difference.
 

Offline Nx-1997

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
Re: AR488 Arduino-based GPIB adapter
« Reply #724 on: June 11, 2021, 08:58:12 pm »
Alright, I finished making GUI software for 34401A, 3457A, 3456A, and 3478A. They will work with Windows 10, 7, 8. I personally tested them on Window 10 and 7.
You can download the software from their GitHub links. Let me know if you encounter any issues.

HP 34401A: https://github.com/Niravk1997/HP-Agilent-Keysight-34401A-Control-and-Data-Logging-Software
HP 3457A: https://github.com/Niravk1997/HP-3457A-Software
HP 3456A: https://github.com/Niravk1997/HP-3456A-Software
HP 3478A: https://github.com/Niravk1997/HP-3478A-Software

HP34401A


HP3457A (Supports 7.5 Digit mode)


My goal is to replace my 82357B GPIB setup. Each instrument will get its own AR488 adapter. No more installing IO suite or NI-Visa. This will take some time to accomplish. :-/O
 
The following users thanked this post: wkb, chickenHeadKnob, croma641, dannybeckett, artag, WaveyDipole, maxwell3e10


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf