Mitsubishi QD51 Programming Manual page 122

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

6 I/O Processing of Data Files
Don't forget to
enclose the
commas (,) with
double quotation
marks to be
written in the file.
Always use
CHR$(&H22) for
double quotation
marks. " " " cannot
be used.
6 - 4
The following shows the data when performing read or write operation into the
sequential file.
When handling character data
Example
A$ = "ABC"
B$ = "123"
C$= "@@@"
• PRINT # n, A$ ; B$ ; C$
In this case, ABC, 123, and @@@ have no separators, to the contents of the data file
will consider these to be one data.
In order to handle these as three separate data, commas (,) must be used as
separators.
• PRINT # n, A$ ; " , " ; B$ ; " , " ; C$
BASIC treats the commas as separators, so these are treated as three separate data.
Example
D$ = "@@@@, @@@@"
E$ = "@@@@@5-1-14"
• PRINT # n, D$ ; E$
In this case, the comma (,) in D$ will be treated as a separator, so the readout will be
treated as two separate data as shown below.
"@@@@"
"@@@@@@@@@5-1-14"
To separate the data as the same as the original data, double quotation marks (") will
be used as follows. Always use the CHR$ function when using double quotation
marks (").
• PRINT #n, CHR$(&H22) ; D$ ; CHR$(&H22) ; , " ; E$
@@ @ @ , @ @@@ @
"
@
BASIC will treat data surrounded in double quotation marks to be one data.
Therefore, it will be using the same separating method as D$ and E$.
@ @ @ @ @@ @@@ @ @ @ @@ @ 5 - 1 - 1 4 [CR] [LF]
@
"
@ @ @ @ @ 5 - 1 - 1 4 [CR] [LF]
@
MELSEC-Q
@ @ @
[CR] [LF]
A
B
C
1
2
3
Contents of data file
,
,
@ @ @
[CR] [LF]
A
B
C
1
2
3
Contents of data file
@
6 - 4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents