Creating A Program - Mitsubishi QD51 Programming Manual

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

Advertisement

3 LET'S CREATE AND EXECUTE A PROGRAM

3.1 Creating a Program

3 - 3
In order to create a program, it is necessary to make the console usable first.
Start up the system so that AD51H-BASIC can be used on the console.
The outline of the system startup procedures are described in Section 2.1. See the
user's manual for each communications module for details.
Verify that the console screen displays the following :
OK
The flashing mark is called the cursor.
"OK" denotes that AD51H-BASIC is waiting for an instruction from you, the user. Now,
enter the following :
NEW Enter
NEW is an instruction that clears all programs from the memory. If a previous program
is still left when a new program is being written, they will get mixed with one another.
Therefore, it is always necessary to execute the NEW instruction.
Now, the console is ready for program creation. Enter the following program.
10 REM Calculation of compound interest
20 INPUT "Principal=";M
30 INPUT "Interest rate=";R
40 INPUT "Period=";K
50 RR=R/100
60 G=M(1 +RR) ^ K
70 PRINT "Interest included=";INT(G); "YEN"
80 END
It is necessary to place line numbers when entering instructions in a program. The
AUTO instruction is a convenience as it displays line numbers automatically. Enter the
following instruction.
AUTO Enter
The screen changes as shown below.
10
REMARK
If the screen displays "Syntax error" when you press the Enter key, it means that
there was an syntax error in the instruction you have just entered. Try entering it
again.
Also, if you have pressed a wrong key, press the Back Space key. If it was before
pressing the Enter key, the cursor will move back for one character and you can
correct your error.
MELSEC-Q
3 - 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents