RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
527
Undelayed
Short
List Command
switch_ioport
Function executes a relative list jump list_jump_rel (
Pos
) whose jump distance
Pos
(>1) is
determined at runtime by the current value (
IOvalue
) at the EXTENSION 1 connector’s
16-bit digital input port. You can specify which of the 16-bit digital input port’s bits should
be evaluated for this purpose.
Call
switch_ioport( MaskBits, ShiftBits )
Parameters
MaskBits
Number of contiguous bits (as an unsigned 32-bit value) of the 16-bit
digital input port to be evaluated for determining the jump distance;
allowed range: [1 … 16]
ShiftBits
Position of the least significant to-be-evaluated bit of the 16-bit digital
input port (as an unsigned 32-bit value); allowed range: [0 … 15]
Comments • With invalid values of
MaskBits
or
ShiftBits
and with (
MaskBits
+
ShiftBits
) > 16,
the command is replaced by a list_nop (get_last_error return code
RTC5_PARAM_ERROR
).
• The following applies:
Mask
= ((1 <<
MaskBits
) – 1) <<
ShiftBits
and
SwitchNo
= (
Mask
&
IOvalue
) >>
ShiftBits
. Here, a list_jump_rel(
Pos
) with
Pos
= (
SwitchNo
+ 1) list positions will then be executed.
• The jump distance is at least 1. This prevents infinite loops when no signal is present.
Jumps to the same address (
Pos
= 0) aren’t possible with switch_ioport, but can be
simulated via list_jump_rel ( –1 ) as the directly subsequent command.
• The maximum jump distance is 2
16
list positions.
• Also see list_jump_rel.
• Also see section "16-Bit Digital Input and Output", page 49 and "Conditional Command
Execution", page 213.
RTC
®
4
RTC
®
5new command
Version info Last change with version DLL 517, OUT 516
References list_jump_rel, list_jump_rel_cond