Cidb ( Converts A 32-Bit Integer Into A Double Precision Real Number ) - Mitsubishi QD51 Programming Manual

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
CIDB
Function
• Converts a 2-word (32-bit) integer to be used by the PLC CPU into a double precision real
number.
CIDB ( <array variable> )
Syntax
array variable
A#=CIDB(B%(0))
Examples
• The CIDB function converts a 2-word (32-bit) integer to be used by the PLC CPU into a
Description
double precision real number.
• <array variable> uses a one dimensional integer array.
An "Illegal function call" error occurs if anything other than one dimensional integer array is
specified.
• Accuracy of the double precision real number, which was converted from a 2-word (32-bit)
integer, is the same as the accuracy before the CIDB function was executed.
• The following shows how to handle 2-word (32-bit) integer to be used by the PLC CPU in
BASIC:
Example
11 - 21
Convert Integer to DouBle
Be sure to define the variable to be used for <array variable> by the DIM instruction.
An "Illegal function call" error occurs if it is not defined by the DIM instruction.
PLC
2-word integer
CPU
BASIC
For <control table>,
see process code
1 of the PCRD instruction.
• • • •
Specify a one-dimensional integer array variable
where the data to be converted is stored.
• • • •
Converts an integer value in B%(0) and B%(1) into a
double precision and stores in A#.
L
B%(0)
H
L
B%(1)
H
Stores in a data register.
Dn
Dn+1
PCRD
(control table)
%(n)
%(n+1)
Lower word
32 bits
Higher word
x x x x
y y y y
%( )
Converts into a double
precision real number.
#
CIDB
MELSEC-Q
A#
11 - 21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents