11 - 42 11 - 42
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
CVSMBF
Function
ConVert Single Microsoft Binary Format
• 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
• • • •
Specify the character string that was converted from
a single precision real number by the MKS$ function.
Examples
A!=CVSMBF(MKS$(123.45))
• • • •
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!.
Description
• The CVSMBF function converts a character string, which was converted from a single
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.
Integer values
16 bits x 2
2 bytes x 2
%(1)
ZMOVE TO %( ), 0 FROM !, 0, 4
Transfer by the ZMOVE instruction
AnA/AnU/AnUSCPU
PCWT
instruction
CVSMBF function
Single precision real number
(32 bits = 4 bytes)
!
%(0)
• 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.