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
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...