11 - 41 11 - 41
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
CVS
Function
ConVert to Single
• Converts a character string, which was converted by the MKS$ function, back to a single
precision real number.
CVS ( <character string expression> ) [, S] )
Syntax
character string expression
• • • •
Specify the character string that was converted by
the MKS$ function.
A!=CVS(MS$)
• • • •
Converts the character string (MS$), which was
converted by the MKS$ function, back to the original
single precision real number and assigns it to A!.
Examples
B!=CVS(MS$, S)
• • • •
After replacing the contents of the character string
MS$, converts it back to the original single precision
real number and assigns it to B!.
Description
• The CVS function converts the character string, which was converted by the MKS$
function, back to the original numeric value.
• Since all the data, which is written into the random access file, has to be a character string,
a single precision real number is converted into a 4-byte character string by the MKS$
function before written into a file. Conversely, the 4-byte character string has to be
converted back to the original single precision real number when this data is read from the
file and to treat as a real number. The CVS function is used for this purpose.
• The CVS function can convert only the character string, which was converted by the MKS$
function, into a single precision real number. If other character stings are specified in
<character string expression>, normal data will not be returned or an "Illegal function call"
error occurs.
• The data, which was converted to a character string by the MKS$ function, can be used for
the data communication in addition to writing to a random access file.
• When the [, S] option is specified, the character string subject to the conversion is
rearranged as follows, then converted it into a single precision real number.
Original character string
L
H
L
H
1)
2)
3)
4)
!
4)
3)
2)
1)
Lower word
Higher word
Converts to a single
precision real number.
REMARK
See the MKS$ function.
Содержание 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...