I will be documenting my journey through the development of backends for SpectraMax L Plate Reader, from Molecular Devices Co. and Cytomat incubator from Thermo Fisher.
If you have any thoughts about this, let me know. I’m very interested in knowing how other people would try to solve the same problems.
I’m not very familiar with USB reverse engineering but I took a look at some videos like this and it seems pretty doable. From there I take a look at the Molecular Devices Co. and they have a software called SoftMax Pro to control the plate reader.
You can download SoftMax software direct from thislink.
Taking a look at the Manual it seems they have an SDK for automation, which is nice. After downloading SoftMax I got to the folder inside program files (x86)/MolecularDevices and used an open-source tool called CodemerxDecompile to check .dll files.
If you open the MaxSoft Pro it’s possible to see a list of discrete actions for the machine.
The decompiled version of program files (x86)/MolecularDevices/SoftMax Pro <version>/SoftMaxPro.ViewController.dll have a filed Services/InstrumentService.cs that have all discrete actions defined as functions like OpenDrawer and CloseDrawer.
The file program files (x86)/MolecularDevices/SoftMax Pro <version>/Readers/SoftMaxPro.ReadersSpecL.dll decompiled will show a file called SpectraMaxLModel.cs that have more details about lower-level details about the connection with the specific hardware and some interesting files like SpectraMaxLDataCorrection.cs that have some functions to data correct plate readings based on some hardware configurations.
The file program files (x86)/MolecularDevices/SoftMax Pro <version>/Readers/SoftMaxPro.ReadersSpecL.dll decompiled will show a file called SpectraMaxLModel.cs that have more details about lower-level details about the connection with the specific hardware and some interesting files like SpectraMaxLDataCorrection.cs that have some functions to data correct plate readings based on some hardware configurations.
The file program files (x86)/MolecularDevices/SoftMax Pro <version>/Readers/SoftMaxPro.ReadersCommon.dll decompiled will show a file called ComPortBase.cs which shows how they implemented the USB connection.
Probably next week I will be using Wireshark to sniff the connection between SoftMax Pro and the machine, store some commands implement at least the open and close function from the plate reader backend.
That’s what I have got so far. Cytomat is a whole animal that I not have touched so far, so let me know if you guys know something about it that could help me.
If someone is interested in helping me by testing with your own MaxSpectra L, or software development let me know.
Did you have any tips or other approaches for this problem? I would be very interested in listening to more of it.
When creating the backends for STAR and ClarioSTAR, I have never actually needed to decompile any software. These decompiled source files are just too large and ambiguous to make sense of. When sources are available (like hsl in Hamilton and possibly ComPortBase.cs for you), those are helpful. dlls were a dead end for me.
Most programs include some form of logging, which can be higher level / preparsed and are generally easier to look at than Wireshark pcaps. Wireshark pcaps are still very helpful to find hardware identifiers.
You probably already know this, but in case you don’t: you can and you should filter by device id in wireshark.
The most complicated part in creating the ClarioSTAR backend was figuring out the application layer protocol. It’s relatively easy to see the bytes, I had to stare at the bytes for hours to figure out how the data is represented by it. What was really helpful for me was actually using a Jupyter Notebook and plotting various bytes as numbers, to detect patterns that match what I expect.
Finally, be sure to check that the USB interface you see is not some protocol built on top of USB, like FTDI in ClarioSTAR, so you won’t be reverse engineering two protocols. Looking at the GET DESCRIPTOR Response DEVICE responses in Wireshark and googling the idProduct value can reveal useful information.
As Luis said, PyUSB is very helpful, as long as the interface is ‘plain’ USB.
Cytomats have documented APIs that work well enough in most cases. We have both low-level HSL libraries and SMT controllers for them, for example. I’d advise to try to stick to documented, public APIs, otherwise you will be often chasing your tail as the binaries change each time and can never be 100% sure about the robustness of your communication with the devices.
Very nice project ! We are using the SMP API a lot for some internal softwares we built in .net, so if you need any information about its use feel free to ask. One advice I can give you with softmax is to not hesitate to kill the software processus and start it from scratch at the beginning of your actions, you lose time but avoid a lot of bugs.
While you are digging the .dll, I’d be interested to know if you come accross somthing that would allow you to print reports automatically (with the print button). It’s not available in the API and all approaches that we tried (mainly UI Automation) don’t work on a server.
I’ll second Gareth advice to use the publically available API, you can do a lot with them and you are pretty sure it will stay documented and supported. (Specially with molecular devices and SMP they like to provide new versions or updates).
One other advice that helped me when starting that whole process of building thid-party libraries for applications was to have a look at the HSL driver (if you have an Hamilton). It will give you a good glance at how to use the API.
Last advice, if you start working with the softmax pro API and you get some issues, it can be linked to the firewall of your computer. We have that happening a lot as we are in a big company and the firewall policies keep changing.