Mitsubishi Electric MELSEC iQ-R Series User Manual page 151

C controller/c intelligent function module secs/gem communication software pre-installed model
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Conversion string format
The format is as follows: %[Flag][Field width].[Accuracy][h/l modification][Conversion string].
The following table indicates the details of each item.
■Flag
Flag
-
+
Blank
0
#
#0
#x, #X
#f
■Field Width
Field Width
Numerical value
■h/l Modification
h/l Modification
h
l
■Conversion String
Conversion String
%s
%d, %i
%u
%o
%x, %X
%f
Ex.
To send a control register value (binary value) in 5 digit (zero suppression) format, configure "%05d".
Precautions
To perform conversion in units of single characters, use %s. (%c cannot be used.)
Description
Outputs the conversion string justified to the right when the field width is specified.
Outputs the conversion string with a leading positive or negative (+/-) sign.
Outputs the conversion string with a leading space (single-byte space) for positive values, and aligns the conversion
string with a negative sign for negative values.
Fills areas corresponding to spaces with zeros for numerical output of a specified field width.
Adds a leading zero to octal data.
Adds a leading '0x' to hexadecimal data.
Always adds a zero to outputs.
Description
Specifies the output width.
Left pads with spaces when the number of significant digits is less than the specified width.
Ignores the width specification and outputs the significant digits of the data when the number of significant digits
specified is greater than the specified width.
Counts a decimal point as one place when the width is specified for a real number.
Description
Indicates that the corresponding argument is "short int" or "unsigned short int" when the conversion string is d, i, o, u,
x, or X.
Indicates that the corresponding argument is "long int" or "unsigned long int" when the conversion string is d, i, o, u, x,
or X.
Description
Outputs the string as a character string.
Outputs the string in decimal format.
Outputs the string in unsigned decimal format.
Outputs the string in octal format.
Outputs the string in hexadecimal format. x is output as lower case, and X is output as upper case.
Outputs the string as floating decimal point data in decimal format.
The conversion result always includes a decimal point. Applicable when numbers do not continue after the decimal
point as well.
Determines the number of significant digits after the decimal point according to the specified accuracy. (Default: 6
digits)
7 BASIC FUNCTIONS
7.15 Conversion Table Setting
7
149

Advertisement

Table of Contents
loading

Table of Contents