4-259
Detailed explanation of command words
4MELFA-BASIC IV
XRst (X Reset)
[Function]
This instruction returns the program control to the first step if the program of the specified task slot is paused
by a command within the program (program reset). It is used during multitask operation.
[Format]
[Terminology]
<Slot No.>
Specify a slot number in the range from 1 to 32 as a constant or variable.
[Reference Program]
1 XRun 2
' Start.
2 Wait M_Run(2)=1
' Wait to confirm starting.
:
10 XStp 2
' Stop.
11 Wait M_Wai(2)=1
' Wait for stop to complete.
:
15 XRst 2
' Set program execution start step to head step.
16 Wait M_Psa(2)=1
' Wait for program reset to complete.
:
20 XRun 2
' Restart.
21 Wait M_Run(2)=1
' Wait for restart to complete.
[Explanation]
(1) This is valid only when the slot is in the stopped state.
(2) If used in a program that is executed constantly, this instruction is enabled by changing the value of the
"ALWENA" parameter from 0 to 7 and then turning the controller's power on again.
[Related instructions]
[Related parameter]
ALWENA
[Related system variables]
(Slot number) (1: Program selection is possible, 0: Program selection is impossible)
(Slot number) (1: Executing, 0: Not executing)
(Slot number) (1: Stopping, 0: Not stopping)
XRst[]<Slot No.>