Tutorial: Debugging SPLatWare using serial data
With the advent of a user programmable serial protocol capability, and with the inclusion of a serial terminal function, a very powerful technique has become practicable for debugging SPLat programs. This tutorial will show you some useful techniques using these resources.
Note: Since this tutorial was written we have developed SimpleHMI, an alternative way of interacting with a running SPLat program via the serial port. For certain uses SimpleHMI can offer a better capability.
The serial terminal (this tutorial) is the right choice if you are developing serial communications to fit a 3rd party device such as a motion control board or a weigh-scale, which has its own predetermined message formats (protocol).
As a powerful tool for general program debugging SimpleHMI offers a different set of features. SimpleHMI is also easier to program because it uses hash commands.
This is mainly about debugging techniques. That said, it will equip you for any challenge that involves generating arbitrary serial data out of a SPLat controller.
Target audience
This tutorial is designed to inspire and inform SPLat users who have never had any experience of squirting debug data out of a spare port. If the previous sentence make perfect sense to you, you probably needn't continue. Just study the communications instructions, read up on the terminal function in SPLat/PC, and you are good to go. (That said, you may find a few new ideas in here).
If you have never used any debug tools beyond what SPLat/PC has offered in the past (prior to November 2011), then this could be a very good thing to study.
You probably also need to be developing well-structured programs of some complexity to make this (serial port debugging) worth the effort.
Outcomes (what you will get out of this tutorial)
- An understanding of how to generate outgoing (transmit) data on the serial port.
- Some useful tricks for debugging simple and complex programs.
Prerequisites (what you should know before you start):
- Solid SPLat programming skills. This is not for beginners. You will basically be creating your own debug resources on an ad-hoc basis, so you shouldn't see writing 5 ot 10 lines of extra code here or there as a big burden.
- Knowledge of the SPLat communications instructions, particularly the ones for transmitting data (those with keywords starting in
ii
and containingPrint
(for exampleiiPrintText
andiifPrintWFW
). - A good working knowledge of MultiTrack.
- Experience with connecting a SPLat controller to your PC and programming it with SPLat/PC
- Prior reading of the terminal function in the SPLat/PC documentation.
- Very useful, if not essential: Skills with Builder, so you can turn debug code on or off at will.
- Some understanding of NVEM.
Hardware and software requirements
- A SPLat controller with dialect 28 or later. Check your board's documentation for available firmware updates (reFlash files), if necessary.
- SPLat/PC Build 146 or later
- Power supply
- Connection cable to SPLat/PC.
- Some easy way of turning input on and off (a MMi202, MS120 or HD8 is ideal, as they have push buttons. A CC18 with a CCBB breakout board is also good)
________________________________________________