SoftPLC
 
Font size:      

Usage

Ladder Instructions

Below is an example of a section of a ladder program using one of the SDI-12 TLIs. In this case, the TLI is queued as quickly as possible - the rung transitions to false on completion which resets the Control element, allowing a subsequent transition from false to true to queue the TLI command. The two rungs above that simply keep a count of successful or errored completions. The first rung is used to reset the Control and Counters on run mode transition from PROGRAM to RUN.

Other methods may be used to trigger the queueing of the TLI - the important detail is that the instruction queueing will only be triggered on the edge transition of the rung from false to true (and the instruction is not already queued or busy).

Example SDI12 TLI Ladder

SDICmdTool

SDICmdTool.py is a command-line administrative/testing utility included with the SDI12 TLM. It can be used for initial configuration/validation of a sensor as well as manual testing of functionality. It also supports the "Transparent Mode" described by the SDI-12 protocol specification, which allows manual entry of a command string (including extended/custom commands).

The utility is written in python and can be run after logging into the SoftPLC like so:

$ cd /home/root/SDI-12-CmdTool
$ python SDICmdTool.py

From there, the program has a help menu which lists the available commands and detailed text on each individual command.

simsensor

simsensor is a small utility program designed to (partially) simulate a SDI-12 sensor. It will respond only to measurement request commands (M, C, R) or data request commands (D) - for all commands the reply is a fixed value. When used as a simulator, this program is mainly useful for testing your use of TLIs in ladder (on another SoftPLC connected on the SDI-12 data line) against a known quantity.

Additionally, the program can be used as a SDI-12 network-wide listening utility. It prints out anything received to the console, regardless if the command or reply was directed at the simulator's sensor address.

Neither use of the program is exclusive of the other - you get both when you run the program, regardless. To start it:

$ cd /home/root/SDI-12-Sim
$ ./runsim address

Replace "address" with a valid SDI-12 sensor address that is NOT used by another sensor device/node in your system setup.