11 - 40 11 - 40
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
CVI
Function
ConVert to Integer
• Converts a character string, which was converted by the MKI$ function, back to an integer.
CVI ( <character string expression> ) [, S] )
Syntax
character string expression
• • • •
Specify the character string that was converted by
the MKI$ function.
A%=CVI(MI$)
• • • •
Converts the character string (MI$), which was
converted by the MKI$ function, back to the original
integer and assigns it to A%.
Examples
B%=CVI(MI$, S)
• • • •
After replacing the contents of the character string
MI$, converts it back to the original integer and
assigns it to B%.
Description
• The CVI function converts the character string, which was converted by the MKI$ 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,
an integer is converted into a 2-byte character string by the MKI$ function before written
into a file. Conversely, the 2-byte character string has to be converted back to the original
integer when this data is read from the file and to treat as an integer. The CVI function is
used for this purpose.
• The CVI function can convert only the character string, which was converted by the MKI$
function, into an integer. 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 MKI$ 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 an integer.
1)
2)
2)
Original character string
L
H
1)
Converts to an
integer.
%
REMARK
See the MKI$ 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...