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, 100 lines of the contents of INT array variable Dat[0..9,0..99] are stored in a file named 'ABC.csv'
in CSV file format. Each line contains ten text strings of numbers. Commas are inserted between them.
A CR+LF code is added to the end of the line. The procedure is as follows:
1
One element of Dat[] is converted to one text string and stored in the STRING variable Temp.
2
Except at the end of a line, a comma is added to the end of Temp. At the end of the line, a
CR+LF code is added to the end of Temp. These are joined in the STRING variable StrDat.
3
When the end of the line is reached, StrDat is written to the file.
4
Steps 1 to 3 are repeated for 100 lines.
INT array
16#1234
Dat[0,0]
Dat[0,1]
16#8487
.
.
.
.
.
.
.
Dat[0,99]
16#F596
STRING variable
2-1292
16#08B4
Dat[1,0]
Dat[1,1]
16#9256
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Dat[1,99]
16#A511
Converted to STRING data one at a time.
STRING variable
Temp 9256
Commas are added between text
strings, a CR code is added to the end,
and the results are joined.
StrDat
8487,9256
The line is written to the file when
the end of the line is reached.
'ABC.csv' file
1234,08B4,. . . . . 3966 CR
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
100 lines
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
16#3966
Dat[9,0]
Dat[9,1]
16#1211
.
.
.
.
.
.
.
16#22AB
Dat[9,99]
.
.
.
.
.
.
.
.

NY-series Instructions Reference Manual (W560)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents