set_button
[Version 1.5 or later]
Sets button parameters.
set_button <ButtonNumber>,<ParameterType>,<NewValue>
<ButtonNumber>
Number indicating the button location in all button arrangement on a TP operation panel.
<ParameterType>
Button attributes including color, position and others. (See the table below.)
<NewValue>
Parameter value for making new settings (See the table below.)
<Parameter Type>
|
Explanation
|
<NewValue> (Note 1)
|
---|---|---|
1
|
Upper left X coordinate
|
0 to 640 in dots
|
2
|
Upper left Y coordinate
|
0 to 350 in dots
|
3
|
Lower right X coordinate
|
0 to 640 in dots
|
4
|
Lower right Y coordinate
|
0 to 350 in dots
|
5
|
Button type
|
0: None
1: Label
2: Line
17: 2D button (Change variable)
18: 3D button (Change variable)
19: 3D button (Change variable)
20: Circle (Change variable)
33: 2D LED (lamp)
34: Circle LED (lamp)
35: 3D button (Change IO)
36: Reserved
37: Reserved
38: Box
|
6
|
Button status
|
0: Center characters
1: Left-justify characters
2: Right-justify characters
|
7
|
Background color
|
0: Black
1: Blue
2: Green
3: Cyan
4: Red
5: Magenta
6: Brown
7: Light gray
8: Gray
9: Light blue
10: Light green
11: Light cyan
12: Light red
13: Light magenta
14: Yellow
15: White
|
8
|
Text color
|
0: Black
1: Blue
2: Green
3: Cyan
4: Red
5: Magenta
6: Brown
7: Light gray
8: Gray
9: Light blue
10: Light green
11: Light cyan
12: Light red
13: Light magenta
14: Yellow
15: White
|
9
|
Usable state
|
0: Disable
1: Enable
|
10
|
Visible/invisible state
|
0: Invisible
1: Visible
|
11
|
Variable type (Note 2)
|
1: Integer
2: Floating point
3: Double-precision floating point
4: Character string (up to 32 characters)
|
12
|
Variable number
|
Variable number that may be changed by the change variable button.
|
13
|
I/O number
|
Variable number that may be changed by the change I/O button. (128 to 511)
|
14
|
Display page number
|
Page number in which the buttons are displayed.
|
(Note 1)
|
Always enter integers to <ParameterType>. Any other value will cause a "data tag error."
|
(Note 2)
|
A floating-point or double-precision floating-point number occupies 13- or 22-character space, respectively. Take it into account and reserve suitable spaces when programming a numeric entry button using floating point or double-precision variable.
|
set_button changes the current value of a parameter specified by <ParameterType> to <NewValue> to modify the specifications of a button specified by <ButtonNumber>.
*Sample of Button type
1: Label
2: Line
3: 2D button (Change variable)
4: 3D button (Change variable)
5: 3D button (Change variable)
6: Circle
7: 2D LED
8: Circle LED
9: 3D button (Change IO)
10: Box
'!TITLE "<Title>"
|
PROGRAM sample1
|
·
|
·
|
·
|
set_button (btn_no),(1),(minx)
|
set_button (btn_no),(2),(miny)
|
set_button (btn_no),(3),(maxx)
|
set_button (btn_no),(4),(maxy)
|
·
|
·
|
·
|
end
|