EasyManua.ls Logo

Mitsubishi Electric MELSEC iQ-R Series - Page 629

Mitsubishi Electric MELSEC iQ-R Series
2110 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
7 APPLICATION INSTRUCTIONS
7.6 Reading/Writing Data Instructions
627
7
The following table lists values to set in (s3)+1 and later and data to be written in a CSV file when "0140H: Floating point
real number (single-precision real number)" or "0141H: Floating point real number (double-precision real number)" is set to
(d1)+0.
The following shows how the file size (total number of bytes) is calculated when a CSV format file is written to the SD
memory card.
[Total number of bytes] = [Total number of bytes excluding the last row] + [Number of bytes of the last row]
([Number of bytes of each row] = [Number of columns
*1
] +1+ [total number of bytes of all data values per line]
*2
)
*1 The specified number of columns applies to rows other than the last row. The number of columns of the last row is calculated as shown
below because it may differ from the specified number of rows depending on the number of write data.
*2 The following shows how the number of bytes of each data value is calculated.
Precautions
Do not execute the SP.FWRITE instruction in interrupt programs. Doing so may cause malfunction of the module.
Operation error
When the SP.FWRITE instruction completes with an error, an error code is stored in the device specified by (d1)+1. (Note that
an error code is not stored if the instruction results in an operation error.)
For the error code stored in (d1)+1, refer to the following.
Page 593 Reading/Writing data in the specified file
Execution/completion type
((d1)+0)
Value to set in the write data
((s3)+1 and later)
Data to be written in a CSV file
0140H: Floating point real number
(single-precision real number)
Values within the range of: -2
128
< data -
2
-126
,
0,
2
-126
data < 2
128
A value (0 to 7 digits in the decimal part) as given on the left is written
in exponential format.
Values other than above 0 is written. (Data cannot be converted.)
0141H: Floating point real number
(double-precision real number)
Values within the range of: -2
1024
< data
-2
-1022
,
0,
2
-1022
data < 2
1024
A value (0 to 15 digits in the decimal part) as given on the left is written
in exponential format.
Values other than above 0 is written. (Data cannot be converted.)
The number of rows excluding the last row is calculated. (Number of rows excluding the last row = number of requested write datanumber of columns
(remainders rounded down)
The number of columns of the last row is calculated. (Number of columns of the last row = number of requested write data - (number of rows excluding the
last row number of columns))
Sign of data value Number of bytes of each data
value
Range of bytes Example
Positive Number of digits 1 to 5 (word specification)
1 to 3 (byte specification)
12345: 5 bytes
67: 2 bytes
Negative Number of digits + 1 2 to 6 (word specification)
2 to 4 (byte specification)
-12345: 6 bytes
-67: 3 bytes
Error code
(SD0)
Description
2820H The value in the device specified by (s3)+0 is out of the range (1 to 65535), or exceeds the setting area specified by (s3)+1 and later in the
device/label memory.
3405H The drive specified by (s1) is not the one for the SD memory card.
Any value that is set in the device specified by (d1) and later as control data is out of the range.
Page 617 For RnCPU (firmware version "28" or later) and RnENCPU (firmware version "28" or later)
Page 619 For RnCPU (firmware version "27" or earlier), RnENCPU (firmware version "27" or earlier), RnPCPU, and RnSFCPU
The file name character string specified by (s2) cannot be read.
The number of characters of the string in the file name specified exceeds the range.
An inhibited value is set.
Page 617 For RnCPU (firmware version "28" or later) and RnENCPU (firmware version "28" or later)
Page 619 For RnCPU (firmware version "27" or earlier), RnENCPU (firmware version "27" or earlier), RnPCPU, and RnSFCPU
3427H An invalid combination of (d1)+0 (Execution/completion type ) and (d1)+7 (Data type specification) is specified.
Page 617 For RnCPU (firmware version "28" or later) and RnENCPU (firmware version "28" or later)

Table of Contents

Other manuals for Mitsubishi Electric MELSEC iQ-R Series

Related product manuals