Omron SYSMAC C200H-ASC02 Operation Manual page 55

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

BASIC Language
PC GET Statement
PC ... ON/OFF/STOP Statement
10
ON PC 1 GOSUB 100
20
PC ON
30
PC GET A, B
40
IF B=1 THEN PC PUT 0
50
GO TO 30
60
END
100
PC PUT 1
110
Interrupt processing
120
RETURN
Remarks:
An interrupt is invoked at the ASCII Unit from the PC program, avoiding the
time at which the ASCII busy flag is ON. When the WRITE flag turns ON, the
ON PC GOSUB statement is executed by the ASCII Unit. The ASCII Unit
notifies the PC that interrupt processing has been executed by turning ON bit
10308. The PC acknowledges this notification by turning ON 10008. When
10008 is turned ON, the ASCII Unit turns OFF bit 10308.
Purpose:
To read output data from the PC
Format:
PC GET <var 1>[,<var 2>]
Example:
PC GET I,J
Remarks:
Bits 0 through 7 of Data Section word (n) are read and assigned to <var 1>.
Bits 8 through 15 of Data Section word (n) are read and assigned to <var 2>.
The ASCII Unit converts the hexadecimal data into decimal data (0 through
255) before assigning it to the specified variables.
Purpose:
To enable, disable, or stop a PC interrupt defined with an ON PC
GOSUB statement
Format:
PC [<num>] ON/OFF/STOP
<num> is a specific interrupt number.
Remarks:
The PC ON statement enables an interrupt defined by the ON PC GOSUB
statement.
After this statement has been executed, each PC interrupt will cause pro-
gram execution to branch to a routine defined by the associated ON PC GO-
SUB statement.
The PC STOP statement disables PC interrupts from branching program ex-
ecution. However, if the PC ON statement is subsequently executed, execu-
tion will branch to the specified interrupt service routine based on the
"STOPPED" interrupt.
Execute the PC OFF statement at the end of the program.
The PC ON/OFF/STOP statement can be executed only after the ON PC
GOSUB statement has been executed.
If there is more than one interrupt routine in the program the specific interrupt
number should be specified. If there are two or more routines and the inter-
rupt number is not specified, the routine closest to the end of the program or
B = Bit 10008.
If B = 1 then 10308 is turned OFF.
10308 is turned ON.
Section 4-2
45

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents