A cheap 4-channel 0 → 10V output with Tcl and MODBUS
I've been interested in fieldbusses lately, and MODBUS in particular is used by some pretty cheap hardware modules. It also offers "driverless" communication — you don't need a .dll or .so file to talk to your hardware. The hardware I've been experiementing with is shown below:
...and can be bought from eBay for around 50 USD. I found some very useful code on the Tcl wiki and was able to write and read from registers with a USB/RS-485 adaptor. The RTU-307C user's manual implies that you can change the RS-485 baud from 9600, but I wasn't able to figure out how that works.
After some more help from The Tcler's Wiki, I put together a GUI to demonstrate MODBUS communication with the RTU-307C module. The animation below shows the GUI next to an oscilloscope (yelloscope) display. The wiki helped me get the mouse wheel to move those sliders.
Links
Source: Repository on Gitlab