![LabSmith HVS448 Скачать руководство пользователя страница 23](http://html1.mh-extra.com/html/labsmith/hvs448/hvs448_user-manual_3205695023.webp)
23
A “Run” instruction jumps immediately to a global program label. In the example:
Run Initialize
On switching to this step, the program “Initialize” will be run.
It is good programming practice to use the “Run” instruction at least once for any step that is to be run by a user command for
clarity, even when it is not necessary.
Any channel, or the master, can force a step change at any time by executing a “SwitchTo Step” instruction. All channels must
switch to the prescribed Step at the end of their current instruction, regardless of current activity.
There is no way for a channel to ignore a step change. However, by using the “Continue” Step instruction the channel will resume
execution following the step change.
Note
:
You can also manually execute a Step instruction during an automated sequence, by choosing
Actions>Run>Step A–H
,
or by selecting it on the Sequence Control Panel.
The
Exit
instruction causes a channel to stop running the sequence and sets the channel to function as an input.
Orderly Step Flow
Though any sequence can perform a Step instruction, one sequence channel or the master must retain authority over step
instructions at any given time to avoid multiple sequences sending simultaneous (and inconsistent) Step instructions.
A simple solution is to program only the Master sequence to issue Step instructions. While this approach does help ensure
orderly movement between steps, it does not work universally, as when different channels must switch steps in response to
measurements. Whatever the requirements, it is best to keep the step switching simple.
Step H: The Exit Step
Step H is reserved for ensuring a safe shutdown of the sequence. When a channel executes an “Exit” instruction, it switches the
sequencer to Step H
and
does not allow any other step instructions until the master sequencer terminates the program by
issuing its own “Exit” instruction (see
Exit
)
. If any special shutdown procedures are required by a channel, they should be run in
Step H. The default step instruction of the Master for StepH is “Exit,” causing the sequence to exit immediately at StepH. Thus, by
default only, a “SwitchTo StepH” instruction has the effect of terminating a sequence.
Flags
Flags are useful for coordinating program flow within a step. The master or channels can “set” and “release” the four flags, F1
through F4, and the flags can have different meanings at different points in a sequence. Unlike step instructions, flags do not
automatically produce a particular behavior; instead, individual channels can react to, or ignore, the flags.
For example, if two channels are to produce out-of-phase square waves during a step, the channels can coordinate voltage-
switching times using a flag. Other channels can ignore, watch, or manipulate this flag as desired.
The master or channel sequences set and release flags by the instructions “SetFlag X” and “ClearFlag X,”
where X = F1, F2, F3, or F4.
The state of the flag can be read by the conditional statements, “FlagSet? X” or “FlagClear? X,”
again where X is F1, F2, F3, F4. If the test is true, the next instruction will be executed; if the test is false, the next instruction will
be skipped.
If two or more channels set a flag, and one releases the flag, the flag remains set. A flag is only cleared when all channels that
have set it have also released it.
Triggers
Triggers are used for communication with external equipment, or when a compound condition is required to “trigger” an event
in a channel sequence. A Trigger is specific to a channel, whereas any channel can set or release a flag.
To use a trigger, you first describe a logical condition that will set the trigger. This happens at the Sequence level, following a
Step Instruction. Then, within the body of a program, you test whether the trigger is set.