Download Print this page

Converting Hex Code Data To Ascii - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

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.
Ladder diagram
(s)
FBD/LD
EN
ENO
s
d
n
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Head device number storing hexadecimal code to be converted
(d)
Head device number storing converted ASCII code
(n)
Number of characters (digits) of hexadecimal code to be
converted
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
(n)
*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.
• 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:
SM400
X10
ASCI
(1): 16-bit mode
8 APPLICATION INSTRUCTION
444
8.8 Character String Operation Instruction
(d)
(n)
Word
T, ST, C, D, W,
U\G
SD, SW, R
*1
SM8161
D100
D200
K4
Structured text
ENO:=ASCI(EN,s,n,d);
ENO:=ASCIP(EN,s,n,d);
Range
Data type
16-bit signed binary
Character string
1 to 32767
16-bit unsigned binary
Bit
Bit
Double word Indirect
specification
Z
LC
LZ
Devices specified by (s) and later
(1)
(D100)=0ABCH
(D101)=1234H
(D102)=5678H
Data type (label)
ANY16
ANYSTRING_SINGLE
ANY16_U
BOOL
BOOL
Constant
Others
K, H
E
$

Hide quick links:

Advertisement

loading