Notes On The Use Of Basic Commands - Mitsubishi Melsec A User Manual

Table of Contents

Advertisement

6. AD51 PROGRAMMING NOTES
/MELSEC
6.3 Notes on the Use of BASIC Commands
6.3.1 Key input commands
Key inputs (INPUT and INKEY commands) t o the AD51 via one
channel (as specified b y the ZlDV command) should only be made
t o one task.
Since tasks are executed in order of task numbers, any data keyed
in t o a task can only be read at certain intervals. I f a key is pressed
and more than one task is waiting for data from the specified chan-
nel, only the first task t o execute the INKEY or INPUT instruction
will read the key input. The other tasks will then continue waiting
until a key is pressed while they are being run.
Task 1
Task 2
100 REM "TASK 1"
100 REM "TASK 2"
)
)
\
\
200 ZlDV 1
500 ZlDV 1
210 A=INKEY
510 B=INKEY
1
1
Example: When both task 1 and task 2 are waiting for key input
from channel 1, pressing a key will only write data to
one of variables A or
6.
6.3.2 Printing commands
The printing commands are "PRINT" and "LPRINT"
(1) Difference between PRINT and LPRINT commands
[PRINT]
Used when the printer is connected t o the console channel
(channel 1 or 3 set with DIP switch 16) or the channel specified
with ZODV.
Used when the printer is connected t o the channel specified in
the printer setting.
(2) Sharing of a single printer between tasks.
When several tasks are sharing the use of a printer ensure that
interlock flags are provided in the work area t o prevent two or
more tasks attempting t o access the printer simultaneously.

Advertisement

Table of Contents
loading

Table of Contents