Download Print this page

Converting Character String To 16-Bit Binary Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

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

Advertisement

Converting character string to 16-bit binary data

VAL(P)(_U)
These instructions convert the character string in the device numbers specified by (s) and later to 16-bit binary data, and store
the number of digits in the device specified by (d1) and the binary data in the device specified by (d2).
Ladder diagram
(s)
FBD/LD
EN
ENO
s
d1
d2
Setting data
■Descriptions, ranges, and data types
Operand
(s)
(d1)
VAL(P)
VAL(P)_U
(d2)
VAL(P)
VAL(P)_U
EN
ENO
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d1)
(d2)
*1 T, ST, C cannot be used.
Processing details
• These instructions convert the character string in the device numbers specified by (s) and later to 16-bit binary data, and
store the number of digits in the device specified by (d1) and the binary data in the device specified by (d2). When
converting a character string into binary data, the data from the device number specified by (s) to a device number storing
"00H" is handled as a character string.
7 BASIC INSTRUCTIONS
318
7.5 Data Conversion Instructions
(d1) (d2)
Description
Character string to be converted to binary data,
or head device for storing the character string.
Head device for storing the number of digits of
the binary data after conversion
Head device for storing the binary data after
conversion
Execution condition
Execution result
Word
T, ST, C, D, W,
SD, SW, R
*1
Structured text
ENO:=VAL(EN,s,d1,d2);
ENO:=VALP(EN,s,d1,d2);
Range
Double word Indirect
U\G
Z
LC
ENO:=VAL_U(EN,s,d1,d2);
ENO:=VALP_U(EN,s,d1,d2);
Data type
Character string
16-bit signed binary
16-bit unsigned binary
16-bit signed binary
16-bit unsigned binary
Bit
Bit
Constant
specification
LZ
K, H
Data type (label)
ANYSTRING_SINGLE
ANY16_S_ARRAY
(Number of elements:
2)
ANY16_U_ARRAY
(Number of elements:
2)
ANY16_S
ANY16_U
BOOL
BOOL
Others
E
$

Hide quick links:

Advertisement

loading