Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 629

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

• 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.
Execution/completion type
((d1)+0)
0140H: Floating point real number
(single-precision real number)
0141H: Floating point real number
(double-precision real number)
• 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 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.
• The number of rows excluding the last row is calculated. (Number of rows excluding the last row = number of requested write datanumber 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))
*2 The following shows how the number of bytes of each data value is calculated.
Sign of data value
Positive
Negative
Precautions
• Do not execute the SP.FWRITE instruction in interrupt programs. Doing so may cause malfunction of the module.
Operation error
Error code
Description
(SD0)
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)
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
Value to set in the write data
((s3)+1 and later)
Values within the range of: -2
-126
2
,
0,
-126
128
data < 2
2
Values other than above
Values within the range of: -2
-1022
-2
,
0,
-1022
1024
data < 2
2
Values other than above
*1
] +1+ [total number of bytes of all data values per line]
Number of bytes of each data
value
Number of digits
Number of digits + 1
Data to be written in a CSV file
128
< data  -
A value (0 to 7 digits in the decimal part) as given on the left is written
in exponential format.
0 is written. (Data cannot be converted.)
1024
< data 
A value (0 to 15 digits in the decimal part) as given on the left is written
in exponential format.
0 is written. (Data cannot be converted.)
Range of bytes
1 to 5 (word specification)
1 to 3 (byte specification)
2 to 6 (word specification)
2 to 4 (byte specification)
7.6 Reading/Writing Data Instructions
*2
)
Example
• 12345: 5 bytes
• 67: 2 bytes
• -12345: 6 bytes
• -67: 3 bytes
7 APPLICATION INSTRUCTIONS
7
627

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents