Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
Sample Programming
Here, multiple text strings that are separated by CR codes are stored in a file named 'ABC.csv.' All of
them are text strings of numbers. One line at a time is read from the file, the text strings are converted
to integers, and the results are stored in INT array variable InDat[]. Processing is ended when all of the
data to the end of the file is read.
It is assumed that this sample programming is in a periodic task.
'ABC.csv' file
1234 CR
9876 CR
5678 CR
. . . .
.
. . . .
.
. . . .
.
. . . .
.
. . . .
.
. . . .
.
EOF
The processing procedure is as follows:
1
The FileOpen instruction is used to open the file 'ABC.csv.'
2
The FileGets instruction is used to read one line from the file.
3
The STRING_TO_INT instruction is used to convert the text string that was read to an integer
and store it in InDat[].
4
Steps 2 and 3 are repeated until the EOF (end of file).
5
The FileClose instruction is used to close the file.
2-1284
One line read at a time and
converted to a number.
in_data[0] 1234
in_data[1]
in_data[2]
9876
5678
.
.
.
.
.
.
.

NY-series Instructions Reference Manual (W560)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents