444
8 APPLICATION INSTRUCTION
8.8 Character String Operation Instruction
Converting HEX code data to ASCII
ASCI(P)
These instructions convert the (n) characters (digits) within the hexadecimal code data specified by (s) to ASCII, and store the
converted data in the device specified by (d) and later.
Setting data
■
Descriptions, ranges, and data types
■
Applicable devices
*1 T, ST, C cannot be used.
Processing details
• These instructions convert the (n) characters (digits) within the hexadecimal code data specified by (s) to ASCII, and store
the converted data in the device specified by (d) and later.
• The 16-bit mode and 8-bit mode options are available for the ASCI(P) instructions. For the operation in each mode, refer to
the proceeding pages.
Ladder diagram
Structured text
ENO:=ASCI(EN,s,n,d);
ENO:=ASCIP(EN,s,n,d);
FBD/LD
Operand
Description
Range
Data type
Data type (label)
(s)
Head device number storing hexadecimal code to be converted
16-bit signed binary
ANY16
(d)
Head device number storing converted ASCII code
Character string
ANYSTRING_SINGLE
(n)
Number of characters (digits) of hexadecimal code to be
converted
1 to 32767
16-bit unsigned binary
ANY16_U
EN
Execution condition
Bit
BOOL
ENO
Execution result
Bit
BOOL
Operand
Bit
Word
Double word Indirect
specification
Constant
Others
X, Y, M, L, SM,
F, B, SB, S
T, ST, C, D, W,
SD, SW, R
U
\G
Z
LC
LZ
K, H
E
$
(s)
(d)
(n)
• 16-bit conversion mode (while SM8161 is OFF)
Each digit of hexadecimal data stored in the device specified by (s) and later is converted into ASCII code, and transferred to the upper 8 bits and lower 8
bits of each device specified by (d) and later. SM8161 must always be off in the 16-bit conversion mode.
In the following program, conversion is executed as follows:
(1): 16-bit mode
Devices specified by (s) and later
(D100)=0ABCH
(D101)=1234H
(D102)=5678H
(s)
(d)
(n)
EN
ENO
s
d
n
ASCI
D100
SM8161
SM400
X10
D200
K4
(1)
Summary of Contents for MELSEC iQ-F FX5
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......