Converting String Type To Bcd Type - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Converting string type to BCD type

STR_TO_BCD(_E)
High
Basic
Process
Redundant Universal
performance
Structured ladder/FBD
STR_TO_BCD_E
EN
ENO
s
d
The following function(s) can go in the dotted squares.
STR_TO_BCD, STR_TO_BCD_E
■Argument
Input/output
Name
argument
Input argument
EN
s(_STRING)
Output argument
ENO
d
Processing details
■Operation processing
• When word (unsigned)/16-bit string type is specified for output argument.
Converts string type 4-character-string data input to (s) into BCD type data, and outputs the operation result from (d).
s
'9999'
String type
When '20H' (space) exists in the character string, the conversion is executed ignoring '20H'.
'20H' (space) and '30H' (0) in the character string are counted as one character.
The value to be input to (s) is string type data within the following range.
ASCII code: '30H' to '39H', '20H', and '00H'
When input character string has less than 4 letters, convert it with 4 letters supplementing with 0 to the end of the character
string. Therefore, when converting character string ("0001" for "1") with less than 4 letters to BCD data, input the zero padding
character strings.
When the character string has more than 4 letters, the conversion target is the forth character from the left of the character
string data.
Entered character string
"1"
"12"
"123"
"1234"
"12345"
LCPU
ST
ENO:=
(EN, s, d);
STR_TO_BCD_E
Description
Executing condition (TRUE: Execution, FALSE:
Stop)
Input
Execution result (TRUE: Normal, FALSE: Error)
Output
d
9999
H
Word (unsigned)/16-bit string type
Converted character string
"1000"
"1200"
"1230"
"1234"
"1234"
Data type
Bit
String (8)
Bit
ANY_BIT
Output (BCD type)
1000H(4096)
1200H(4608)
1230H(4656)
1230H(4656)
1230H(4656)
5 APPLICATION FUNCTIONS
5.1 Type Conversion Functions
5
93

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents