Using HP 53305A Phase Analyzer Software on modern windows - Page 1
Forum section: electronics / general

author: zrq
author_rank: Frequent Contributor
timestamp: October 15, 2022, 12:23:03 pm
content: Recently, I was lucky enough to recover an Agilent 53310A Modulation Domain Analyzer, which was harshly treated but fully functional. I had fun looking at several oscillators at hand but soon get a bit disappointed about it's minimalism feature set available from the front panel. Then I noticed there is a companion software 53305A which can acquire raw time stamps, save raw data of frequency-time plots which can be fed to Stable32 for further analysis. Unfortunately, this piece of software is 28 years old. It is a 16bits Windows binary, only designed for ancient GPIB interfaces. So there are two challenges if I still want to use it on my modern computer with my NI GPIB-ENET/1000, I need to adapt it to 64bits Windows and to VISA.Reading posts by fellow members in the forum, it seems this piece of software is written with VB 3.0, so the first thing I tried was to decompile the code and recompile in a more modern VB with the VISA interface inserted. But when I noticed there is a dependency on a 16 bits dll PHASELIB.DLL, which appears not written in VB and will be much more difficult to modernize.Later, I noticed a wonderful projecthttps://github.com/otya128/winevdm, which emulates a 16 bits CPU, forwards most Windows API calls to the native system and emulates the remaining. It turns out 53305A runs just fine with today's appveyor builds. Then I started to work on a mechanism to redirect the instrument communication, the easiest way I see is to do write a shim dll to replace SICL16.DLL and hijack the traffic to VISA. I started a Windows 2000 VM and get Borland C++ 5.02 running, figured out how to do the 16-32 thunking, and write a tiny bit of code for API adaption. Ha, it works!I attached the translating SICL16.DLL here so feel free to try out. I'm also going to upload the Borland project after cleaning it.Usage is simple, first make you have a working GPIB connection (almost no error handling yet) and visa32.dll well installed, install the unstable build of otvdm, download the 53305A installer from ko4bb.comhttps://www.eevblog.com/forum/metrology/hp-53305a-phase-analysis-software/msg1784408/#msg1784408, run the setup.exe as if it's a modern software, put the SICL16.DLL into C:\HP53305A , select SICL interface but put your VISA address instead. Then it should work.

author: maxwell3e10
author_rank: Frequent Contributor
timestamp: October 16, 2022, 12:31:01 am
content: Thanks, this is very cool! At some point I managed to get the software to run on a Windows XP computer. Also poked inside the code and captured GPIB traffic to see if one could replicate the GPIB commands, but didn't get very far.Another option to get functionality similar to time stamp is to measure time interval between two signals at similar frequency, one being a reference.

author: Tony_G
author_rank: Super Contributor
timestamp: October 16, 2022, 03:07:29 am
content: Interested in seeing the shim DLL you wrote - Great work - Look forward to you posting that code.TonyG

author: zrq
author_rank: Frequent Contributor
timestamp: October 16, 2022, 10:47:26 am
content: Here I attached also the source of the shim dll.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: October 16, 2022, 03:45:57 pm
content: You can run most any operating system using Virtualbox, though it can be a PITA to get it working the first time. Wouldn't the manual have the GPIB commands for the various functions?

author: zrq
author_rank: Frequent Contributor
timestamp: October 16, 2022, 08:09:36 pm
content: Quote from: Conrad Hoffman on October 16, 2022, 03:45:57 pmYes, of course.But the problem is how you get the virtualized program to talk to your instrument connected to the host machine. USB passthrough maybe a way if you have a USB GPIB card and you don't need to use your host machine to talk to something else.This program uses many undocumented commands, it DIAG:PEEK?, DIAG:BRE? and DIAG:POKE completely undocumented data from/to completely undocumeted addresses.BTW: it seems you can make a ROM dump by DIAG:BRE? without opening the case (DIAG:BRE? <base addr>, <length>, the base address seems to start from 0). Does anyone have 53310A dumps can share and compare? Also it seems there are many PALs, so maybe a dump of the main ROM is not that useful as any of those may lose their memory eventually.

author: artag
author_rank: Super Contributor
timestamp: October 16, 2022, 08:41:34 pm
content: I've run this software using windows XP and an NI GPIB-USB-HS without having to emulate anything, but would much prefer to run it in a VM or re-write it to natively run under Linux. I did try to decompile it but know little of VB's history amd just ended up with a mess of decompilers which failed to do the job or failed to run at all.Could you show the decompiled code please ? We may be able to write an open replacement for the DLL.I'm happy to open the case and dump my ROMs if that turns out to be difficult using BRE. PALs may be more difficult.

author: artag
author_rank: Super Contributor
timestamp: October 16, 2022, 09:04:33 pm
content: I appear to have a copy of the ROMs stashed away.Not sure where it came from but I don't think I dumped them myself, so I'm sorry if it's someone else's work - I owe you an acknowledgement.update : the README says Wayne Knowles ZL2BKC. So thank you, Wayne.https://zl2bkc.com/

author: zrq
author_rank: Frequent Contributor
timestamp: October 16, 2022, 09:14:55 pm
content: Quote from: artag on October 16, 2022, 08:41:34 pmI'm actually kind of surprised that NI 488 still support being called from 16 bits programs. Does the 32bits version still have 16bits GPIB.DLL or you need to find an ancient release? (some reading herehttps://forums.ni.com/t5/Instrument-Control-GPIB-Serial/gpib-dll/td-p/279336)What I did is just fed the phase.exe (can be unzipped from phase.ex_) to the tool found herehttps://stackoverflow.com/a/20789983. If you cannot manage I can attach my copy later with another computer.Also if you use linux, maybe you can have some luck with wine (and apply some similar hacks)? which should support 16-bits windows program.

author: zrq
author_rank: Frequent Contributor
timestamp: October 16, 2022, 09:22:33 pm
content: Here is my BRE dump, ver 3944 (should be very new).The one artag posted seems to havethe endian wrong, which may be fixed by dd conv=swab (thanks ddcc :https://www.eevblog.com/forum/repair/agilent-34410a-flash-dump/msg2545995/)something weird, the strings are not readable.edit: it appears the four ROMs need to be interleaved two by two.

author: artag
author_rank: Super Contributor
timestamp: October 16, 2022, 09:32:58 pm
content: Thanks. My machine has the same version (3325) as Wayne's so yours is an upgrade. I will try installing it, and also that decompiler.I ran the software under XP and I think it took me a while to find an old enough copy of the NI software to install. I was quite surprised it ran with a USB interface, but it did !

author: artag
author_rank: Super Contributor
timestamp: October 16, 2022, 09:51:19 pm
content: Quote from: zrq on October 16, 2022, 09:22:33 pmThat doesn't surprise me. I'd guess them to be in pairs for a 16 bit data bus and then in address order.I haven't checked the schematic but this should be apparent.If you need a copy of the service manual, I can recommend the one available from Artek Media.

author: artag
author_rank: Super Contributor
timestamp: October 16, 2022, 10:23:34 pm
content: You will have found these threads already, but for the convenience of anyone else reading later, there are a great deal of interesting notes in some older threads about the 53310A,https://www.eevblog.com/forum/metrology/hp53310a-and-other-counter-allan-deviation/msg3332994/#msg3332994https://www.eevblog.com/forum/metrology/hp-53305a-phase-analysis-software/msg1781951/#msg1781951https://www.eevblog.com/forum/testgear/hpagilent-53310a-modulation-domain-analyser-frequency-time-interval-analyser/msg3327576/#msg3327576https://www.eevblog.com/forum/testgear/hp-53310a-modulation-domain-analyzer-79866/https://www.eevblog.com/forum/testgear/hp-53310a-modulation-domain-analyzer-79866/?action=dlattach;attach=706314There are also a number of videos on youtube