I am finally able to demonstrate direct jamod control of Ifos.
Now that I’ve switched to GPUTILS from MPLAB, makefiles have re-entered my life. I’ve always hated writing them, the last time being five or six years ago for BREW projects, an atavism not unlike my recent return to assembler. As I sat down to write three new ones (and they’re about as straightforward as makefiles get), all the unpleasantness came flooding back to me. Forgettable macros, single stems, arcane completion rules—I thought about documenting my innumerable complaints, but found someone had already summarized them perfectly.
Up to now I’ve been controlling my Ifos slaves with a simple Modbus master I wrote in Ruby. In preparation for the move to TINI, though, I thought I’d better investigate Modbus master code actually capable of running there. jamod is the logical first choice, since it’s Java-based and fairly mature. TINI runs Java, and if jamod complies with the Modbus application protocol specification, everything should just work.
Here's my super-effective Ifos development workspace. It's a temporary solution, having no other place to put the new iMac. (I think Angie was a little dismayed that we needed another computer... Let's see, there's the office desktop, my laptop, my netbook, her laptop, her studio workstation, my workshop workstation, and now an iMac. What's the problem?)
For the projects I work on these days, switching to a Mac OS X-based development environment has been mostly painless. Eagle works, Java and Ruby are essentially cross-platform, and there’s always Unix just under the covers. It’s the hardware tools that have been difficult to migrate, mostly related to PIC assembly and programming.
On the PC, I’ve been using MPLAB for PIC code development and simulation, but that program isn’t available on the Macintosh. Luckily, GPUTILS is a stellar alternative that runs on Mac OS X. I ran into only a couple of issues in switching over.
More progress on my Mac development path migration: I can now control Ifos slaves from my iMac. This is the culmination of a few related successes, and means
Related, but not specifically required for basic Ifos control via Modbus/Ruby:
Here's a short video of Ifos running a hardware check. The LEDs are intensely bright, so it probably would have been better not to shoot them straight-on, but the basic operation is still obvious.
Since my Ifos project relies on Modbus over RS485, I needed a simple way to interface to an RS485 network from my PC during development. Here's a simple single-chip converter based on the MAX3162. A DB-9F connects to the serial port on the PC, while the RS485 bus is accessed via an RJ-45 connector.
Here's a tiny Modbus master in Ruby that supports ASCII and RTU modes for all function (and subfunction) codes defined in the MODBUS Application Protocol Specification V1.1b. (Joachim Wuttke has published a similar version that handles TCP.) Serial port handling in Ruby is provided by Guillaume Pierronnet's Ruby/SerialPort code.
Finally tracked down the source of my RS-485 communication problems, manifested by slave responses containing spurious characters, dropped entirely, or garbled beyond recognition. Server commands were always fine; data was complete and checksummed correctly. The source of the problem came down to one fundamental issue, exacerbated by a silly wiring mistake.