3 - 3 3 - 3
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
3.1 Creating a Program
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 :
The flashing mark is called the cursor.
OK
"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.
Содержание 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...