11 - 148 11 - 148
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
MKI$
Function
MaKe Integer $
• Converts an integer type numeric value into a character string.
MKI$ ( <integer expression> [, S] )
Syntax
integer expression
• • • •
Specify the integer to be converted into a character
string.
Examples
A$=MKI$(314)
• • • •
Converts into a 2-byte character string and stores in
A$.
Description
• The MKI$ function converts an integer type numeric value to a 2-byte character string.
• Integer type numeric values that will be written to the random file buffer using the LSET or
RSET instruction must be converted to a character string with the MKI$ function.
• The data converted into a character string by the MKI$ function can be restored to the
original numeric value only by the CVI function.
• It is recommended to use the LSET instruction when writing data that was converted to a
character string using the MKI$ function to the random file buffer.
If the field length (number of bytes) of each variable specified by the FIELD instruction is
greater than the used field length (number of bytes) of the MKI$ function, the data will not
be correctly converted by the CVI function.
Example
OPEN " : " AS #1
FIELD #1, 10 AS B$
A%=100
A$=MKI$(A%)
B$ d
B%=100
B%=CVI(C$)
C$= "d "
LSET B$=A$
LSET C$=B$
(Correct)
C$= " d "
B%=8224
B%=CVI(C$)
LET C$=B$
RSET B$=A$
B$
d
Write
Write
Read
Read
File
(Incorrect)
The CVI function converts the required number of bytes from the left side of each variable
area specified by the FIELD instruction.
• The data converted to character strings using the MKI$ function may be used for data
communication as well as for writing to the random file buffer.
• When the [,S] option is specified, the integer will be converted to a character string and
rearranged as follows.
1)
2)
2)
1)
Converts into
character string.
%
L
H
REMARK
See the MKD$, MKS$, CVD, CVI, and CVS functions.
Содержание 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...