EasyManuals Logo

GE VersaMax PLC User Manual

GE VersaMax PLC
318 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #156 background imageLoading...
Page #156 background image
10.4 Data Type Conversion Functions
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.
Value to be converted
OK Enable
INT
_
TO
BCD4
IN
Output
Q
10.4.1.1 Parameters of the Convert to BCD-4 Function
Input/
Output
Choices
Description
enable flow
When the function is enabled, the conversion is
performed.
IN
I, Q, M, T, G, R, AI, AQ,
constant
IN contains a reference for the integer value to
be converted to BCD-4.
OK
flow, none
The OK output is energized when the function is
performed without error.
Q
I, Q, M, T, G, R, AI, AQ
Output Q contains the BCD-4 form of the original
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.
156 GFK-1503E VersaMax PLC User Manual
For public disclosure

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the GE VersaMax PLC and is the answer not in the manual?

GE VersaMax PLC Specifications

General IconGeneral
BrandGE
ModelVersaMax PLC
CategoryController
LanguageEnglish

Related product manuals