I am currently working on a custom test system that will require multiple interface drivers to simplify things for our test developers.
Recently, I was asked to make it so that we can just swap in multiple different devices, but leave the plugin steps the same. That way, if a technician notices a device is malfunctioning they can replace it with any device from an approved list, and the test will not need to change.
Naturally, I created an interface for the first device, and implemented it in two different devices, and then pulled it into the plugin steps. In this case, it’s a luminance meter. One of the devices takes SCPI-like commands, and the other has its own interface, but both use a serial port. Since I already have a serial instrument interface driver, I simply hooked it up, set the package to depend on that package, and then installed my luminance meter package.
Obviously there will be a bit of setup to ensure the port is correct, but the general goal is to get the test to recognize either device. However, the first thing I realized is that using the AvailableValues decorator, I was having a lot of trouble just selecting devices that implement the interface. Once I got that working, I realized that Open and Close do not execute, so I have to execute them manually in each interface function. Finally, because Open and Close do not execute, if anything goes wrong, the port stays open.
What is the suggested method for implementing an OpenTAP instrument such that it fulfills the interface requirements, and still is capable of functioning like an OpenTAP instrument? At the moment, the only functional options I can see are rather messy and require multiple coding paths in each interface function to determine which device is being used.
Additionally, what would be the best way to implement the serial layer such that it can be used in DUTs and Instruments without having to configure a serial device in the instruments section that is consumed in the DUT section?
