PIStudio Manual
  • 1. Welcome
  • 2. Installation
  • 3. Getting Started
    • 3.1 Creating a project
    • 3.2 Configuring communication
    • 3.3 Configuring the Screens
    • 3.4 Compiling project
    • 3.5 Simulation
    • 3.6 Download project
  • 4. Software Menu
    • 4.1 Home Menu
      • 4.1.1 Project
      • 4.1.2 Edit
      • 4.1.3 Screen
      • 4.1.4 Appearance
      • 4.1.5 Tool
      • 4.1.6 Help
    • 4.2 Project menu
    • 4.3 Project screens menu
  • 5. Project Settings
    • 5.1 Project Settings
    • 5.2 HMI IP
    • 5.3 Installment
    • 5.4 Extend
    • 5.5 Security
  • 6. Object
    • 6.1 Buttons/Switchs
      • 6.1.1 Bit switch
      • 6.1.2 Bit lamp
      • 6.1.3 Word switch
      • 6.1.4 Word lamp
      • 6.1.5 Keypad switch
      • 6.1.6 Function switch
      • 6.1.7 Combination switch
      • 6.1.8 Slider Switch
    • 6.2 Input/Display
      • 6.2.1 Numeric Input/Display
      • 6.2.2 Character Input/Display
    • 6.3 Charts
      • 6.3.1 Common settings in Chart objects
      • 6.3.2 Alarm Record Display
      • 6.3.3 Data Record Display
      • 6.3.4 Recipe display
      • 6.3.5 File list
      • 6.3.6 History Trend Chart
      • 6.3.7 Trend Chart
      • 6.3.8 XY Plot
      • 6.3.9 History XY Plot
    • 6.4 Meters
      • 6.4.1 Pointer Meter
      • 6.4.2 Clock
      • 6.4.3 Bar
      • 6.4.4 Runbar
    • 6.5 Display
      • 6.5.1 Indirect window
      • 6.5.2 QR code
      • 6.5.3 Drop-Down list
      • 6.5.4 Flow component
      • 6.5.5 Picture
      • 6.5.6 Rotation picture
      • 6.5.7 Camera display
      • 6.5.8 Camera Control
      • 6.5.9 Printer
    • 6.6 Draw
      • 6.6.1 Date
      • 6.6.2 Time
      • 6.6.3 Text
      • 6.6.4 Table
      • 6.6.5 Line
      • 6.6.6 Polygon
      • 6.6.7 Cycle/ Ellipse
      • 6.6.8 Arc
      • 6.6.9 Rectangle
      • 6.6.10 Broken line
      • 6.6.11 Linear scale
      • 6.6.12 Arc scale
    • 6.7 Custom Object
    • 6.8 Common Settings
      • 6.8.1 General window
      • 6.8.2 Text
      • 6.8.3 Graphic
      • 6.8.4 Security
      • 6.8.5 Animation
  • 7. Library
    • 7.1 Shape
    • 7.2 Address Library
    • 7.3 Text library
    • 7.4 Font Library
    • 7.5 Address Mapping
  • 8. Basic Functions
    • 8.1 Address Editor
    • 8.2 Installment
    • 8.3 Data Record
    • 8.4 Alarm
      • 8.4.1 Bit alarm
      • 8.4.2 Word alarm
    • 8.5 Recipe
    • 8.6 Trend Chart
    • 8.7 History XY Plot
    • 8.8 User Permission
    • 8.9 MessagePrompt
  • 9. Scripts
    • General script
      • 9.1 Script type
      • 9.2 Script usage
      • 9.3 Script Functions List
      • 9.4 Function Description
    • Lua script
      • 9.5 Lua Editor
      • 9.6 Lua Script Interfaces
      • 9.7 Lua Shortcut Hotkey
  • 10. Advanced Functions
    • 10.1 Remote Access
    • 10.2 Camera
    • 10.3 Email
    • 10.4 Video Player
    • 10.5 Audio Player
    • 10.6 LAN Monitoring
    • 10.7 USB keyboard
  • 11. PLC Protocols
    • 11.1Allen-Bradley FreeTag Ethernet/IP (CompactLogix)
    • 11.2 Allen-Bradley MicroLogix
    • 11.3 Barcode Scanner
    • 11.4 EPSON-TM-T82II/TM-XXX
    • 11.5 Hitachi EHV Series (Ethernet)
    • 11.6 IEC60870-5 104 Client
    • 11.7 LG XGK FEnet Ethernet
    • 11.8 Mitsubishi FX1S, 1N, 2N series
    • 11.9 Mitsubishi FX5U Ethernet
    • 11.10 Mitsubishi FX5U serial port
    • 11.11 Mitsubishi L02 MELSEC (Ethernet)
    • 11.12 Mitsubishi QJ71E71 Ethernet
    • 11.13 MODBUS RTU Master
    • 11.14 MODBUS RTU Slave (All function)/(All function OneBaseAddress)
    • 11.15 MODBUS TCP Slave (All function)
    • 11.16 Omron EC55
    • 11.17 Omron NX Ethernet/IP
    • 11.18 OpenCAN
    • 11.19 SHIMADEN FP23 protocol
    • 11.20 SHIMADEN SR90 protocol
    • 11.21 SHIMADEN Standard protocol
    • 11.22 Siemens S7-200 Smart (Ethernet)
    • 11.23 Siemens S7-300
    • 11.24 Siemens S7-1200 Ethernet
    • 11.25 Siemens Logo
    • 11.26 Siemens S7-XXX Ethernet
    • 11.27 User defined protocol
    • 11.28 WECON PLC LX2V/ LX2E/ LX3V/LX3VP/LX3VE/LX3VM
    • TSPL printer protocol user manual
  • 12. HMI internal registers
    • 12.1 System special address (HUW/HUX)
    • 12.2 System special address (HSW/HSX)
  • 13.Tools
    • 13.1 Off-line
    • 13.2 On-line
    • 13.3 USB flash disk download
    • 13.4 Font Pack
    • 13.5 Address List
    • 13.6 Decompile
    • 13.7 Password Tool
    • 13.8 Download Tool
  • 14. Others
    • 14.1 Setup Menu
    • 14.2 Touch Screen Calibration
    • 14.3 Levi2PI
Powered by GitBook
On this page

Was this helpful?

  1. 10. Advanced Functions

10.7 USB keyboard

Previous10.6 LAN MonitoringNext11. PLC Protocols

Last updated 5 years ago

Was this helpful?

Introduction

1) HMI support keyboard via USB port of HMI.

2) When the keyboard function is enabled, the “Cursor Display” function is enabled by default. The user could move the cursor through the “up, down, left and right buttons” of the keyboard, and then press the Enter key to select the object.

3) Multiple devices could be connected with HMI via USB HUB (up to 4 external devices), such as: mouse, keyboard, scanner, magnetic stripe reader, etc.

Configuration

1) Enable function

In the software [Settings menu], Click [Project settings]-> [Extend], and check [Enable keyboard] in [Input device] settings area as below shows.

2) Configuration decryption

 When the keyboard function is enabled, the “Cursor Display” function is enabled by default. The user could move the cursor through the “up, down, left and right buttons” of the keyboard, and then press the Enter key to select the object;

 NumLock: When NumLock key is not lit, the keypad number is not allowed to be input (offline simulation does not allow all numeric keys to be input, including the numeric keys on the left side of the keyboard);

 Key combination: (1) "Shift" + the left side of the keyboard and the special symbol button, to achieve special character input, such as: ~ ! @ # $ % ^ & * ( ) _ + { } : " < > ? ;

 Use the system special addresses "HSW1073 and HSW1074" to write custom key combinations in the script (currently only two key combinations are supported);

 Caps Lock: In lowercase mode, shift+ letters, to enter uppercase; in uppercase mode, shift+ letters enter lowercase;

3) System special address

In practical application, the [Enable Keyboard] function could be combined with the related "system special address" to achieve multi-key combination operation.

Address

Description

Function

HSW1073

Keyboard key value

The currently pressed key value is displayed. The key value is shown in Table 1

(The Numeric/Character display object is not updated when it is being entered)

HSW1074

Keyboard key status

Display current key states

=0: key release

=1: key press

=2: Press and hold long

(The Numeric/Character display object is not updated when it is being entered)

HSW1075

Cursor speed

Control the movement speed of the cursor, the range is 0~100, the default is 20

HSW1076

X coordinate value of cursor

The X value of the current position of the cursor, range: 0~screen width-1

HSW1077

Y coordinate value of cursor

The Y value of the current position of the cursor, range: 0~screen height-1

HSW1078

The ASCII code of keyboard key

Only the ASCII values of letters, numbers, and symbols are displayed. The ASCII value of the function keys is not displayed, as shown in Table 2

(The Numeric/Character display object is not updated when it is being entered)

HSW1079

Enable cursor position and Enter key mode

HSX1079.0 = 1: Set the cursor position according to HSW1076 and HSW1077 value;

HSX1079.1 = 0: When Numeric/Character display object is entered, enter key is for end input instruction. When no Numeric/Character display object is entered, enter key is for normal click;

HSX1079.1 = 1: Enter key only for normal click, not for keyboard end input instruction;

Key-value appendix table (decimal) (104 keys)

Key

Value

Key

Value

Key

Value

ESC

1

i I

23

Alt (Right)

100(offline: 56)

F1

59

o O

24

windows(Right)

126(offline: 125)

F2

60

p P

25

Menu

127

F3

61

[ {

26

Right_ctrl

97(offline: 29)

F4

62

] }

27

Print Screen

99

F5

63

Enter

28

ScrollLock

70

F6

64

CapsLock

58

PauseBreak

119

F7

65

a A

30

Insert

110

F8

66

s S

31

Home

102

F9

67

d D

32

PageUp

104

F10

68

f F

33

Delete

111

F11

87

g G

34

End

107

F12

88

h H

35

PageDown

109

` ~

41

j J

36

↑

103

1 !

2

k K

37

↓

108

2 @

3

l L

38

←

105

3 #

4

; :

39

→

106

4 $

5

' "

40

NumLock (Keypad)

69

5%

6

\ |

43

/ (Keypad)

98 (offline 53)

6 ^

7

Shift (Left)

42

* (Keypad)

55 (offline: 9)

7 &

8

z Z

44

- (Keypad)

74 (offline: 12)

8 *

9

x X

45

+ (Keypad)

78 (offline: 13)

9 (

10

c C

46

Enter (Keypad)

96

0 )

11

v V

47

. (Keypad)

83 (offline: 9)

- _

12

b B

48

0 (Keypad)

82 (offline: 11)

+ =

13

n N

49

1 (Keypad)

79 (offline: 2)

Backspace

14

m M

50

2 (Keypad)

80 (offline: 3)

Tab

15

, <

51

3 (Keypad)

81 (offline: 4)

q Q

16

. >

52

4 (Keypad)

75 (offline: 5)

w W

17

/ ?

53

5 (Keypad)

76 (offline: 6)

e E

18

Shift (Right)

54 (offline : 42)

6 (Keypad)

77 (offline: 7)

r R

19

Ctrl (Left)

29

7 (Keypad)

71 (offline: 8)

t T

20

Windows(Left)

125

8 (Keypad)

72 (offline: 9)

Y y

21

Alt (Left)

56

9 (Keypad)

73 (offline: 10)

u U

22

space

57

ASCII code

Code

Value

Code

Value

Code

Value

Code

Value

32

space

56

8

80

P

104

h

33

!

57

9

81

Q

105

i

34

"

58

:

82

R

106

j

35

#

59

;

83

S

107

k

36

$

60

<

84

T

108

l

37

%

61

=

85

U

109

m

38

&

62

>

86

V

110

n

39

'

63

?

87

W

111

o

40

(

64

@

88

X

112

p

41

)

65

A

89

Y

113

q

42

*

66

B

90

Z

114

r

43

+

67

C

91

[

115

s

44

,

68

D

92

\

116

t

45

-

69

E

93

]

117

u

46

.

70

F

94

^

118

v

47

/

71

G

95

_

119

w

48

0

72

H

96

`

120

x

49

1

73

I

97

a

121

y

50

2

74

J

98

b

122

z

51

3

75

K

99

c

123

{

52

4

76

L

100

d

124

|

53

5

77

M

101

e

125

}

54

6

78

N

102

f

126

~

55

7

79

O

103

g

Scripts example

'HSW1073 key value

'HSW1074 key states 0: released; 1: pressed; 2: Holding pressed

'HSW1078 ASCII value of key

1) Example 1

if @W_HSW1073 = 29 then 'Ctrl key value is 29

if @W_HSW1074 = 1 or @W_HSW1074 = 2 then 'Press Ctrl key

@W_HDW1000 = 1

else 'Release Ctrl key

@W_HDW1000 = 0

endif

endif

2) Example 2

if @W_HSW1073 = 59 and (@W_HSW1074 = 1 or @W_HSW1074 = 2) then 'F1 key value is 59

if @W_HDW1000 = 1 then 'Combination Ctrl + F1

@W_HDW2000 = @W_HDW2000 + 1 'Function of combination key is HDW2000 + 1

endif

endif

3) Example 3

if @W_HSW1073 = 60 and (@W_HSW1074 = 1 or @W_HSW1074 = 2) then 'the value of F2 is 60

if @W_HDW1000 = 1 then 'Combination Ctrl + F2

@W_HDW2000 = @W_HDW2000 - 1 'Function of combination key is HDW2000 - 1

endif

endif

4) Example 4

if AsString(@W_HSW1078) = "a" and (@W_HSW1074 = 1 or @W_HSW1074 = 2) then ' Page up

if @W_HSW13 > 0 then

@W_HSW13 = @W_HSW13 - 1

endif

endif

5) Example 5

if AsString(@W_HSW1078) = "b" and (@W_HSW1074 = 1 or @W_HSW1074 = 2) then 'Page down

@W_HSW13 = @W_HSW13 + 1

if @W_HSW13 > 3 then

@W_HSW13 = 3

endif

endif