11 - 21 11 - 21
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
CIDB
Function
Convert Integer to DouBle
• 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
• • • •
Specify a one-dimensional integer array variable
where the data to be converted is stored.
A#=CIDB(B%(0))
• • • •
Converts an integer value in B%(0) and B%(1) into a
double precision and stores in A#.
Examples
L
H
L
H
B%(0)
B%(1)
A#
Lower word
Higher word
32 bits
Description
• The CIDB function converts a 2-word (32-bit) integer to be used by the PLC CPU into a
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.
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.
• 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
PLC
CPU
2-word integer
y y y y
Stores in a data register.
x x x x
Dn
Dn+1
BASIC
PCRD (control table)
%( )
%(n)
%(n+1)
Converts into a double
precision real number.
#
For <control table>,
see process code
1 of the PCRD instruction.
CIDB