7 Applied Instructions
7.20 Character String Control
639
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied
Instructions
8
Interrupt Function
and Pulse Catch
Function
A
Relationships
between devices
and addresses
2) Character string to be converted
a) Number of characters of character string and the numeric range when the decimal point is ignored.
b) Character types used in characters to be converted
3) The device specified by stores the number of all digits. The number of all digits indicates the number
of all characters (including the number, sign and decimal point).
4) The device specified by + 1 stores the number of digits of the decimal part. The number of digits of
the decimal part indicates the number of all characters after the decimal point "." (2EH).
5) The device specified by stores 32-bit binary data converted from a character string with the decimal
point ignored.
For the character string located in the device specified by and later, the "space" (20H) and "0" (30H)
characters between the sign and the first number other than "0" are ignored in the conversion to 32-bit
binary data.
Related instruction
Cautions
1) When handling array data or 32-bit data in a structured program, a 16-bit device cannot be specified
directly as in the case of a simple project. Use a label to handle array data or 32-bit data.
A 32-bit counter can be specified directly as it is a 32-bit long device.
Use a global label to specify a device.
2) The FX
3UC PLC of V. 2.20 or later supports this instruction.
3) Sign data "space (20H)" or "- (2DH)" must be stored in the first byte (lower order 8 bits of the head device
set in the device specified by ).
Only the ASCII code data "0 (30H)" to "9 (39H)", "space (20H)" and "decimal point (2EH)" can be stored
from the second byte to the "00H" at the end of the character string of the device specified by .
If "- (2DH)" is stored in the second byte or later, an operation error occurs (error code: K6706).
Description
Number of all characters (digits) 2 to 13
Number of characters (digits) of decimal part 0 to 10 and smaller than "number of all digits - 3"
Numeric range when decimal point is
ignored
-2,147,483,648 to 2,147,483,647
Example) "12345.678" to "12345678"
Character type
Sign
Positive numeric value "Space (20H)"
Negative numeric value "-(2DH)"
Decimal point ".(2EH)"
Number "0(30H)" to "9(39H)"
Instruction Description
DESTR Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.
DEVAL Converts a character string (ASCII codes) into binary floating point data.
STR Converts binary data into a character string (ASCII codes).
Sign
05
Number of all digits
Ignored
Number of digits
of decimal part
32-bit binary data
11
8
4213
54321
000
65
Number of all digits
Ignored
Number of digits
of decimal part
32-bit binary data
12
2
421- 3
-654321