Data Type Conversion Functions; Data Type Conversion Functions Convert Signed Integer Data To Bcd-4 - GE VersaMax PLC User Manual

Table of Contents

Advertisement

10.4 Data Type Conversion Functions

Input/
Output
enable
IN
OK
Q
156
GFK-1503E
For public disclosure
The Data Type Conversion functions are used to change a data item from one number
type to another. Many programming instructions, such as math functions, must be used
with data of one type.
Convert data to BDC-4
Convert data to signed integer
Convert data to double-precision integer
Convert data to Real
Convert data to Word
Round a Real number toward zero (TRUN)
10.4.1 Data Type Conversion Functions Convert
Signed Integer Data to BCD-4
The Convert to BCD-4 function outputs the four-digit BCD equivalent of signed integer
data. The original data is not changed by this function.
Data can be converted to BCD format to drive BCD-encoded LED displays or presets to
external devices such as high-speed counters.
When the function receives power flow, it performs the conversion, making the result
available via output Q. The function passes power flow when power is received, unless
the specified conversion would result in a value that is outside the range 0 to 9999.
Enable
Value to be converted
10.4.1.1 Parameters of the Convert to BCD-4 Function
Choices
When the function is enabled, the conversion is
flow
performed.
I, Q, M, T, G, R, AI, AQ,
IN contains a reference for the integer value to
constant
be converted to BCD-4.
The OK output is energized when the function is
flow, none
performed without error.
Output Q contains the BCD-4 form of the original
I, Q, M, T, G, R, AI, AQ
value in IN.
10.4.1.2 Example
In the example, whenever input %I0002 is set and no errors exist, the integer at input
location %I0017 through %I0032 is converted to four BCD digits, and the result is stored
in memory locations %Q0033 through %Q0048. Coil %Q1432 is used to check for
successful conversion.
OK
_
Output
IN
Q
Description
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents