Reading a freely definable table with FN 28: TABREAD

Application

With the FN 28: TABREAD NC function, you can read data from the table previously opened with FN 26: TABOPEN.

Description of function

Use the FN 28 NC function to define the table columns that the control is to read from. Within an NC block, you can specify multiple table columns, but only one table row.

Input

11 FN 28: TABREAD Q1 = 2 / "Length"

; Read table with FN 28

To navigate to this function:

Insert NC function All functions FN Special functions FN 28 TABREAD

The NC function includes the following syntax elements:

Syntax element

Meaning

FN 28: TABREAD

Start of syntax for reading from a table

Q, QL, QR, or QS

Variable for the source text

The control uses this variable to save the contents from the table cells to be read.

Number

Row number in the table to be read

Fixed or variable number

Name or QS

Column name in the table to be read

Fixed or variable name

Use commas to separate multiple column names.

Note

If you specify multiple columns in an NC block, the control saves the read values in consecutive variables of the same type (e.g., QL1, QL2, and QL3).

Example

11 FN 28: TABREAD Q10 = 6/“X,Y,D“

; Read numeric values from columns X, Y and D

12 FN 28: TABREAD QS1 = 6/“DOC“

; Read the alphanumeric value from the DOC column

The control reads the values of columns X, Y, and D from row 6 of the currently open table. The control saves the values to the Q parameters Q10, Q11, and Q12.

The content from the DOC column of the same row is saved to the QS1 QS parameter.