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

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
CDBI
Instruction
• Converts a double precision real number to a 2-word (32-bit) integer used by the PLC
CPU.
CDBI <double precision variable> , <array variable>
Syntax
double precision variable
array variable
CDBI B#, A%(0)
Examples
• The CDBI instruction converts a double precision real number to a 2-word (32-bit) integer
Description
used by the PLC CPU.
• BASIC can handle a double precision real number of
An
If the converting double precision real number contains a fractional part, the fractional part
is rounded down, then converted.
• The following illustrates handling of BASIC's double precision real number by the PLC:
Example
• <array variable> uses a one dimensional integer array variable.
An "Illegal function call" error occurs if anything other than the one dimensional integer
array variable is specified.
11 - 14
"
"
Over flow
error occurs if the value exceeds this range.
Converts to a
2-word integer.
#
CDBI
BASIC
PLC
CPU
Be sure to define the variable to use for <array variable> by the DIM instruction.
If it is not defined by the DIM instruction, an "Illegal function call" error occurs.
Convert DouBle to Integer
• • • •
Specify the double precision variable where the data
to be converted is stored.
• • • •
Specify the one dimensional integer array variable
where the converted data is stored.
• • • •
Converts the value of B# to an integer and stores in
A%(0) and A%(1).
A%(0)
B#
A%(1)
%(n)
%(n+1)
PCWT
(Control table) ,
Stores in the data register.
Dn
%Value of (n)
Dn+1
%Value of (n+1)
L
Lower word
H
L
Higher word
H
2147483648 through 2147483647.
For <control table>,
see process code1
of the PCWT instruction.
%( )
2-word integer
MELSEC-Q
32 bits
11 - 14

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents