4MELFA-BASIC IV
Detailed explanation of command words
4-240
RelM (Release Mechanism)
[Function]
This instruction is used in connection with control of a mechanism via task slots during multitask operation.
It is used to release the mechanism obtained by the GetM instruction.
[Format]
[Reference Program]
(1) Start the task slot 2 from the task slot 1, and control the mechanism 1 in the task slot 2.
Task slot 1
1 RelM
' Releases the mechanism in order to control mechanism 1 using slot 2.
2 XRun 2,"10"
' Start the program 10 in slot 2.
3 Wait M_Run(2)=1
' Wait for the starting confirmation of the slot 2.
:
Task slot 2. (Program "10")
1 GetM 1
' Get the control of mechanism 1.
2 Servo On
' Turn on the servo of mechanism 1.
3 Mov P1
4 Mvs P2
5 Servo Off
' Turn off the servo of mechanism 1.
6 RelM
' Releases the control right of mechanism 1.
7 End
[Explanation]
(1) Releases the currently acquired mechanism resource.
(2) If an interrupt is applied while the mechanism is acquired and the program execution is stopped, the
acquired mechanism resource will be automatically released.
(3) This instruction cannot be used in a constantly executed program.
[Related instructions]
RelM