Please enable JavaScript to view this site.

Reads from a file present in flash a set of data, which is stored in consecutive real registers or in a specified real array.

It is like f_read_table(), but is checked for overflow from the specified buffer buff.

An additional difference is that it is not possible to start at any index of an array of reals or structures, but only at the beginning.

The function should be used only by passing correct parameters. It is not recommended to use it normally.

NOTE: If less data is read, the function fills the remainder with the last read.

Syntax

i32 f_read_table_s (string fileName, i32 nEntry, i32 nData, * buff [, i32 nRows=NULL])

fileName

Name of the file to read data from.

It must also contain the partition of the flash

nEntry

It is the number of entries in the table

nData

Number of data per entry (max 128), i.e., number of data for each line in the file. The line however can be a maximum of 256 characters long

buff

Must be a variable of one of the following types:

array of variables of type stru_cam

real register rr or nvrr, from which the cam data read from the file must be stored

local array of real variables in which the cam data read from the file is to be stored

array of structures that contain only real variables

nRows

Returns the number of valid lines read. (optional, default NULL) (from RTE 34.24.8)

Result

Returns:

Value

Description

> 0

One or more elements are missing. Returns the number of the row that is missing at least one element

0

Read OK

-1

Read OK. More data in the file

-2

Read OK. Less data in file than expected. Incorrect table

-10

File does not exist

-11

Number of data per line illegal

-12

Number of illegal entries

-14

Empty file

-15

Used nRows argument with RTE < 34.24.8 (alarm 9900 is generated)

Validity

Task

Note

If functions regarding compact flash management are used, it is recommended that bit 14 of the sys_cfg variable (0x00004000) be imposed to 1, to enable the use of safety routines for flash writing/reading

The data obtained will then be used in the rules for executing the mv_table() and mv_cam() functions.

The data contained within the file must respect the following:

maximum line size: 128 characters

maximum single item size: 18

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC