A Single Precision Real Number ) - Mitsubishi QD51 Programming Manual

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
CVSMBF
Function
• Converts a single precision real number of AD51H-BASIC, which was converted to the
character string by the MKS$ function, to the internal expression of a floating point real
number (IEEE format single precision internal expression) that is used by
AnA/AnU/AnUSCPU.
CVSMBF ( <character string expression> )
Syntax
character string expression
A!=CVSMBF(MKS$(123.45))
Examples
• The CVSMBF function converts a character string, which was converted from a single
Description
precision real number on AD51H-BASIC by the MKS$ function, into the internal
expression of the floating point real number (IEEE format single precision internal
expression) that is used by AnA/AnU/AnUSCPU.
• The internal representation of the AD51H-BASIC real number and that of the floating point
real number (IEEE format) are different. The CVSMBF function is used for conversion
between these two.
• Always specify a character string, which was converted from a single precision real number
by the MKS$ function, into <character string expression>.
Character string expressions that were converted by the MKI$, MKD$ or other function
cannot be converted correctly.
• Use single precision type ( !) for the variable to assign to, since the CVSMBF function
returns a single precision value.
• To write a value that was converted by the CVSMBF function to AnA/AnU/AnUSCPU by
the PCWT instruction, it is necessary to assign the value from the CVSMBF function to
two integer array variables by the ZMOVE instruction.
• In addition for the AnA/AnU/AnUSCPU, the values converted by the CVSMBF function can
be used for the data communication with the system that uses the internal expression of
the IEEE format single precision numeric value.
11 - 42
ConVert Single Microsoft Binary Format
CVSMBF function
!
Single precision real number
(32 bits = 4 bytes)
ZMOVE TO
%( ), 0 FROM
Transfer by the ZMOVE instruction
• • • •
Specify the character string that was converted from
a single precision real number by the MKS$ function.
• • • •
Converts a single precision real number 123.45 to
the internal expression of the floating point real
number (IEEE format single precision internal
expression) that is used by AnA/AnU/AnUSCPU,
and assigns it to A!.
%(0)
%(1)
!, 0, 4
Integer values
16 bits x 2
2 bytes x 2
AnA/AnU/AnUSCPU
MELSEC-Q
PCWT
instruction
11 - 42

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents