AB KTx RIO TLM
  SoftPLC    Font size:      

Driver Configuration

On version 3.x SoftPLC, the driver exists entirely within the TLM. But on version 4.x SoftPLC, the driver code is split between a Linux kernel driver and the TLM. Therefore, there is an extra step required when using version 4.x that is not required for version 3.x SoftPLC. Instructions on how to enable the Linux kernel driver follow. If you are using version 3.x SoftPLC, you can skip ahead to the next section, Enabling the TLM.

Enabling the TLM

To make the driver available to SoftPLC, you have to enable it through the Module tab within the PLC Configuration Editor in TOPDOC NexGen:


Module Editor

Click the Fetch button to load the existing configuration from the attached SoftPLC. Then find the KTX.TLM driver from the list under Name, select the Use checkbox. Then click on Send. This will tell the SoftPLC to use the TLM after its next power cycle. But before power cycling the SoftPLC, you will edit the TLM's configuration file.

To edit the configuration file, click on Configure, and the following editor comes up. From here you can Fetch, Send, Save, or Load the configuration file.


Text File Editor

Click the Fetch button to retrieve the configuration file from the SoftPLC, or Load if you already have it saved from before.

Make the necessary edits to map your specific I/O, as described within this chapter.

Then Save to store the edited file on your local drive, and Send to download the new configuration to your SoftPLC.

Before power cycling SoftPLC, you should make sure your I/O racks are powered up. The TLM will not be fully function unless the racks are powered up and the cabling is intact. You can now power up SoftPLC and watch the syslog for version 4.x, or the console for version 3.x SoftPLC.

Configuration File Format

This section describes the format of the ASCII text configuration file used by the driver. There are a number of regions or sections within the file, each identified by a keyword surrounded by square brackets:

  • [DRIVER]
  • [CARDS]
  • [INPUTS]
  • [OUTPUTS]

Sample Configuration File

;Configuration file for KTX.TLM.

;Any part of any line in this text file to the right of a semicolon is a
;comment and will be ignored by the TLM.

;There are 4 sections in this file: [DRIVER], [CARDS], [INPUTS],
;and [OUTPUTS].

;[DRIVER] is a place for global parameters, and is not used yet.

;[CARDS] lists each KTx card in the system on a separate line.
; There are columns for physical ADDRESS, IRQ, BAUDRATE, and WATCHDOG.
; BAUDRATE as one of 57, 115, or 230 kbaud, and the WATCHDOG timeout
; value in msecs.  Each card gets an implied CARDNUMBER based on
; the order of presentation, the first being card 0.
; The ADDRESS is different depending on whether the card is an ISA
; or PCI card.  If ISA, then the 20 bit physical address is given,
; e.g. "D8000".  If PCI, then "PCI" is given because the pci bios
; will assign the card its physical ADDRESS.  The IRQ is likewise
; different depending on whether the card is an ISA or PCI card.
; For ISA use the irq number according to the jumper, for PCI cards,
; use "PCI" because the pci bios will assign the IRQ.

;[INPUTS] lists blocks of words that are to be copied from each
;card into the SoftPLC input image table as part of the I/O scan.
;Only I:xxx type addresses may be used here.  UseableAddr is the
;memory address within SoftPLC.  PhysicalAddr is the address that
;is determined by the physical rack and slot used in the field.
;Each row in this section describes a block whose length is
;given by NumWords.  A block may be as long as you like, and
;sometimes you will have only one block, other times you might
;have over one hundred.  This scheme lets you map any PhysicalAddr
;to any real input UseableAddr.

;[OUTPUTS] lists blocks of words that are to be copied from
;SoftPLC's output image table onto a card as part of the I/O scan.
;Only O:xxx type addresses may be used here.  UseableAddr is the
;memory address within SoftPLC.  PhysicalAddr is the address that
;is determined by the physical rack and slot used in the field.
;Each row in this section describes a block whose length is
;given by NumWords.  A block may be as long as you like, and
;sometimes you will have only one block, other times you might
;have over one hundred.  This scheme lets you map any UseableAddr
;to any one or more PhysicalAddr's.  The same UseableAddr may
;be mapped to more than one output PhysicalAddr.


;A "word" corresponds to a module group, and this is the granularity
;given by this configuration strategy.
;Unlike AB PLC's, with this SoftPLC KTX driver, both the I:ABC and O:ABC
;at a given ABC UseableAddr element may both be used simultaneously.



[DRIVER]
; not used yet.


[CARDS]
;ADDRESS    IRQ     BAUDRATE    WATCHDOG    CARDNUMBER
PCI,        PCI,    57,         500         ;0
;d6000,     10,     115,        500         ;1
;d5000,     14,     230,        500         ;2



[INPUTS]
;UseableAddr,   NumWords,   CardNumber, PhysicalAddr
I:000           256         0           I:000
;I:400          256         1           I:000

[OUTPUTS]
;UseableAddr,   NumWords,   CardNumber, PhysicalAddr
O:000           256         0           O:000
;O:400          256         1           O:000


;EOF

[DRIVER]

This section is for future possible global driver information and is currently not used.

[CARDS]

There may be up to 8 cards, with each card listed on its own row. A "card" is a RIO channel, and may be one of two on a KTXD card, or may be the only RIO channel on a KTS or KTX card. In this section you list for each "card":


Note
As of this writing, only the version of this driver for 4.x SoftPLC supports PCI cards. The 3.x version supports only ISA cards, and the 4.x version supports both ISA and PCI cards. Bear this in mind when interpreting the following table.
Column NameDescription
ADDRESS For a PCI card: simply "PCI". For an ISA card: the base physical memory address is given in 20 bit address form. This is a 5 digit hex number. For example D000:0000 would be given as D0000. D000:8000 would be given as "D8000".
IRQ For a PCI card: simply "PCI". For an ISA card: this is the unique IRQ jumper position chosen on this RIO channel. Legal values are 3 through 15 decimal. The IRQ must match the setting on the KTx for this card. For version 4.x SoftPLC, the IRQ may be shared by other devices, but not if using version 3.x SoftPLC. See Allen-Bradley's KTx manual for potential conflicts. Recommended values are 5, 10, or 11.
BAUDRATE Provides the baudrate as one of 57, 115, or 230, meaning 57.6 kbaud, 115.2 kbaud, or 230.4 kbaud respectively.
WATCHDOG Provides the watchdog timer setting for the card in msecs. If the card does not hear from SoftPLC within this interval, the card will shutdown all outputs. Use zero (0) to disable the watchdog function. A normal value is something like 3-4 times your largest anticipated program scan time. Most applications can live with 500 milliseconds. If you set it too close to the scan time, then you may get extraneous watchdog timeouts triggered by the KTX.

[INPUTS] and [OUTPUTS]

SoftPLC's Input Image table consists of a block of 16 bit words, with a maximum block size being either 8, 64, 128, or 512 16-bit words, depending on whether you have the 128, 1K, 2K, or 8K kernel respectively. There is an equal sized table for the Output Image. These I/O image tables support I/O forcing. I/O forcing is very useful for digital inputs and digital outputs.

Normally analog data is handled differently than digital data in this driver, it uses Block transfer and analog or smart module data is not confined to the I/O image tables. (The exception is SLC-500 I/O which gives you the option of avoiding block transfer altogether.) Although block transfer is supported by this driver, it is an unfortunate burden that other drivers do not bear, and is best understood by consulting the Allen-Bradley documentation. It is not discussed here because SoftPLC is compatible with a PLC-5 in this regard.

The rows in this section of KTX.LST each define a different kind of block, and are not related to block transfer ladder instructions used to transfer smart module data.

Note
When programming block transfer instructions, you should use the RackGroupSlot values as they relate to the UseableAddr fields, not PhysicalAddr fields.

Here is how to set up blocks for non-smart module data, i.e. discrete data. You may have rows in the file that are commented out with a semi-colon.

Column NameDescription
UseableAddrThis is the starting memory address within SoftPLC that will be used for a block of contiguous words. It must be I:nnn or O:nnn for INPUTS and OUTPUTS respectively, where <nnn> is the word element with in the SoftPLC datatable. Note that INPUTS must go into the I: section and OUTPUTS must go into the O: section of the datatable with this driver.
NumWordsThis gives the number of words that are to be transferred as part of this block. The range can be from 1 to 256 inclusive, but must not cause the block to extend beyond the end of the image table, given the starting address in UseableAddr.
CardIndexThis is simply the 0 based index into the list of [CARDS]. The first card given in the [CARDS] section has a CardIndex of 0. The next has 1, etc.
PhysicalAddrThis is the address that is determined by the physical rack and slot used in the field as if you had a PLC-5 hooked up to the remote I/O network.

Here is an example [INPUTS] section:

[INPUTS]
;UseableAddr, NumWords, CardNumber, PhysicalAddr
I:000         256       0           I:000
I:400         256       1           I:000

When deciphering the I:nnn or O:nnn notation, you can think of breaking the <nnn> down into 2 fields: RRG, where RR is 2 digits for a Rack number and G is one digit for a module Group number. So I:123 means physical rack 12 and group 3. These digits are always in octal (according to Allen-Bradley PLC-5). A module group maps to a single word within the PLC.

On any given RIO blue hose segment attached to a KTx RIO channel, the highest allowed rack number may be octal 37, so this means a maximum PhysicalAddr of O:377 and I:377. Not so in SoftPLC, where the highest allowed rack number is octal 77 in the 8K SoftPLC, so UseableAddr?s can go up to O:777 and I:777. Therefore, to support the higher numbered racks in the 8K SoftPLC, we must be able to conceptually map a physical rack to a higher UseableAddr. Notice the 2nd row in the above example, which moves what is a rack with physical adapter switch settings at 00 to a UseableAddr designating rack 40 octal. All the racks on the 2nd KTx RIO channel/card have been offset to a higher UseableAddr.

In reality, with SoftPLC you have the flexibility of letting go of the strict hardware to logical mapping that an AB PLC-5 restricts you to. You can map any module group to an input image table word, so this means you can write a program without regard for the actual final addresses. It also means you can use both I:xyz and O:xyz at the same time for any given xyz. This is what AB calls complementary I/O, but SoftPLC?s scheme is much more flexible because each UseableAddr can come from a different KTx card and rack.

Others who value the relationship between physical rack topology and UseableAddr mapping that AB PLC?s limit you to, will want to stick with that scheme. This is merely a matter of defining fewer larger blocks in the [INPUTS] and [OUTPUTS] section.

Either technique works.

All the Physical Racks on any particular KTx I/O channel must be uniquely numbered. However, the same Physical Rack (number!) may be present on more than one I/O channel.

Any UseableAddr?s not referenced as part of a block in KTX.LST, are not touched by the KTx driver and may be used by other I/O drivers within SoftPLC.

The SoftPLC KTx driver, KTX.TLM, loads several files at startup. All these files are part of the normal SoftPLC installation and must be in the same directory as the KTX.TLM file:

  • KTX.LST
  • ONEKTX0.BIN
  • ONEKTX1.BIN
  • ONEKTX2.BIN