Htob (Hex To Bcd) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

10: D
C
ATA
Introduction
This chapter describes the data conversion instructions that convert data to the specified format.
The ENCO (encode), DECO (decode), and BCNT (bit count) instructions processes bit device data.
The ALT (alternate output) instruction turns an output on and off each time an input button is pressed.
The CVDT (convert data) instruction converts data types among W (word), I (integer), D (double word), L (long), and F (float).
The DTDV and DTCB instructions convert data between two one-byte data and one word data. The SWAP exchanges upper and
lower byte- or word-data for word- or double-word-data respectively.

HTOB (Hex to BCD)

HTOB(*)
*****
Valid Devices
Device
S1 (Source 1)
D1 (Destination 1)
For valid device address ranges, see "Device Addresses" on page 2-1.
Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) which can be 0 through 65,535.
When the data type is W (word), the valid range of S1 (binary data) is 0 to 9,999.
When the data type is D (double word), the valid range of S1 (binary data) is 0 to 99,999,999.
Make sure that the source designated by S1 is within the valid value range. If the source data exceeds the valid range, a user program execution
error will result, turning on special internal relay M8004 and the ERR LED on the FC6A Series MICROSmart.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.
Since the HTOB instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Valid Data Types
W (word)
X
I (integer)
D (double word)
X
L (long)
F (float)
ONVERSION
S1 → D1
S1
D1
When input is on, the 16- or 32-bit data assigned by S1 is converted into BCD and stored to the
*****
destination assigned by device D1.
Valid values for the source device are 0 through 9,999 for word data, and 0 through 99,999,999
for double-word data.
Function
Binary data to convert
Destination to store conversion results
When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the source,
16 points (word data) or 32 points (double-word data) are used.
When a word device such as T (timer), C (counter), or D (data register) is assigned as the source, 1 point (word
data) or 2 points (double-word data) are used.
FC6A S
MICROS
ERIES
MART
I
NSTRUCTIONS
I
Q
M
X
X
X
X
L
P
M
ADDER
ROGRAMMING
ANUAL
R
T
C
D
P
Constant
X
X
X
X
X
X
X
X
FC9Y-B1726
Repeat
X
10-1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents