SLC 500 Data Tables


Introduction to SLC 500 Data Tables

SLC 500 Data Tables store values. You can think of data tables as “Data Registers” or “Variables”. In a default project, 9 standard data tables are created automatically. Each of these data tables can generally store up to 255 elements. We will discuss the purpose of each of the following data tables, and examples of instructions that typically utilize these files. Although some data files can be used interchangeably, I will discuss the most common use of these files.

For the following examples, our I/O Configuration is set up as follows:

O0 — Output Data File

The output data file stores the outputs that we want to write to the output modules (aside from forces). Toward the end of the processor scan, the output data table is sent to the output modules to energize or de-energize outputs. The processor will also write values to the analog output modules.

An example of an instruction that uses the output data table is the OTE (Output To Energize Instruction).

I1 — Input Data File

The input data files shows the status of the inputs that are connected to the input module (aside from forces). Inputs are read during the first part of the processor scan cycle.

An example of an instruction that utilizes the input tags is the XIC (Examine if Closed) instruction.

S2 — Processor Status

The S2 Data file stores the processor status. This includes the time of day, I/O fault conditions, and a battery low bit. Other examples are the status of forces, math overflow, etc.

B3 — Binary File

Think of the B3 file as “Internal Coils”. When a certain condition is met, such as “Guard Doors Closed”, a bit is set. The programmer declares what each bit is used for. This bit can then be used through out the project, anytime we need to know if all doors are closed, or if a door is open.

T4 — Timer File

The timer file is used with the timer instructions, such as TON, RTO, and TOF. Each element of the timer file contains an EN (Enable Bit), TT (Timer Timing bit), and DN (Done bit). Each element also stores the PRE (preset) and ACC (Accumulated value).

Here is an example of how a timer might be used in logic.

C5 — Counter Table

The Counter file is used with counter instructions such as the CTU (Count Up) and CTD (Count Down). Each element of the counter file contains the following members:

  • CU — This is the “enable” bit for the CTU instruction.
  • CD — This is the “enable” bit for the CTD instruction.
  • OV — This is the overflow bit, and is set when the counter exceeds 32767. This is the maximum value for a 16 bit signed integer.
  • UN — This is the underflow bit, and is set when the counter drops below -32768.
  • UA — Update Accumulator. This is used for High Speed Counter of a fixed SLC unit.
  • PRE — This is the counter’s preset.
  • ACC — The counter’s accumulated value.

Here is an example of how a counter might be used in logic:

C6 — Control File

The C6 data file is a generic table that used with several advanced instructions. This includes sequencers and other file instructions that need to keep track of position, and the length of the file being operated on. The C6 file contains the following members:

  • EN — Enable bit
  • EU — Enable Unload bit
  • EM — Empty Bit
  • ER — Error Bit
  • UL — Unload bit
  • IN — Inhibit bit
  • FD — Found bit
  • LEN — This is the length of the file being operated on.
  • POS — This is the instruction’s current position within a file.

N7 — Integer File

The integer file is typically used to store numbers, such as the scaled value of an analog input. The values can range from -32768 to 32767. These are 16 bit signed integers.

F8 — Floating Point File

When more precision is required than what the integer file can provide, the F8 file can be used. The F8 file uses more memory (32 bits per element), but allows for decimal points in numbers. It’s also useful when working with very large or very small numbers.

On the B3 and higher data files, you can go to the properties to adjust the number of elements in the table. However, if you are offline, and declare a valid data table address of an existing table, RSLogix will automatically expand the data table to include the new elements that you are using in logic.

The “Usage” button is a very good tool to find out what addresses are already used in the project. This helps you to see what addresses are available for future use.

Also, the RADIX selector is a good tool for changing the numbering base of the table between Binary, Decimal, Octal, and Hexadecimal.

— Ricky Bryce

Leave a comment

Your email address will not be published. Required fields are marked *

+ 53 = sixty one