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

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
CSNI
Instruction
• Converts a single precision real number into a 2-word (32-bit) integer to be used by the
PLC CPU.
CSNI
Syntax
single precision variable
array variable
CSNI B!, A%(0)
Examples
• The CSNI instruction converts a single precision real number into a 2-word (32-bit) integer
Description
that is used by the PLC CPU.
• BASIC can handle a single precision real number
An "Over flow" error occurs if the value exceeds this range.
If the converting single precision real number contains a fractional part, the fractional part
is rounded down, then converted.
• The following shows handling of BASIC's single precision real number by the PLC CPU:
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 - 36
Convert SiNgle to Integer
(single precision variable> , <array variable>
Converts into a
2-word integer.
!
CSNI
BASIC
PLC
CPU
Be sure to define the variable used for <array variable> by the DIM instruction.
If it is not defined by the DIM instruction, an "Illegal function call" error occurs.
• • • •
Specify the single precision variable where the data
for conversion is stored.
• • • •
Specify the one dimensional integer array variable
where the converted data is stored.
• • • •
Converts the value of B! into 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
2.14748E+09 through 2.14748E+09.
For <control table>,
see process code
1 of the PCWT instruction.
%( )
MELSEC-Q
32 bits
11 - 36

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents