4-155
Detailed explanation of command words
4MELFA-BASIC IV
Act (Act)
[Function]
This instruction specifies whether to allow or prohibit interrupt processing caused by signals, etc. during
operation.
[Format]
[Terminology]
<Priority No.>
0: Either enables or disables the entire interrupt.
1 to 8: Designate the priority No. for the interrupt defined in the Def Act statement.
When entering the priority No., always leave a space (character) after the Act command.
If described as Act1, it will be a variable name declaration statement.
<1/0>
1: Allows interrupts, 0:Prohibits interrupts.
[Reference Program]
(1) When the input signal 1 turns on (set to 1) while moving from P1 to P2, it loops until that signal is set to 0.
1 Def Act 1,M_In(1)=1 GoSub *INTR
' Assign input signal 1 to the interrupt 1 condition
2 Mov P1
3 Act 1=1
' Enable interrupt 1.
4 Mov P2
5 Act 1=0
' Disable interrupt 1.
:
10 *INTR
'
11 IF M_In(1)=1 GoTo 110
' Loops until the M_In(1) signal becomes 0.
12 Return 0
'
(2) When the input signal 1 turns on (set to 1)while moving from P1 to P2, Operation is interrupted and the
output signal 10 turns on.
1 Def Act 1,M_In(1)=1 GoSub *INTR 'Assign input signal 1 to the interrupt 1 condition
2 Mov P1
3 Act 1=1
' Enable interrupt 1.
4 Mov P2
:
10 *INTR
11 Act 1=0
' Disable interrupt 1.
12 M_Out(10)=1
' Turn on the output signal 10
13 Return 1
' Returns to the next step which interrupted
Act[]<Priority No.> = <1/0>