Mitsubishi QD51 Programming Manual page 220

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' Defines a formula to calculate the area of a triangle as function name FNA
20 DEF FNA(A,B)=(A*B)/2
30 INPUT "Base=";C
40 INPUT "Height =";D
50 E=FNA(C, D)
60 PRINT "Area of the triangle =";E
70 END
RUN
Base =? 10
Height =? 2
Area of the triangle = 10
OK
11 - 50
:
' (base*height)/2
:
' Input of the base
:
' Input of the height
:
' Calculation
:
' Displays the calculation result
MELSEC-Q
11 - 50

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents