User programmable protocol
The "User programmable protocol" is not actually a pre-implemented protocol; it is a set of instructions that gives you sufficient flexibility to program SPLat to communicate with a wide range of 3rd party products. We describe these collectively as "ASCII protocols", because most such products have a command/data message format that use human-readable ASCII characters. You can also program protocols that use non-ASCII codes.
A typical ASCII protocol consists of lines of text that will appear readable on a terminal emulator such as HyperTerm or RealTerm or the terminal function built into SPLat/PC. Each line (terminated in a carriage return and/or line feed character), will typically consist of:
- A start character, often something like a colon or an asterisk
- One or more command characters, say 'M' for move
- One or more numeric argument as a string of digits, leading plus or minus sign and embedded decimal point. More often than not the multiple numeric argument are separated by a defined character such as space or comma, but some devices place them in fixed width fields with no separator (for example some Mettler/Toledo weigh scales when transmitting Indicated and tare weights).
- Terminating carriage return/line feed.
For example, a hypothetical motion controller might have commands to Move Absolute (MA) or Move Relative (MR), Set Acceleration (SA) and Set Maximum (speed). Typical commands would be (don't struggle to fully understand this, you are better off concentrating on your own real application!):
!SM25
!SA0.15
!MA12345
!MR-983
In some devices the start character, '!
' above, is sufficient, so the end of line carriage return is not required. Were that the case, the following would be equivalent to what's above:
!SM25!SA0.15!MA12345!MR-983