Previous Topic

Next Topic

Book Contents

Book Index

SLCom Overview: SPLatLink and the SLCom control

SLCom is a proprietary protocol. It is no longer supported on any SPLat board that supports the industry standard ModBus.

The primary purpose of SLCom is to make it as easy as possible for you to write PC applications that exploit the SPLatLink communications protocol. A typical application is a program used in a notebook to configure a machine without actually reprogramming the SPLat controller. In such a case the non-volatile memory would be used to store the configuration parameters. Another application might be to make a data logging facility for use during product development in order to determine optimum control settings or catch some elusive bug (See SPLogger).

The earliest, simplest SPLatLink implementations in SPLat controllers give access only to Data Memory (both read and write) and the PermStore operation. Those implementations are 1st generation boards with firmware version 2.0 or higher. The specific boards are SL88, MMi88, SP108, OEM32, OEM32 and some custom boards.

All subsequent controller boards are expected to have the full range of features.

Even with just Data Memory access it is possible to access I/O simply by having your SPLatWare program create an image of those items you need in Data Memory. It is not really practical to do the same for timers.

The primary design objective of SLCom was to "decouple" the complicated process of extracting information from the board from the process of using that information in an application. What we did was to make the program extract the information from the board on a regular timed basis and deposit that information in a data base where your application can read it out asynchronously.

What that means is that when your program reads the value of say input 6, what it sees is the value most recently extracted from the board. It could be one second old or 1 day old.

This is not bad, in fact it is good. What we have done is to hide from you the gory details of how to send a request to the board, then wait for an answer.The program structure to do that is quite sophisticated, because it must wait some finite time without hogging the processor.

You can control how often the board is to be interrogated for update information. It can be once per second or once per day. It can even be on specific demand only. We also provide a notification event on the completion of one "scan" of the board. Finally, you can determine exactly which bits of information you want the control to access, thereby controlling how much communications traffic is generated. The end result is that once you have configured the control you can just sit back and pull the answers out of the control at your leisure.

Changing Data Memory in the board is a similar process in reverse. First you set the required value(s) in the control (for as many locations as you want to change), then you hit the control with a command to update the actual board.

There are many items of each type in the control's data base, corresponding to the numbers in the board. The way in which you select items is to first set the address (pointer) and then access the item. For example, to print the value of Input 5, you'd use the following VB code

SLCom1.InAddr = 5 'Select i/p 5

Debug.Print SLCom1.InValue 'Print it

One thing you need to be aware of is that it's not good to address items that don't exist in the particular board you are dealing with. When we first implemented SPLatLink we intended it only for use with programs we wrote ourselves, so we didn't put extensive bounds checking in the boards.

We cannot guarantee that early SPLatLink implementations won't crash the board if you access out of bounds. Be careful and test the limits!

Later implementations will be more solid.

The other possible gotcha is that the board types listed above as first generation, with firmware version 1.x, have no SPLatLink. These boards will in fact STOP if you send them any serial information whatsoever, even a stray character. This applies only to a relatively small number of older boards, and if you are working with known recently made boards you will not have that problem.

Previous Topic

Next Topic