9.388 N-Way-Switch-Latching

This page describes the device driver and the device window for the N-Way-Switch-Latching logical device. This device controls a latching n-way switch which is controlled by a dedicated drive circuit for each input. The switch is actuated by applying pulses of a defined length to the drive circuits. The switch position is determines by a set of position indication circuits read through PLC inputs.

The N-Way-Switch logical device is part of the sat-nms framework for M&C of plain digital I/O functions. It does not interrogate a PLC device directly, but requires a low level device driver to do the physical communication. Examples for such drivers are the Fanuc-PLC9030 and the NAIS-FP0 PLC device drivers.

The n-way switch must be wired in a way that the drive coils of the switch are connected to consecutive output ports which appear in the same output register variable of the PLC driver. The same applies to the position indicating inputs.

Device window pages

The following table shows which device window pages are available with this individual device type. Tool-bar functions not mentioned here are described at the general description of device windows .

Configuration parameters

At the maintenance page of the device window there are a couple of configuration parameters which must be set to integrate the device into the VLC/M&C.

parameter description
firstDrivePort The address of the PLC port which activates the lowest switch position. The output ports for the subsequent switch positions are evaluated automatically. See the paragraph 'Port addressing' below for details.
firstIndicationPort The address of the PLC port which indicated lowest switch position. The input ports for the subsequent switch positions are evaluated automatically. See the paragraph 'Port addressing' below for details.
resetPort The address of a reset port to be activated in advance to each switch activation. If the switch does not require a reset pulse, leave this field empty. If 'resetPort' contains a port address (see 'Port addressing' below for a specification of PLC port addresses), the device first activates the reset port for one pulse width in order to reset the switch before it activates a switch port.
pulseWidth The activation pulse width (msec) to be sent to the switch for a position change. When setting this parameter, you should be aware that pulses which are shorter than the IDLE time of the PLC driver's thread may get lost. If in doubt, set the pulse width to 1100 msec or in the VLC interface/device setup screen tune the IDLE time of the PLC driver thread to e.g. 200 msec.
positions By default the device reports the state of the switch as '1' ... '4'. You may specify arbitrary texts for the switch positions. 'positions' contains a list of descriptions, separated by comma characters. The number of list elements also sets the number of output ports, the N-Way-Switch-Latching uses.
commFaultId By default (commFaultId is empty) the device signals a communication fault if the summary fault of the PLC device get active. This may not be exactly what you want, because the PLC device may signal a fault which does not inhibit the switching or input sampling process. You may set commFaultId to the parameter ID of a fault flag which signals the desired condition. This makes the device ignore the PLC's summary fault and use the state of this fault flag as communication fault.
The SatService IO-FEP driver for example offers such a fault flag which signals that actually no switching an no input interrogation is possible (faults.17 at the IO-FEP).

Fault flags

fault flag fault name description
faults.99 Communication Unless the the setup parameter commFaultId is set, faults.99 is set if the PLC device which manages the physical ports signals a fault. With commFaultId set, the fault state addressed by this parameter is replicated as communication fault of the device.
faults.01 Position Indication This fault is set if the switch position cannot be determined unambiguously. This is if not exactly one of the indication ports is 'high'.
faults.02 Wrong Position This fault is set if the indicated switch position does not match the commanded one. The fault remains active until either the switch position is changed or a new position is commanded.
faults.03 Configuration Setup This fault signals that the 'firstDrivePort' or the 'firstIndicationPort' parameter is not properly configured. The device expects, that these variables are set to values which match the syntax description shown below.

Port addressing

A device driver for a PLC gives access to it's I/O ports through a number of integer variables. Each variable stands for up to 64 input or output ports which are addressed by the bit position within the variable.

Port (bit-) addresses in the configuration of the logical I/O devices refer to such a variable which is provided by the PLC driver and also to the bit position within this variable. The syntax of a port address specification is:

<variable-identifier> + <bit-offset>

<bit-offset> is a decimal constant in the range 0 .. 63. You may replace the + character in the port address by a percent sign ( % ) and specify the bit offset in hexadecimal notation. This may be helpful for PLC types which use hexadecimal addresses.

Example: The port address ' FANUC.Q00065+1 ' refers to the 2^1 bit in the variable ' Q00065 ' provided by the ' FANUC ' device. In fact this addresses the output table register '%Q00066' at the PLC. Other PLC drivers may use a different naming scheme for the variables, but the concept always is the same.

In case of the N-Way-Switch-Latching device, the configured port address specifies the first of the (totally n ) output ports which drive the switch. Configuration example:

firstDrivePort = PLC.Q00001+0
firstIndicationPort = PLC.I00001+0
positions = 1,2,3,4

This example configures a 4-way switch. It uses the output ports ' PLC.Q00001+0 ' .. ' PLC.Q00001+3 ' to drive the switch. The input ports ' PLC.I00001+0 ' .. ' PLC.I00001+3 ' indicate the switch position.

Variables defined by this device driver

name type flags range
info.driver TEXT R/O StringRange R/O
info.type TEXT R/O StringRange R/O
info.port TEXT R/O StringRange R/O
info.frame TEXT R/O StringRange R/O
config.firstDrivePort TEXT SAVE SETUP StringRange
config.firstIndicationPort TEXT SAVE SETUP StringRange
config.resetPort TEXT SAVE SETUP StringRange
config.pulseWidth INTEGER SAVE SETUP IntegerRange (200 .. 5000)
config.positions TEXT SAVE SETUP StringRange
config.commFaultId TEXT SAVE SETUP StringRange
position CHOICE EnumRange (1 2 3 4)
faults.01 ALARM R/O AlarmFlagRange R/O (Position Indication)
faults.02 ALARM R/O AlarmFlagRange R/O (Wrong Position)
faults.03 ALARM R/O AlarmFlagRange R/O (Configuration Setup)
faults.99 ALARM R/O AlarmFlagRange R/O (Communication)