Data Conversions - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Data Conversions

Data conversions occur when you mix data types in your programming.
When programming
Relay Ladder Logic
Function Block
Instructions execute faster and require less memory if all the operands of the
instruction use:
• The same data type.
• An optimal data type:
– In the 'Operands' section of each instruction in this manual, a bold data
type indicates an optimal data type.
– The DINT and REAL data types are typically the optimal data types.
– Most function block instruction support only one data type (the
optimal data type) for its operands.
If you mix data types and use tags that are not the optimal data type, the
controller converts the data according to these rules.
• Are any of the operands a REAL value?
If
Then input operands (for example, source, tag in an expression, limit)
convert to
Yes
REALs
No
DINTs
• After instruction execution, the result (a DINT or REAL value) converts
To the destination data type, if necessary
You cannot specify a BOOL tag in an instruction that operates on integer or
REAL data types.
Because the conversion of data takes additional time and memory, you can
increase the efficiency of your programs by doing the following:
• Using the same data type throughout the instruction.
• Minimizing the use of the SINT or INT data types.
In other words, use all DINT tags or all REAL tags, along with immediate values,
in your instructions.
The following sections explain how the data is converted when you use SINT or
INT tags or when you mix data types.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Common Attributes
Conversions can occur when you
Mix data types for the parameters within one instruction
Wire two parameters that have different data types
Appendix A
649

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents