7 Applied Instructions
7.20 Character String Control
637
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
Function and operation explanation
1. 16-bit operation (VAL/VALP)
1) A character string stored in the device specified by and later is converted into 16-bit binary data.
The number of all digits of the binary data acquired by conversion is stored in the device specified by
, the number of digits of the decimal part is stored in the device specified by + 1, and the
converted binary data is stored in the device specified by .
In conversion from a character string into binary data, the data from the device specified by to a
device number storing "00H" is handled as a character string in byte units.
For example, when a character string "-123.45" is specified in the device specified by and later, the
conversion result is stored in the devices specified by and as shown below.
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
Description
Number of all characters (digits) 2 to 8
Number of characters (digits) of decimal part 0 to 5 and smaller than "number of all digits - 3"
Numeric range when decimal point is ignored
-32768 to 32767
Example) "123.45" → "12345"
Character type
Sign
Positive numeric value "Space (20H)"
Negative numeric value "-(2DH)"
Decimal point ".(2EH)"
Number "0(30H)" to 9(39H)"
Label 1
*1
*1. This defines the head of the device that stores the character string to be converted into binary data.
VAL
EN ENO
d1
d2
s
Head device storing the binary data acquired by conversion.
Command
input
Label 2
*2
+0
Number of
all digits
Number of digits
of decimal part
-
Sign
+0
+1
b15
+2
+3
+4
b8 b7 b0
It indicates the end of character string.
Integer value in
which decimal
point is ignored.
+1
16-bit binary data
1st character
2nd character
7th character
ASCII code of 1st character
ASCII code of 3rd character
ASCII code of 5th character
ASCII code of 7th character
ASCII code indicating sign
ASCII code of 2nd character
ASCII code of 4th character
ASCII code of 6th character
00H
d1
d2
s
*2. This defines the head of the device that stores the number of digits of the binary data converted.
+0
7
2
- 1 2 3 4 5
+0
+1
b15
+2
+3
b8 b7 b0
It indicates the end of character string.
-12345
+1
31H(1)
33H(3)
34H(4)
00H
2DH(-)
32H(2)
2EH( )
35H(5)
d1
d2
s