July 2013 8.5 Files 1411
Data transfer Valid for tables with the file name extensions .TAB, .P and .CDT:
If a freely definable table is transferred through a data interface, in the
externally saved file the structure definition is saved between the lines
#STRUCTBEGIN and #STRUCTEND. The contents of the table are after the line
#STRUCTEND.
Reading and editing
table fields in the
PLC
You can read and overwrite table fields in the PLC by using modules. You can
give the user access to parts of tables for editing.
Module 9245 Read a field from a table
This module is used to read data from any freely definable table. Module 9245
and the tableread function (PLC screen masks) can be used to read data,
including strings, from system tables like the tool table and pocket table (*.T
and *.TCH).
Open the desired table with the file name extension *.TAB, *.P, *.T or *.TCH
with Module 9240, and not in the buffered mode. If an error occurs, the result
is undefined.
The module provides the contents as a string.
Call:
PS D <File handle>
from Module 9240
PS B/W/D/K <Line>
0 to 65 535
PS B/W/D/K/S<String number, column name>
PS B/W/D/K/S<String number for the result>
CM 9245
Error code:
The following modules must be called in a submit job or spawn job.
When entering the column names, pay attention to the case of the letters
(whether they are small or capital).
Marker Value Meaning
M4203 0 Field was read
1 Error code in W1022
W1022 1 Line does not exist in table
2 Incorrect "file handle" or table was opened in "buffered"
mode
3 Impermissible string numbers
7 The table could not be read from
20 Module was not called in a spawn job or submit job
29 The opened file is not a valid table
30 Field name does not exist in table