Communications instructions
The communications instructions listed here are the actual SPLat language instructions. Getting communications going also involves setting up a Communications Control Block (CCB) and possibly (depending on the protocol) a control script.
Multiple serial ports
With dialect 29 we introduced a number of communication instructions that start with an 'a'. They all allow you to specify the address of the serial port. The reason for doing this is simply that we are using processor chips that support multiple serial ports (UARTs), and want to be able to give you access to them. The a-prefixed instructions all take an additional argument, the port address. The ii-prefixed instructions also now take a port address argument.
Port addresses are derived from the few unused 8-bit RAM addresses that exist. RAM addresses run from 0 through 249 (250 bytes). There is no RAM at 250 though 255.
The long-established programming port is located at address 251. On our older products this is an RS232-compatible serial port. On more recent 8-bit controllers (MS12x, CC18, etc) it is a serial port with 5V CMOS/TTL levels. On newer 32-bit designs some have a serial port with 3.3V CMOS/TTL levels and some (starting with the EC1) have a USB port instead. From a programming point of view these all respond to address 251.
Starting with the EC1, whose programming port at address 251 is USB, there is a second serial port available at address 252. This port uses 3.3V CMOS voltage levels but is 5V tolerant on the receive line. Many SPLat products have additional ports as well.
Note that port address assignments are fixed in the firmware of each device: You cannot reassign the ports in SPLat.
Port assignments must be read (or copied) from the relevant I/O file for the specific controller.
Note that 32-bit controllers allow use of Modbus on multiple ports. It has been successfully tried with Master mode on one port and Slave mode on another.
Hash commands
We introduced hash commands and hash functions to simplify certain aspects of programming SPLat. Quite a bit of this is aimed at serial communications. In effect "hash programming" gives you access to pre-written code for specific operations, using a simplified syntax and a big reduction in the number of lines of code you have to write. You should check out the available has commands before you start coding.