Lamps, Touch Switches, Numeral Setting
Section 6-5
6-5 Lamps, Touch Switches, Numeral Setting
This section describes the commands for operating the lamps, touch switches.
In order to change the display status (lit (flashing) or unlit) of a lamp or touch switch, use the Lamp and Touch Switch Display Commands. There are two such commands, one for bit specification and the other for number specification.
The Lamp and Touch Switch Display Status Enquiry Command is used to ascertain the status of a lamp or touch switch. When this command is executed the NT20 returns the Lamp/Touch Switch Display Status Response
Command.
Reference
When the status of an NT20 touch switch is changed - for example by pressing it - the Touch Switch Number Output Command is sent to the host. When a numerical value is input by pressing a touch switch to which a numeral setting function has been allocated, a Number Input Notify Command is sent to the host.
6-5-1 Notification and Control of Touch Switches
If a touch switch is pressed, the corresponding touch switch number or bit information is sent to the Host. Conversely, to turn ON a touch switch or cause it to flash, the touch switch # or bit information is sent from the Host.
The type of data relating to the touch switch notification is specified with the
“bit input attribute” in the screen attributes when creating the screen data with the Support Tool. It is not permissible to use both notification and control by a touch switch number and notification and control by bit information on the same screen.
Press
NT20 HOST
Cautions When Bit Input
Is Permitted
START abcde
Touch switch # or bit information
Lighting command
Lit
• Bit Touch Switch Method (Bit Input Permitted Setting)
If a touch switch is pressed, bit information is sent according to the position of the touch switch. It can be used as a normal bit input switch at the PLC.
When this method is used, if more than one touch switch is pressed at the same time, the information of all the pressed touch switches (0 to 63) is reported to the Host.
• Touch Switch # Method (Bit Input Not-permitted Setting
If the touch switch status is changed, the touch switch number set when the touch switch is created is sent as a 8-digit hexadecimal number.
If the touch switches are set in the following positions using the Support Tool while the setting is “bit input permitted”, the following operations will occur due to the configuration of the touch switches.
Take this into consideration when setting touch switch areas.
221
Lamps, Touch Switches, Numeral Setting
Section 6-5
Example 1:
Touch switches are set at positions A, B, C, and D using the minimum switch setting unit.
A
C
• If switches A, B, and C are turned ON at the same time, switch D is also set ON.
• Similarly, if switches A, B, and D are turned ON at the same time, switch C is also set ON.
D
B
Example 2:
Touch switch areas E, F, and G are set.
E
F
• If switches E and F are turned ON at the same time, switch G is also set ON.
Touch Switch Notification/ control and Attributes
G
Inverse and normal display states can be set as attributes of touch switches by using the Support Tool. There are slight differences in the operation when a touch switch is pressed depending on whether bit input is permitted or not permitted.
Simultaneous Pressing of
Multiple Touch Switches
Bit input not permitted: Touch switch notification by number
The touch switch is lit for 0.2 seconds when pressed and then returns to the unlit status.
Bit input permitted: Touch switch notification by bit information
The touch switch is lit while pressed and returns to the unlit status when released.
When a touch switch which is currently lit or flashing is pressed, it is continuously lit while pressed and returns to its original state when released.
Two or more touch switches can be simultaneously pressed if their status is sent by bit information or if they use different host notification methods. However, two or more switches cannot be simultaneously pressed if host is notified of their status by their numbers.
222
Lamps, Touch Switches, Numeral Setting
Section 6-5
Lamp and Touch Switch Display (Bit Specification)
Format
[ESC] K m0
1 m0
2 m1
1
1B 4B * * * * * * m1
2
* * m2
1
* * m2
2
* * m3
1
* * m3
2
* *
[CR]
0D m0 to m3: Specification of lamps and touch switches (2-digit hexadecimal)
The relationship between the lamp and touch switch number and an expression of m0 to m3 in bits is given in the following table.
Bit
Parameter m0 m1 m2 m3
7
07
15
23
31
6
06
14
22
30
mx
1
5
05
13
21
29
4
04
12
20
28
3
03
11
19
27
2
02
10
18
26
mx
2
1
01
09
17
25
0
00
08
16
24 mx1: Higher 4 bits of mx (x: 0 to 3) mx2: Lower 4 bits of mx
Bit ON: The lamp or touch switch is turned on (or caused to flash).
Bit OFF: The lamp or touch switch is turned off.
Example
To turn on lamps and touch switches with the numbers 1, 5, 6, 7, and 26
m01m02m11m12m21m22m31m32=E2000004
Description
• Changes the display status of the lamps or touch switches.
• Whether the lamp or touch switch which corresponds to the specified bit is turned on or flashes is determined by the setting made using the Support Tool.
• This command can be used only when the setting for the “LMP Bit Control” memory switch is “Enable”.
Lamp and Touch Switch Display (Number Specification)
Format
[ESC] Q
1B 51 m
1
* * n
1
* * n
2
* * m
1
: Display status
0 (30
H
): Not lit (normal display)
1 (31
H
): Lit
2 (32
H
): Flashing inverse
3 (33
H
): All not lit n
1 n
2
: Lamp or touch switch # (2-digit hexadecimal)
000 to FF
H
(0 to 255)
Description
Changes the lamp or touch switch lighting status.
223
Lamps, Touch Switches, Numeral Setting
Section 6-5
Specify the display status as 3 (all not lit) to turn off all the lamps and touch switches. In this case, specify the lamp or touch switch number to any number in the permitted range.
!Caution The display attributes set with the Support Tool determine if lamps #0 to #31 light continuously or flash. The display status set with this command is ignored.
Lamp and Touch Switch Display Status Enquiry
Format
[ESC]
1B
R
52 n
1
* * n
2
* * n
1 n
2
: Lamp or touch switch # (2-digit hexadecimal)
000 to FF
H
(0 to 255)
Description
Enquires the status of a lamp or touch switch specified by its address.
The NT20 returns the Lamp and Touch Switch Display Status Response
Command (refer to Lamp and Touch Switch Display Status Response below)
to report the display status.
Lamp and Touch Switch Display Status Response
Format
[ESC] S
1B 53 m
1
* * n
1
* * n
2
* * m
1
: Display status
0 (30
H
): Not lit (normal display)
1 (31
H
): Lit
2 (32
H
): Flashing inverse n
1 n
2
: Lamp or touch switch # (2-digit hexadecimal)
0 to FF
H
(0 to 255)
Description
The NT20 returns this command to report the lamp or touch switch number display status to the Host in response to the Lamp and Touch Switch Display
Status Enquiry Command (refer to Lamp and Touch Switch Display Status
Enquiry) sent from the Host.
Lamps 0 to 31 are reported as being lit when in the “flashing inverse” status.
Note
6-5-2 Notification of Numeral Setting Input and Touch Switch Status
The following describes the commands for notifying the host when numeral setting is performed (i.e., when the contents of a numeral memory table entry are changed by pressing a touch switch) or when a touch switch is pressed, when operating the NT20.
When a numerical value is input by numeral setting, the NT20 sends a Number Input Notify Command to the host. The command sent differs depending on whether a 4-digit or 8-digit number is input.
224
Lamps, Touch Switches, Numeral Setting
Section 6-5
When a touch switch is pressed, the NT20 sends a Touch Switch Number
Output Command or Touch Switch Bit Output Command to the host. The command sent depends on the set screen attributes.
Four-digit Number Input Notify
Format
[ESC] E [CR]
1B 45 d
1
* * d
2
* * d
3
* * n
1
* * n
2
* * n
3
* * n
4
* * 0D d
1 d
2 d
3
: Numeral memory table entry number to which number was input
(3-digit hexadecimal) 000 to 07F
H
(0 to 127) n
1 n
2 n
3 n
4
: Input number data (4-digit BCD)
Description
A number with 4 transferred digits set with the NT20 number setting function is reported to the Host with this command.
!Caution This command cannot be used for negative numbers. Always set “8” as the number of transferred digits when negative numbers may be input.
Eight-digit Number Input Notify
Format
[ESC] F
1B 46 d
1
* * d
2
* * d
3
* * n
1
* * n
2
* * n
3
* * n
4
* * n
5
* * n
6
* * n
7
* * n
8
* *
[CR]
0D d
1 d
2 d
3
:
Numeral memory table entry number to which number was input
(3-digit hexadecimal) 000 to 07F
H
(0 to 127) n
1 n
2 n
3 n
4 n
5 n
6 n
7 n
8
: Input number data (8-digit BCD)
Description
A number with 8 transferred digits set with the PT number setting function is reported to the Host with this command.
When a negative number is written, n1 becomes “F” (46H) and the number comprises 7 digits.
225
Lamps, Touch Switches, Numeral Setting
Touch Switch Number Output (from NT20 to Host)
Format
[ESC]
1B
H
48
Section 6-5
m
1
* * m
2
* *
[CR]
0D m
1 m
2
: Address of the pressed touch # (2-digit hexadecimal)
00 to E2
H
(0 to 226)
Description
If a touch switch is pressed while the screen for which the “Bit In = Off” attribute is set is displayed, the address of the pressed touch switch is reported to the Host.
Reference:
If more than one touch switch is pressed at the same time, only the address of the touch switch which was pressed first is reported to the Host.
Notification of numeral setting is not executed in the case of touch switches which have been allocated as ten keys.
Touch Switch Bit Output (from NT20 to Host)
Format
[ESC] J s0
1 s0
2
1B 4A
* * * * s1
1
* * s1
2
* * s2
1
* * s2
2
* * s3
1
* * s3
2
* *
[CR]
0D s0,... s3: Status of the touch switch (2-digit hexadecimal value for each switch)
The relationship between the touch switch number and an expression of s0 to s3 in bits is given in the following table.
Bit
Parameter s0 s1 s2 s3
7
07
15
23
31
6
06
14
22
30
sx
1
5
05
13
21
29
4
04
12
20
28
3
03
11
19
27
2
02
10
18
26
sx
2
1
01
09
17
25
0
00
08
16
24 sx1: sx2:
Bit ON:
Bit OFF:
Higher 4 bits of sx (x: 0 to 3)
Lower 4 bits of sx
The touch switch is on.
The touch switch is off.
Example
Touch switches at addresses 0, 3, 21, and 27 are ON
s01s02s11s12s21s22s31s32=09002008
Description
• If the touch switch status is changed while the screen for which the “Bit
Input, Touch Switch” attribute is set is displayed, the status of the corresponding bit is reported to the Host.
• This report is made each time a touch switch is turned ON or OFF.
226