Lamp switch

<< Click to Display Table of Contents >>

Manual > Library Reference > Parts Library > Basic Parts >

Lamp switch

Lamp switch

 

parts_lampswitch1_001

A lamp switch is a component that displays the value received from a tag as a lamp.

It also has a switch function for ON/OFF operation, so in addition to using it as a simple lamp, it can also be used as both a lamp and a switch.

 

Specify the tags to be displayed in the input tag (_TagIn) and input tag 2 (_TagIn2). If only one point is input, you can specify the tag path in _TagIn only. If two points are input, you can specify the tag path in _TagIn and _TagIn2.

When using the switch function, specify the output tag in output tag (_TagOut) and output tag 2 (_TagOut2) and enable the switch function (_SwitchEnable). If there is only one output, you can specify the tag path in _TagOut only, and if there are two output, you can specify the tag path in _TagOut and _TagOut2.

 

In addition to the input tag, you can also specify a tag to identify the alarm state in the alarm tag (_TagAlarmEx). The alarm tag is used when you want to display the alarm state with the same symbol in addition to the ON/OFF state of the device. If you do not use the alarm tag, you can omit it.

 

Furthermore, by specifying a tag for fault identification in the fault identification tag (_TagFault) in addition to the input tag and alarm tag, a fault can be displayed based on signals such as equipment abnormalities received from downstream.

 

 

Custom Properties

 

Tag configuration

Input Tags

_TagIn

Specify the tag path of the input tag.


Input Tag 2

_TagIn2

Specify the tag path of input tag 2. Used only for two-point input.


Output Tags

_TagOut

Specifies the tag path of the output tag.


Output Tag 2

_TagOut2

Specifies the tag path of output tag 2. Used only for two-point output.


Alarm Tag

_TagAlarmEx

Specify the tag path of the alarm tag.


Fault Identification Tag

_TagFault

Specifies the tag path of the fault identification tag.

Value/Switch Setting

ON value

_RaiseValue

Set the value that is considered to be ON. True is set by default (same as "1"). You can also set a value other than True according to the meaning of ON/OFF of the target signal. The value of this property will also be used for the ON value written to the tag by switch operation.


OFF value

_LowerValue

Set the value to be considered as OFF. False is set by default (equals "0"). You can also set a value other than False according to the meaning of ON/OFF of the target signal. The value of this property will also be used for the OFF value written to the tag by switch operation.


Detection Latency

_DiscrepancyTimeout

In the case of two-point input, if the input values of _TagIn and _TagIn2 remain in an inconsistent state for the period of time (milliseconds) specified here, the value will be displayed in the abnormal color (_AbnormalColor) (an inconsistent state would be, for example, if both _TagIn and _TagIn2 are True).


Switch Function

_SwitchEnable

Specifies whether or not to enable the switch function. The switch function will not be enabled just by specifying the output tag. This property must be enabled when operating as a switch.


Switch Type

_SwitchType

Select the switch type.

•A_SWITCH ・・・ON while pressed, OFF when released

•B_SWITCH ・・・OFF while pressed, ON when released

•ON_SWITCH ... Press to turn on output (OFF no output)

•OFF_SWITCH ... Press to turn OFF output (no ON output)

•ALTERNATE_SWITCH ... Each time you press it, the output switches between ON/OFF

Display settings

caption

_Caption

Specify a caption.


Caption 2

_Caption2

Specifies caption 2.


Lamp paint color

_LampFillColor

Specifies the initial display color of the lamp.


ON color

_LampOnColor

Specifies the ON display color of the lamp.


OFF color

_LampOffColor

Specifies the OFF display color of the lamp.


Alarm Color

_LampAlarmColor

Specifies the alarm display color. This is the display color when the alarm tag is True (different from the color when an error occurs).


Abnormal color

_LampAbnormalColor

Specifies the display color when an abnormality occurs. This will be the display color when an abnormal input value is detected (when the input value is inconsistent) (this is different from an alarm).


NULL color

_LampNullColor

Specifies the NULL display color. The NULL color is the lamp display color when no value has been obtained from the input tag (for example, immediately after the screen is displayed) or when a fault occurs.


Caption Color

_CaptionColor

Specify the color of the caption. For parts with captions on lamps, specifying @AutoColor will display the text in the color that best suits the fill color.


Caption Color 2

_CaptionColor2

Specifies the color of Caption 2. For parts with captions placed on lamps, specifying @AutoColor will display the text color that best suits the fill color.


Background Panel

_BackPanelColor

Specifies the color of the background panel.

Input assistance settings

Confirmation screen display

_IsConfirm

If enabled, a confirmation dialog will be displayed during operation. Note that if the switch type is A_SWITCH or B_SWITCH, the confirmation screen will not be displayed even if this property is enabled.


Confirmation message

_ConfirmMsg

Specify the confirmation message to be displayed on the confirmation screen.


Error Message

_ErrorMsg

Specifies the error message to be sent when a write error occurs.


Operation history output

_Log

If enabled, the operation history will be output when a value is written. If you want to output the operation history in a standard project that uses the standard framework, enable the operation history setting from the system administration settings screen. For details, see "Operation History Settings". If you want to output the operation history in an original project that does not use the standard framework, define Alarm server to record the operation history and set the root DefaultFireAlarm property appropriately.


Operation Message

_LogMsg

Specify the message to be output to the operation history.

others

Display value

_Value

You can directly assign a display value to this property from a script.

 

 

Switch Type and Output Value

The output values for the output tags for each switch type are as follows:

 

Switch Type

Output tag count

specification

A_SWITCH

One output

•When the switch is pressed, write _RalseValue to _TagOut.

•When the switch is released, write _LowerValue to _TagOut.


2-point output

•When the switch is pressed, write _RalseValue to _TagOut and _LowerValue to _TagOut2.

•When the switch is released, write _LowerValue to _TagOut and _RaiseValue to _TagOut2.

B_SWITCH

One output

•When the switch is pressed, write _LowerValue to _TagOut.

•When the switch is released, write _RaiseValue to _TagOut.


2-point output

•When the switch is pressed, write _LowerValue to _TagOut and _RaiseValue to _TagOut2.

•When the switch is released, write _RaiseValue to _TagOut and _LowerValue to _TagOut2.

ON_SWITCH

One output

•When the switch is pressed, _RalseValue is written to _TagOut.

 


2-point output

•When the switch is pressed, _RalseValue is written to _TagOut and _LowerValue is written to _TagOut2.

 

OFF_SWITCH

One output

•When the switch is pressed, _LowerValue is written to _TagOut.

 


2-point output

•When the switch is pressed, _LowerValue is written to _TagOut and _RaiseValue is written to _TagOut2.

 

ALTERNATE_SWITCH

One output

•When the switch is pressed, the inverted value of the input tag is written. When the input tag is ON, _LowerValue is written to _TagOut, and when the input tag is OFF, _RaiseValue is written to _TagOut.


2-point output

•When the switch is pressed, the inverted value of the input tag is written. When the input tag is ON, _LowerValue is written to _TagOut and _RaiseValue is written to _TagOut2. When the input tag is OFF, _RaiseValue is written to _TagOut and _LowerValue is written to _TagOut2.

 

 

Usage Example

 

1) Lamp display (1-point input/no fault identification tag/no alarm tag)

 

The ON/OFF state is identified by only one tag. When the value of the input tag (_TagIn) is the ON value (_RaiseValue), the lamp displays the state as ON, and when the value of the input tag (_TagIn) is the OFF value (_LowerValue), the lamp displays the state as OFF.

 

_TagIn: Specify the tag path of the input tag

_TagIn2: Unused

_TagOut...unused

_TagOut2: Unused

_TagAlarmEx ・・・Unused

_TagFault ・・・Unused

_SwitchEnable: Disabled (False)

 

parts_lampswitch1_001

When the input tag is an OFF value, the lamp display turns OFF.

 

parts_lampswitch1_002

When the input tag is ON, the lamp will turn ON.

 

parts_lampswitch1_003

If the quality flag of the input tag is BAD, a fault is displayed.

When a fault is displayed, the fill will be NULL color, a yellow frame will be displayed and will flash.

 

 

2) Lamp display (1-point input/with fault identification tag/without alarm tag)

 

If you specify a fault identification tag, you can receive the fault status of the device via the tag. For example, if you can receive a fault status (such as a contact abnormality) from the downstream side as a signal separate from the device's operating status, you can specify the tag path of that signal as the fault identification tag to display the fault along with the status of the quality flag of the input tag.

 

_TagIn: Specifies the tag path of the input tag.

_TagIn2: Unused

_TagOut...unused

_TagOut2: Unused

_TagAlarmEx ・・・Unused

_TagFault...Specifies the tag path of the fault identification tag.

_SwitchEnable: Disabled (False)

 

parts_lampswitch1_001

When the input tag is an OFF value, the lamp display turns OFF.

 

parts_lampswitch1_002

When the input tag is ON, the lamp will turn ON.

 

parts_lampswitch1_003

When the quality flag of the input tag is BAD or the fault identification tag is True, a fault is displayed.

When a fault is displayed, the fill will be NULL color, a yellow frame will be displayed and will flash.

 

 

3) Lamp display (1-point input/with fault identification tag/with alarm tag)

 

There are times when you want to use a single symbol to display the alarm status as well as the ON/OFF status of a device (for example, ON: red light, OFF: green light, alarm: flashing orange, etc.). By specifying an alarm tag in a lamp switch part, the lamp will be displayed in the alarm color when the alarm tag is true.

 

_TagIn: Specifies the tag path of the input tag.

_TagIn2: Unused

_TagOut...unused

_TagOut2: Unused

_TagAlarmEx...Specifies the tag path of the alarm tag.

_TagFault...Specifies the tag path of the fault identification tag.

_SwitchEnable: Disabled (False)

 

parts_lampswitch1_001

When the input tag is an OFF value, the lamp display turns OFF.

 

parts_lampswitch1_002

When the input tag is ON, the lamp will turn ON.

 

parts_lampswitch1_004

When the alarm tag is true, the lamp display will turn to the alarm color (default is blinking orange).

 

parts_lampswitch1_003

When a fault occurs, the fault is displayed.

If a fault and an alarm occur simultaneously, the fault indication takes priority.

 

hint

If you are not using ON/OFF and alarms at the same time, for example if you want to display normal/abnormal only with the alarm signal, there is no need to use the alarm tag (_TagAlarmEx). In such cases, specify the tag path of the alarm signal in the input tag, and specify the color you want to display when an alarm occurs in the ON color (_LampOnColor) and the normal color in the OFF color (_LampOffColor).

 

 

4) Lamp display (2-point input)

 

The ON/OFF state is identified by two tags. When the value of the input tag is the ON value (_RaiseValue) and the value of input tag 2 is the OFF value (_LowerValue), the lamp displays "ON." When the value of the input tag is the OFF value (_LowerValue) and the value of input tag 2 is the ON value (_RaiseValue), the lamp displays "OFF."

 

_TagIn: Specify the tag path of the input tag

_TagIn2: Specify the tag path of input tag 2

_TagOut...unused

_TagOut2: Unused

_TagAlarmEx...optional

_TagFault...optional

_SwitchEnable: Disabled (False)

 

parts_lampswitch1_001

When the input tag is OFF and input tag 2 is ON, the lamp display will be OFF.

 

parts_lampswitch1_002

When the input tag is ON and input tag 2 is OFF, the lamp display turns ON.

 

parts_lampswitch1_005

If the value of the Input Tag and Input Tag 2 remain inconsistent for the detection wait time (for example, when both Input Tag and Input Tag 2 are False), the lamp display will turn to the abnormality color (the fill will flash yellow by default).

 

Other than that, the operation of the fault identification tag and alarm tag is the same as in the case of single input.

 

hint

In the case of one-point input, if the value of the input tag is different from either the ON value or the OFF value, the lamp display will change to the abnormal display color. In this case, the detection wait time is not applied and the display color will change immediately.

 

 

5) Lamp switch (1 input/1 output)

 

By specifying an output tag and enabling the switch function (_SwitchEnable), it will function as a single output lamp and switch. The switch behavior follows the switch type (_SwitchType) setting.

 

_TagIn: Specify the tag path of the input tag

_TagIn2: Unused

_TagOut: Specify the tag path of the output tag.

_TagOut2: Unused

_TagAlarmEx...optional

_TagFault...optional

_SwitchEnable: Enabled (True)

_SwitchType: Select the switch type according to your purpose.

 

Below is an example of operation for switch type "ALTERNATE_SWITCH".

 

parts_lampswitch1_001

When you click on the lamp switch part, the inverted ON value/OFF value of the input tag is written to the output tag.

The currently set value on the left is OFF, so the ON value will be written.

 

parts_lampswitch1_002

As a result of the ON value being written to the output tag, the input tag became the ON value and the lamp display turned ON color.

 

parts_lampswitch1_001

When you click again, the OFF value is written to the output tag and the lamp display turns OFF.

 

Other than that, the operation of the lamp display (color display by input tag, fault identification tag, and alarm tag) is the same as when used as lamp function only.

 

hint

If the same tag is used for both input and output, specify the same tag path for the input tag and output tag.

 

hint

By setting the "FocusHover" property of the form to which the component is attached to True, a focus frame will be displayed when you move the mouse cursor over the component to be operated.

 

hint

Switch operations are accepted even in an alarm or abnormal (conflicting) state. Switch operations are disabled in a fault state.

 

 

6) Lamp switch (2 inputs/2 outputs)

 

When you specify output tag and output tag 2 and enable the switch function (_SwitchEnable), it will function as a two-point output lamp and switch. The switch behavior follows the switch type (_SwitchType) setting.

 

_TagIn: Specify the tag path of the input tag

_TagIn2: Specify the tag path of input tag 2

_TagOut: Specify the tag path of the output tag.

_TagOut2: Specify the tag path of output tag 2

_TagAlarmEx...optional

_TagFault...optional

_SwitchEnable: Enabled (True)

_SwitchType: Select the switch type according to your purpose.

 

Below is an example of operation for switch type "ALTERNATE_SWITCH".

 

parts_lampswitch1_001

When you click the lamp switch part, the inverted ON value/OFF value of the input tag is written to the output tag and output tag 2.

The above is an OFF value, so the ON value is written to output tag and the OFF value is written to output tag 2.

 

parts_lampswitch1_002

The ON value was written to the output tag and the OFF value was written to output tag 2, causing the lamp display to turn ON.

 

parts_lampswitch1_001

If you click it again, the OFF value is written to the output tag and the ON value is written to output tag 2, and the lamp display turns OFF.

 

Other than that, the operation of the lamp display (color display by input tag, fault identification tag, and alarm tag) is the same as when used as lamp function only.

 

 

7) Confirmation screen display

 

If you enable the confirmation screen display (_IsConfirm), a confirmation dialog (Yes/No) will be displayed when you perform a write operation.

 

parts_dialog_confirm_001

If Yes is selected in the dialog, the value will be written to the tag.

 

 

 

8) Assigning values via script

 

You can display a lamp by assigning any numerical value from a script without specifying an input tag.

To assign a value directly from a script, assign one of the following values to the "_Value" property.

 

0: OFF (displayed with _LampOffColor)

1: ON (displayed by _LampOnColor)

-1 : NULL (displayed in _LampNullColor)

-2: Abnormal (displayed with _LampAbnormalColor)

-3: Fault (displayed in fault state (filled with _LampNullColor))

-4 : Alarm (displayed in _LampAlarmColor)

 

hint

If you assign values directly from a script, you are limited to using it as a lamp component. You cannot use the switch function, alarm tag, or fault identification tag.

For more information about scripts, see "Scripts".