Thursday, October 6, 2011

Reading and Writing from/to Data Tables the Vision PLC

This article explains how to utilize the message format binary to access the Data Tables of PLC. The format of binary allows data writes/read from/to the Data Tables. contacting Data Tables with format of ASCII is not supported.

Data Tables Memory structure
The first Data Table bytes are assigned first; the next table bytes exist in next to them in the memory and so on turn over the last Data Table. The each data of Data Table is row-oriented. This means that the first row data is assigned and after that the last row data and so on till the final row.

Setting parameters in the message format of binary
The format of binary allows contact to any Data Table portion. The recovered or sent data is in format of vectorial, even if the segments of data are not constant addresses in the memory. The following data should be implanted in the message of binary:
• The first element address to read (within the space of Data Table address).
• Rows number to read.
• Bytes number to interpret in each row.
• Bytes number in the whole row.

Write/Read from Data Table:
The value you set in byte 12 number settles on the control; 4=read, 68 =write (44 hex) within the message header. The first element address, to write into or to read from, have to be put as a value of 4 byte and set into bytes 14,15,16,17 of the message header, byte 14 is the least byte of significant.
The first element address has to be computed while the first element of the first table inhabits in address. The extra 3 parameters for example rows number to interpret, bytes number to read from a row, table row length should be set in the details message section .

Address and Purpose
0-1 Bytes of number to interpret form every table row.
2-3 Rows number of to interpret from Data Table.
4-7 Bytes number of in the Data Table whole row of the. A 4 byte representation
8-31 Value of Reserved 0
If the purpose of the request is to write data into the Data Table, then this data should start at the 32nd address. To calculate length, use the following table, which shows the number of bytes each Data Table column requires.

Read request definition
Assume two tables are defined in the PLC:
• 3 columns (integer, integer, 20 char string)
• 10 rows
• The 2nd column is identified as 'part of the project' and therefore does not live in the space of RAM.
• 3 columns, array of 4 bytes, integer, long, we want to interpret a portion of Table 2; 6 compartments from rows 4,5,6 and columns 1,2.
• 7 rows

Newer Post Older Post Home

You may also like these ebook:

Get Free PLC eBook directly sent to your email,
and email subscription to

We hate SPAM. Your information is never sold or shared with anyone.

Your Email Will Be 100% Secured !