Previous | Contents | Index |
The DAS for AB Data Highway Protocol supports the use of structured data. Structured data is a block of data, typically represented by a buffer, that can be broken down into meaningful elements of data. Structured data allows you to impose a structure on the data formats for any given read or write operation. A structure tells the device how to interpret the data that it is reading or writing.
For example, temperature and humidity data could be packed into a longword and a word in a buffer. The buffer is then said to contain structured data, with the longword representing temperature, and the word representing humidity.
For the DAS for AB Data Highway Protocol, all data types, except bit strings, are
supported for structured data when using PLC-2, PLC-3 or PLC-5 models.
When using SLC models all elements in a structure must be of the same
format.
3.2.4 Read and Write Data
Use the read data and write data functions to read data from and write data to a specific address in device storage. Address syntax is specific to each device or device family, and is similar to the syntax used with the Allen-Bradley T3, T4, or T50 programming terminals. The data type formats supported depend on the device.
Example 3-1 shows an example of the information displayed when you enter the READ DATA command.
Example 3-1 Read Data |
---|
DCM> read data ab_5/format=array[16]:bit/address="N7:00/00" Device: AB_5 Data starting at address N7:00/00 for ARRAY[16]:BIT element. Data: 0: 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
Example 3-2 shows an example of the information displayed when you enter the READ DATA command with structured data.
Example 3-2 READ DATA With Structured Data |
---|
DCM> read data ab_3/addr=I300/form="struct(word,word,word) Device : AB_3 Address : I300 Format : STRUCTURE(S_WORD,S_WORD,S_WORD) Data: 0 : 1 1 : 2 2 : 3 |
Example 3-3 shows an example of the information displayed when you enter the WRITE DATA command.
Example 3-3 WRITE DATA |
---|
DCM> write data ab_5/format=word/address=N7:00 Data Value 1 : 3 |
Example 3-4 shows an example of the information displayed when you enter the WRITE DATA command with structured data.
Example 3-4 WRITE DATA with Structured Data |
---|
DCM> WRITE DATA AB_3/addr=I300/form="struct(word,word,word) Device : AB_3 Address : I300 Format : STRUCTURE(S_WORD,S_WORD,S_WORD) Data value 0 : 0 Data value 1 : 0 Data value 2 : 0 |
The following sections describe the use of the read data and write data
functions by specific devices, including addressing and data type
formats.
3.2.4.1 PLC-1774
Addressing and data type formats are necessary for performing the read data and write data functions for the PLC-1774 device.
Legal address formats for the PLC-1774 are:
www
wwww
wwwbb
where:
www = 0-777 octal word address
wwww = 0-1777 octal word address
www = 0-377 octal word
bb = 0-17 octal bit
The following examples are legal addresses for the PLC-1774:
400 (word 400) 1600 (word 1600) 36610 (word 366, bit 10) |
Legal data type formats for the PLC-1774 are bit, word, unsigned word,
byte, unsigned byte, and packed decimal. Reading data from the device
into the format of word, unsigned word, or packed decimal eliminates
the status bits that are present in the internal binary coded decimal
format of the device. Writing data to the device from the format of
word, unsigned word, or packed decimal is limited to 0-999, and the
resulting status bits are cleared.
3.2.4.2 PLC-2
Addressing and data type formats are necessary for performing the read data and write data functions for the PLC-2 family of devices.
The address format for the PLC-2 family is:
wwwww/bb
where:
wwwww = 0-17777 octal word address
bb = 0-17 octal bit (optional)
The maximum allowable word address differs for each member of the PLC-2 family.
The following examples are legal addresses for the PLC-2:
20 (word 20) 372/00 (word 372, bit 00) 17777/17 (word 17777, bit 17) |
Legal data type formats for the PLC-2 family are bit, word, unsigned
word, byte, unsigned byte, and packed decimal. Reading data from the
device into the format of word, unsigned word, or packed decimal
eliminates the status bits that are present in the internal BCD format
of the device. Data to be written to the device from the format of
word, unsigned word, or packed decimal is limited to 0-999, and the
resulting status bits are cleared.
3.2.4.3 PLC-3
Addressing and data type formats are necessary for performing the read data and write data functions for the PLC-3 family of devices.
There are two types of addressing for PLC-3 devices: extended addressing and data table addressing. Extended addressing has the general format:
E.M.S.S.S.S.W/B
where:
E is the extended address indicator
M is the major area number
S is the subarea designation
W is the word address
B is the bit address
There can be as little as two subarea designations and a maximum of four, depending on which major area is being addressed.
Data table addressing simplifies the addressing of the data table, and generally has the format:
ASF:W/B
where:
A is the basic structure: W for word (default), F for file
S is the section of the data table: O, I, T, C, N, F, D, B, A, H, P, S
F is the file number: 0 - 999 (default is the file 0)
W is the word number within the file: 0 - 999; 0 - 7777 octal for I/O
B is the bit: 0 - 17 octal within word; 0 - 9999 within file
You can access data within each data table section at file, word, or bit levels.
Bit numbers are octal for addresses having word structures and decimal for addresses having file structures. For example, you can address the same bit as WN2:4/10, FN2:4/8, or FN2:0/72. In the first address (WN2:4/10), W indicates word structure for integer section data stored in file 2, word 4, bit 10 (octal). The last two addresses (FN2:4/8 and FN:0/72) use file addressing. In these examples, F indicates file structure. To locate the bit with the address FN2:4/8, the processor counts 8 bits in integer file 2 starting with word 4, bit 0. With the address FN2:0/72, the processor counts 72 bits in integer file 2 starting with word 0, bit 0.
Certain data table sections may be addressed differently; refer to the PLC-3 Programmable Controller Programming Manual for details.
The following examples are legal addresses for the PLC-3:
I370 (input section, rack 37, module 0) FN2:738/17 (integers section, file 2, word 738, bit 17) TACC9990 (timers section, accumulator word, structure 9990) E3.1.9.0.0.1010 (ASCII section (9), word 1010) E3.1.4.0.13.2/7 (counters section (4), structure 13, word 2, bit 7) |
Table 3-6 shows the supported data type formats for reading from and writing to the various data table sections of the PLC-3.
Data Type Formats | |||||||
---|---|---|---|---|---|---|---|
PLC-3 Data Section | Bit | Word | Unsigned Word | Byte | Unsigned Byte | Floating Point | Longword |
Output | X | X | X | X | X | ||
Input | X | X | X | X | X | ||
Timers | X | X | X | X | X | ||
Counters | X | X | X | X | X | ||
Integers | X | X | X | X | X | ||
Floating Point | X | X | X | X | |||
Decimal | X | X | X | X | X | ||
Binary | X | X | X | X | X | ||
ASCII | X | X | X | ||||
High Order Ints | X | X | X | X | |||
Pointers | X | X | X | X | X | X | |
Status | X | X | X | X | X |
Previous | Next | Contents | Index |