# BASEstartm Classic DAS
for Allen-Bradley
INTERCHANGEtm Software
Installation and User's Guide

Previous | Contents | Index

# 3.3 Supported Data Types

The following data types are supported by the DAS for AB INTERCHANGE software:

- BIT
- ARRAY[]:BIT
- S_BYTE
- U_BYTE
- S_WORD
- U_WORD
- S_LONGWORD
- U_LONGWORD
- F_FLOATING
- STRING
- ARRAY

## 3.3.1 Structured Data

Not all available data formats will work in a format of STRUCTURE. Table 3-13 lists the supported formats for structured data. See Section 3.3.2 for more restrictions on data formats.

Table 3-13 Data Formats Supported for Structured Data
Format | Restrictions
--- | ---
BIT | When writing, the use of the BIT or BOOLEAN format in structures must be in contiguous multiples of eight (8). The length of the structure containing a bit field must be an even number of target elements.
ARRAY[n]:BIT | When writing, the array size must be a multiple of 16 for PLC-5, PLC-3, PLC-2 and SLC family devices. The array size must be less than or equal to 16 for the PLC-5/250.
S_BYTE | The size must be an even multiple of 2 bytes or characters.
U_BYTE | The size must be an even multiple of 2 bytes or characters.
U_WORD |
S_WORD |
U_LONGWORD |
S_LONGWORD |
F_FLOAT |
STRING:n | The size must be an even multiple of 2 bytes or characters.
ARRAY[n]: | The size of the array must be an even multiple of the target PLC data type. For example: ARRAY[3]:S_WORD for a Longword target would not be valid. The forth word would have to be padded out by making the array size 4 or adding other members to a structure.

## 3.3.2 Restrictions to Data Formats

This section describes restrictions and limitations to data format usage.

- BIT --- For all families except the PLC-5/250, the only data formats which are valid for bit writes are single bits or bit arrays with sizes that match that of the target element. For example the only valid formats for writing to a PLC-5 binary file would be:

  > /FORM=BIT/NUMBER=1
  > /FORM=BIT/NUMBER=16
  > /FORM=ARRAY[16]:BIT

  The use of the BIT format in structures must be in contiguous multiples of eight (8). A field can contain less than 8 bits as long as there is another bit field (or bit fields) contiguous to it that makes the total 8 bits. For writes, The length of the structure must be an even number of target elements. For reads, the last field in a structure can contain less than 8 bits, or if all fields in the structure or BIT format, than the fields can contain an arbitrary number of bits.
  Bit writes greater than 1 but less than 16 bits are allowed for PI (PLC-5/250) devices.
  Bit writes cannot span element boundaries, unless the bit array is an even multiple of the element size.
- BYTE --- Allen-Bradley PLCs are word-oriented devices. The byte formats are only valid in the context of a structure.
  The byte formats may be used on any file type; the restriction is that the number of bytes used in the format must be a multiple of the PLC data element being accessed. Normally this is two for integer and binary files and Longword files are four. Other structured PLC elements such as timers and counters vary. Refer to the Allen-Bradley documentation for more information.
- STRING --- The BASEstar Classic STRING data type may be used for any PLC file type with the following restrictions:
  - When used within a STRUCTURE, the length must be a multiple of two characters
  - When used to access string section files (ST) on PLC-5/250, PLC-5 or SLC family devices, the maximum length of the string is 82 bytes.
  - When accessing string section files, lengths smaller than 82 may be used. However an error is returned if the actual length of a string on the PLC is longer that specified in the STRING format.
  - The DAS for AB INTERCHANGE software expects the bytes to be in Allen-Bradley byte swapped order.
- F_FLOATING --- The BASEstar Classic data type F_FLOATING may be used on PLC floating point files with no restrictions. There are, however, some behaviors with the BASEstar Classic F_FLOATING format and PLC floating point files that should be taken into consideration.
  When using the F_FLOATING format on PLC files other than floating, the value is converted to and from an integer, thereby truncating the fractional part. For example: writing the value of 1.324E+2 to an integer address using the F_FLOATING format results in the integer value of 132 being placed at the address. Reading it back, using the same format, results in 1.320E+2 being returned.
  When using the F_FLOATING format within a STRUCTURE data type, the DAS for AB INTERCHANGE software assumes the data on the PLC is formatted in the IEEE floating format. If this is not the case, data could be incorrectly converted when reading or writing.
- STRUCTURE --- No data conversion takes place by the INTERCHANGE software when data is defined using a structure format. Fields in the structure defined as floating point are still converted, but all other fields are transferred as is. Therefore reading data as "STRUCTURE(ARRAY[2]:LONG)" in the integer file, for example, will result in a different result than reading data as "ARRAY[2]:LONG". In the first case, four words of data are transferred. In the second case, only two words of data are transferred.

Previous | Next | Contents | Index