RTC6 boards
Doc. Rev. 1.0.21 en-US
10 RTC6 Commands
806
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 16-bit digital input port of the
EXTENSION 1 socket connector. 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 of the 16-bit digital input port to be
evaluated for determining the jump distance.
As an unsigned 32-bit value.
Allowed value 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 value range: [0…15].
Comments • With invalid values of
MaskBits
or
ShiftBits
and with (
MaskBits
+
ShiftBits
) > 16,
switch_ioport is replaced by a list_nop (get_last_error return code
RTC6_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 are then executed.
• The jump distance is at least 1. This prevents infinite loops when no signal is present.
Jumps to the same address (
Pos
= 0) are not possible with switch_ioport, but can be
simulated by list_jump_rel ( –1 ) as the directly subsequent command.
• The maximum jump distance is 2
16
list positions.
• See also list_jump_rel.
• See also Section ”16-Bit Digital Input Port and 16-Bit Digital Output Port”, page 78 and
Chapter 9.3.2 ”Conditional Command Execution”, page 295.
Example
(Pascal)
• It is assumed that the current value at the 16-bit digital input port is $F152 at runtime:
then switch_ioport( $0008, $0004 ) executes list_jump_rel( $0016 ), that is, a
relative list jump of length 22 list positions.
RTC4RTC6 New command.
RTC5RTC6 Unchanged functionality.
Version info Available as of DLL 600, OUT 600, RBF 600.
References list_jump_rel, list_jump_rel_cond