11 - 155 11 - 155
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
OCT$
Function
OCTal $
• Converts a numeric value into a character string variable in octal notation.
OCT$ (<numeric expression>)
Syntax
numerical expression
• • • •
Specify a value within the range between -32768 and
65535.
Note that numbers from 32768 to 65535 are the
same as the values from -32768 to -1 (8000
H
to
FFFF
H
).
Examples
PRINT OCT$(10)
• • • •
Converts decimal number 10 into octal and displays
the result.
Description
• The OCT$ function converts a numeric value to a character string variable in octal notation.
• Digits after the decimal point are truncated if a decimal point is included in the value in
<numeric expression>.
• Octal and decimal correspond as follows.
Octal
0
1
2
3
4
5
6
7
10
11
12
Decimal
0
1
2
3
4
5
6
7
8
9
10
Program Example
10 ' Converts a decimal number to an octal number
20 A=100
:
'Defines a value
30 A$=OCT$(A)
:
'Converts into an octal number
40 PRINT "Decimal number=";A
50 PRINT "Octal number=";A$
60 END
RUN
Decimal number=100
Octal number=144
OK
Содержание 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...