This week we talked about plugging our embedded devices into computers for control. As usual, we covered an entire discipline in a few hours, touching on programming languages, frameworks, libraries, UI/UX design, graphics, audio, video, VR, AR, computational performance, etc. Our assignment was to write an application that interfaces with an input or output device we made.
I'm new to Python and interface programming generally, so I kept it simple this week. Getting data out of bench instruments can be useful, and the analog bits that make old gear good tend to outlast the digital interface flavor-of-the-decade. The CBA has a collection of fantastic but outdated HP test equipment, much of which is capable of communicating using an antiquated 8-bit parallel protocol called HP-IB (or, once other manufacturers started using it, GPIB). IEEE standardized the specification as IEEE-488.
A good project would be to design and build an open-source HP-IB/GPIB hardware dongle. I ran short on time this week, so I used one of the lab's bright yellow PROLOGIX GPIB to USB adapters:
Some time ago I used a similar adapter to pull resistance data out of my HP 3478A for connector cycle testing. The HP34401A I have on my desk at the CBA is a bit different, but fortunately it can be changed to HP 3478A language mode (mmm, VFDs glowing in a poorly lit room):
The PROLOGIX adapter is a serial USB device, so the pyserial library provides an easy way to address the instrument. I also threw together a tiny window in tkinter, so the user can press the "get reading" button to return the current measurement from the meter, and change the VFD display to say "how to make". Here's how it looks on my laptop, reading out just over 15.6 VDC:
See? Tiny window and a bare-minimum hello-world, but it does work. Future work could include full configuration options for the meter, datalogging, unit display, etc etc etc...