11 - 99 11 - 99
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' Differences of calculation results among INT, FIX and CINT functions
20 DIM A(3)
:
' Defines an array
30 A(0)=12.34
:
' Stores the value
40 A(1)=12.56
50 A(2)=-12.34
60 A(3)=-12.56
70 FOR I=0 TO 3
:
' Repeats with I=0 to 3
80 PRINT "A(";I;")=";A(I)
:
' Displays the original value
90 PRINT "INT =";INT(A(I))
:
' Displays the result of conversion by the
INT function
100 PRINT "FIX =";FIX(A(I))
:
' Displays the result of conversion by the
FIX function
110 PRINT "CINT=";CINT(A(I))
:
' Displays the result of conversion by the
CINT function
120 PRINT
130 NEXT I
140 END
RUN
A( 0 )= 12.34
INT = 12
FIX = 12
CINT= 12
A( 1 )= 12.56
INT = 12
FIX = 12
CINT= 12
A( 2 )=-12.34
INT =-13
FIX =-12
CINT=-13
A( 3 )=-12.56
INT =-13
FIX =-12
CINT=-13
OK
REMARK
See the CINT and FIX 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...