FlexIO Pro was the upgrade to my original FlexIO Classic software developed a few years ago for my CNC cable benders. The classic program was developed in a very short period of time, and at the time it was done, I chose to use a fully custom interface based heavily on some of my game code in order to save a lot of time with the interface. While this worked at the time, it was very clear from the beginning that we needed to move away from a DirectX based interface, to a standard Windows interface that everyone could recognize. There were also several other key components that were upgraded in the Pro software, but we will get more onto those later 🙂
Where To Start?
I looked into several interface packages in order to start working with a GUI that I liked. Eventually, I settled with wxWidgets as it just seemed the natural choice, especially as it is portable to other platforms. I looked at the basic Windows interfaces within the Visual Studio editor, I looked at Qt, GTK+ and MFC and wasn’t really captivated by the quality and ease of working in the interface. To make things nice, I also bumped into DialogBlocks for building the interface. The really awesome feature here, is that I can mix my own code in with the generated interface code, so I could work on the project in Visual Studio at the same time and build from there if I wanted. In theory, the code generated should also work on other platforms if I want to go that route in the future.
What Else Needed Changed?
The old program worked well for what was needed at the time, but there were quite a few areas that I felt needed to be re-coded. Due to the short time that was available, some of the features that were added were not very expandable for the future making future upgrades near impossible. These included the handling of custom file types, the internal handling of the bending objects, and the moving of data back and forth between several sections of the program. Other significant program improvements came in the following:
- Improved Serial Control – There were many bugs in the way the old program handled serial port data back and forth between the controller. To be honest, the old code seemed more like a hack. If the controller sent back strange packets of data, the program would take a long time in order to re-synchronize itself, and quite often if was just way more simple to close and restart the program. The same problems also happened if the controller was getting too many commands at once (a small fix was to throttle outgoing commands). All of these problems have since been addressed with a fully automatic traffic handling system, that deals with multiple commands, and can handle incomplete & fragmented data packets as they come in. It also had a side effect of making the controller far more responsive, and the response times can be greatly increased, making some movements feel like real-time. Yay!
- Better Options & Configuration – The old program only had a handful of small options that could be configured. All database paths and 99% of significant values used by the various libraries were hard-coded for use in the production floor. The new options interface has several pages of categorized options, to control everything from paths, to values used by the file handling & math libraries, database options, errors & limits and more.
- Rock-Solid Core Integration – Data being used is readily available to any additional section of the program with almost no additional work needed. To make things easier, data is handled in just one format (Millimetres) and is converted on the fly to the requested format, as needed by the operator and their preferences. Some operators prefer to work with values in Inches, vs. those who prefer to read everything in MM. Cable parts are handled internally as an object, so moving it from one screen, to another, is not a complicated process requiring reloads each time. Change a value in one location, it changes everywhere it’s used. We can also handle multiple cables at once.
- Greatly improved BND/DAT Handling – All of the code to handle the native BND & DAT Files were completely re-written from scratch to alter every aspect of the handling process. The loading process now uses modules, so we can report errors for different things, not just I/O errors, but also it is able to detect problems with the physical data and return the error code, without causing a fuss to the operator, or in the worse case, loading really bad values that could possibly cause a hardware crash on the machine if the operator is not paying too much attention. It is also easier now to implement new types of file (such as the FLX format) as they are needed. Data is easily converted from one format to the other on the fly.
- Automatic Inch/MM Conversion – One of the big caveats of the old program was it’s inability to detect the differences between a file loaded in Inches, and Millimetres. The code is now able to detect this automatically, and do the necessary conversions. In the rare cases where this isn’t so easy, a small DB is set up where this can be implicitly declared, making life easier for the operator.
Let The Coding Begin!
The first sample versions of the program took about 4 months to get ready, in between working out obvious bugs and getting the controls just right. The first version was released on July 6th, 2011.
What Other Cool Features Are Added?
- Improved CNC Speed Controls – Its now possible to customize the speeds of each axis of the cable before bending. Some designs are more sensitive to rotations being too fast, for example. You can now keep the speed of the feed relatively fast, but still maintain a slow rotation to prevent damage.
- Improved Bending Logic – Complex cables with unnecessary steps are now optimized a little bit better, to save some time.
- Built-In Terminal Client – In the event of a problem, or extra troubleshooting is needed, there is now a built-in Terminal client which talks directly to the controller.
- Additional Helper Tools – New tools have been added to the mix to assist in cable development. XYZ Verification, Program creation, batch printing, and many many more.