- No category
advertisement
User Interface Panel User Manual
UIF-420A
* Safety Precautions
Safety precautions are for your correct and safe use of the product to prevent accidents. Therefore, you MUST keep these safety measures.
Warning
1. When there is a danger of accident related to this product’s malfunction or anomaly, help prevent an accident by
installing a double shutdown circuit externally.
2. Do not use this product where there is flammable gas, explosive gas, humidity, direct sunlight, radiation, vibration or
impact.
3. Never disassemble, improve or repair this product.
4. To prevent damage or malfunction of this product, always only use the specified power source.
Precautions
1. Avoid places where there are reactance (e.g., near power line or load line), static or magnetic noise.
2. Use the product in the temperature range of 0~50℃ and humidity in the range of 35~85% RH ( without dew
condensation
).
3. When cleaning the product, do NOT use water or any organic solvent. Instead use a dry towel to clean the product.
4. Always detach the product after the power is turned off. Otherwise, malfunction or damage may occur.
5. Do not let dirt or a foreign object inside the product.
1. Product Summary
- This product (i.e., UIF-420A) provides an easier-to-use user interface (UI) that is a must in industrial controller design.
- It has a built-in 20 x 4 character LCD and 23 keys to communicate with the main controller through RS232 or
I2C/ SPI communication port.
COMFILE Technology, Inc.
www.comfiletech.com • page
1
User Interface Panel User Manual
UIF-420A
- When CUBLOC is used as the main controller, since the commands such as PRINT and GETPAD are supported to facilitate the use of the UI.
- When this product is used with other main controllers (MCUs), it still provides a friendly UI, as data is transmitted through UIF-420A to be displayed on the LCD, and input typed on UIF-420A is transmitted to the main controller.
2. The Product’s Main Features
1) Key inputs are transmitted through SPI or RS232 protocol.
2) A built-in 20 x 4 character LCD on which I
2
C/SPI or RS232 protocol can be displayed
3) Software-controlled backlight ON/OFF
4) Four (4) on/off LEDs
5) A buzzer sound that can be controlled down to milliseconds
6) Key buzzer sound ON/OFF feature
7) All keys’s working condition and each key value can be checked.
8) RS232C communication speed can be selected from 4800 to 115200 bps.
9) CuNET(I
2
C) address that can be selected from 0 to 7.
3. Product Specification
1) Power specification
Voltage
9~24 VDC
Power Consumption
1.2 W, Max 1.6 VA
2) Operation Range
Temperature
0~50 ℃
Humidity
35~85 % RH (without dew condensation)
3) Membrane
Switch life
100,000 pushes
Force
250 gf
4) Interface
RS232
Transmission Speed
Communication Protocol
4800 ~ 115200 bps
Full Duplex
Synchronization Asynchronous
Transmitted Data Format 1 Stop bit, No Parity and 8 Data bits
UIF Communication Distance Max. 7 meters
SPI
Data Communication Order
SCK Signal
SCK sampling position
MSB first
Low -> High -> Low
(remains LOW when there is no communication.)
Rising edge
UIF Communication Distance Max. 1 meter
I2C
Address 0 to 7
Synchronization Synchronous
UIF Communication Distance Max. 1 meter
Comfile Technology, Inc. www.comfiletech.com • page
2
4. Exterior and Panel Dimensions
▌Panel Dimensions
User Interface Panel User Manual
UIF-420A
Comfile Technology, Inc. www.comfiletech.com • page
3
▌Exterior Dimensions
User Interface Panel User Manual
UIF-420A
Comfile Technology, Inc. www.comfiletech.com • page
4
▌Back
5. Names and Functions of Parts
▌Front
▌Bottom
User Interface Panel User Manual
UIF-420A
No.
①
②
③
④
Name
LED
Function
LED ON/OFF
Text Strip Writable paper labels
Character
LCD displays English alphabets, numbers and symbols
Key
Key value is transmitted in
RS232 or SPI
No.
⑤
⑥
⑦
⑧
,⑨
Name
Connector
Connector
Switch
Power
Inputs
Function
SPI communication connector port
I2C communication connector port
- RS232 communication speed setting
- I2C address setting
- RS232 and I2C mode setting
- Check all keys’ status and check key value
- Key buzzer sound ON/OFF
DC 9~24V
No.
⑩
⑬
Name
3Ø tab
Connector
Function
A support is connected here when a board is connected to the backside.
⑪ VR adjusts the brightness of the
LCD
⑫ Connector RS232
Input voltage, 5V, RS232,
I2C, SPI connection
Comfile Technology, Inc. www.comfiletech.com • page
5
User Interface Panel User Manual
UIF-420A
6. PIN Connection
▌Backside Connector ⑬
2
1
20
19
Pin No. Explanation
2 SDA
5 SS
7 MOSI
8 MISO
12 TXD
* 5V RXD → connects to CUBLOC or a microcontroller’s TXD
5V TXD → connects to CUBLOC or a microcontroller’s RXD
When 5V RS232 is used connector ⑫’s 12V RS232 cannot be used.
19,20
3,4,9,10,
13,14,17,18
Input voltage output (DC 9~24V)
GND
(* Male: HRS PCN10-20P-2.54DSA K / Female: HRS PCN10C-20S-2.54DSA K)
▌ Backside Connector ⑫
5
9
1
6
* When 12V RS232 is used connector ⑫’s 5V
Pin No.
3
5
RS232
Explanation
±12V RS232 RX terminal
GND terminal
※ When UIF and PC are connected a direct cable is used.
TX
RX
RX
TX
GND GND
UIF RS232 PC RS232
Comfile Technology, Inc. www.comfiletech.com • page
6
User Interface Panel User Manual
UIF-420A
▌Bottom Connector ⑥
1
3
Pin No. Explanation
1 GND
3 SDA
▌ Bottom Connector ⑤
1
5
Pin No. Explanation
1 GND
2 MISO
3 MOSI
4 SCK
5 SS
▌ Bottom Connector ⑧
GND
DC 9~24V
▌ Bottom Connector ⑨
GND
DC 9~24V
Comfile Technology, Inc. www.comfiletech.com • page
7
7. External Wiring Diagram
▌When connecting via RS232
User Interface Panel User Manual
UIF-420A
POWER
▌When connecting via I2C or SPI
POWER
Comfile Technology, Inc. www.comfiletech.com • page
8
User Interface Panel User Manual
UIF-420A
8. Bottom Switch (⑦) Setting
SW1, SW2, SW3
( O=ON, X=OFF )
X, X, X
X, X, O
X, O, O
X, O, O
O, X, X
O, X, O
O, O, X
O, O, O
RS232
Comm. Speed
19200
4800
9600
19200
28800
38400
57600
115200
I2C
Address
0
1
2
3
4
5
6
7
SW4
ON: I
2
C / SPI OFF: RS232
#1
SW5
ON: Key Buzzer OFF OFF: Key Buzzer ON
#2
SW6
ON: All keys status check and key value check
#3
(* A new switch setting takes effect only when power is turned off and on again.)
#1 --> Via RS232 communication RS232 MODE transmits key value and displays English letters, symbols and numbers on the character LCD. On the other hand, the I2C/SPI MODE uses SPI communication to transmit key value, and or uses I2C communication to display English letters, symbols and numbers on the character LCD.
#2 --> Whenever a key is pressed, a short buzzer sound is made. This buzzer sound can be turned on/off using switch 5 (SW5).
#3 --> When the power is turned on with SW6 in ON state, the UIF checks the status of all the keys. If there is a problem, such is displayed on the character LCD as “KEY STATE: NO-GOOD”. When all keys operate normally, the character LCD displays: “KEY STATE: GOOD”, “KEY VALUE:”. And when the key is pushed, the key value is displayed in decimals. (Using this mode, one can find out the key value that was transmitted to SPI or RS232.)
9. LCD Control Commands
When an ASCII code is sent to UIF, the corresponding ASCII code’s content is displayed on the LCD screen. But when you want special effects such as changing the position of the cursor or clearing the entire screen, you need to use a control code.
UIF’s LCD control command begins with an escape code (ESC which is represented by HEX code 1B) followed by one English character, which is followed by necessary parameters.
▌UIF Setting to use the LCD with CUBLOC
Set Display n1, n2, n3, n4
- Parameter n1: 2=CLCD
- Parameter n2: 0=CuNET(I2C), 1=RS232 CH1, 2=RS232 CH2, 3=RS232 CH3
- Parameter n3: RS232C communication speed and CuNET(I2C) address
- Parameter n4: transmission buffer size
- Example of transmission using RS232 CH1: Set Display 2, 1, 19200, 200
Comfile Technology, Inc. www.comfiletech.com • page
9
▌Character LCD Cursor ON
ESC S
1 byte 1 byte
- Operation: turns cursor on.
- Transmission Example: displays cursor.
(Hexadecimal) 1B 53
(SetDisplay) Csron , (Opencom) OC_Csron
▌ Character LCD Cursor OFF
ESC s
1 byte 1 byte
- Operation: turns cursor off.
- Transmission Example: displays cursor.
(Hexadecimal) 1B 73
(SetDisplay) Csroff , (Opencom) OC_Csroff
▌Clear Character LCD
ESC C
1 byte 1 byte
- Operation: clears the entire screen.
- Transmission Example: clears the entire screen.
(Hexadecimal) 1B 43
(SetDisplay) Cls . (Opencom) OC_Cls
* After this command is issued, about 20ms of delay is needed.
▌Set Character LCD’s Character Coordinate
1 byte 1 byte 1 byte 1 byte
- parameter n1: LCD x axis (See explanation for coordinates.)
- parameter n2: LCD y axis (See explanation for coordinates.)
- Operation: Sets the position of characters or symbols on the screen.
- Transmission Example: x-axis 0, y-axis 0
(Hexadecimal) 1B 4C 00 00
(SetDisplay) Locate 0, 0
(Opencom) OC_ Locate 0, 0
User Interface Panel User Manual
UIF-420A
Comfile Technology, Inc. www.comfiletech.com • page
10
User Interface Panel User Manual
UIF-420A
▌Character LCD BACK LIGHT ON/OFF
1 byte 2 bytes 1 byte
- parameter n: 0=OFF, 1=ON
- Operation: turns the LCD’s back light on/off.
- Transmission Example: Backlight ON
(Hexadecimal) 1B 42 4C 01
(SetDisplay) Light 1
(Opencom) OC_Light 1
▌LED ON/OFF
1 byte 1 byte 1 byte
- parameter n1: LED selection (1~4)
1 byte
- parameter n2: 0: OFF, 1: ON
- Operation: can choose an LED to turn ON or OFF.
- Transmission Example: Turn the 2 nd LED ON.
(Hexadecimal) 1B 45 02 01
(SetDisplay) Print 27, 69, 2, 1 (Opencom) OC_Led 2, 1
▌Set Buzzer ON Time
1 byte 1 byte 1 byte 1 byte
- parameter n1: buzzer sound time lower limit
- parameter n2: buzzer sound time upper limit
- Operation: sounds the buzzer as long as specified in the command.
- Transmission Example: 700 mS buzzer sound
(Hexadecimal) 1B 5A BC 02
(SetDisplay) Print 27, 90, 188, 2 (Opencom) OC_BZ 700
▌Send With Check Byte
ESC H
1 byte 1 byte
- Operation: When the UIF sends a key value to an external device, a regular data byte and its inversed data byte value is transmitted, a total of 2 bytes. (The receiver compares the date value of the two bytes to check for transmission error.)
- Transmission Example:
(Hexadecimal) 1B 48
(SetDisplay) Print 27,72 (Opencom) OC_SWCB
Comfile Technology, Inc. www.comfiletech.com • page
11
10. Key Scan Code
UIF420A has a total of 23 keys and each key has its own unique scan code assigned.
User Interface Panel User Manual
UIF-420A
Comfile Technology, Inc. www.comfiletech.com • page
12
User Interface Panel User Manual
UIF-420A
#. UIF-420A Beginner’s Guide (when using I2C or SPI)
▌How to connect CUBLOC and UIF-420A via I2C or SPI connection
CUBLOC (CUSB-22R) and UIF-420A are connected as follows:
RS232C download Keypad (SPI)
CUNET (I2C) AC220V Power Input 9V DC Power Input
Set UIF-420A’s dipswitches as in the picture below (i.e., only SW4 ON, the rest OFF).
By setting SW4 ON, select I2C (CUNET) communication. Remember that you MUST turn the power off and on again after a new dip switch setting, as the new dipswitch setting is read in when the power is turned back on.
Comfile Technology, Inc. www.comfiletech.com • page
13
Open CUBLCO Studio, input a simple source code shown below and download it.
User Interface Panel User Manual
UIF-420A
Then in the UIF’s LCD window the text “COMFILE” will be displayed, and when a key is pressed the corresponding scan code will also be displayed.
Comfile Technology, Inc. www.comfiletech.com • page
14
User Interface Panel User Manual
UIF-420A
The following is a line-by-line description.
Const Device = CB280 ‘Declare device
Dim A As Integer ‘Declare variable
Set Display 2,0,0,200 ‘Declare display mode, CLCD mode, I2C type, address 0, buffer size as 200 bytes
Set Pad 0,1,20 ‘Declare key input mode, SPI type, buffer size as 20 bytes
On Pad Gosub ABC ‘On key input jump to label ABC in the source code.
Cls ‘Clear screen
Wait 10
Csroff
Locate 0,0
‘Have delay of 10 milliseconds
‘Cursor OFF
‘Set cursor position
Print "COMFILE" ‘Print character string on screen.
Do ‘Infinite Looping
Loop
ABC:
A=Getpad(1) ‘Read the key input value of 1 byte and store it in variable A
Locate 1,1 ‘Set cursor position
Print Hex2 A ‘Print the A value in Hexadecimal
Return
<This source code is from UIF420A_TEST1.CUL file. One can go to www.comfiletech.com
and then to UIF420A where this file can be downloaded.>
Comfile Technology, Inc. www.comfiletech.com • page
15
▌Converting Scan Codes to Meaningful Data using a Table
User Interface Panel User Manual
UIF-420A
<The original key scan codes of UIF-420A>
As you can see in the above picture, scan codes are random values unrelated to the displayed key labels on the product. Therefore, it is better to use converted values.
For example, since a value of 3 is transmitted when the key labeled “1” is pressed, using the table conversion we can convert the value 3 to 1. In this manner, the other keys’ scan code can be converted to respective corresponding values. This process is called “table conversion.”
Const Device = CB280
Dim SCODE1 As Byte
Dim SCODE2 As Byte
Dim SCODE3 As Byte
Const Byte SCANCODETB = (&HFF,19,15,1,2,3,20,16,_
4,5,6,21,17,7,8,9,22,18,10,0,11,&HFF,&HFF,12,13,14)
Dim A As Integer
Set Display 2,0,0,200
Set Pad 0,1,20
On Pad Gosub KEYPROCESS
Print 27,72 ' TWO BYTE SYSTEM
Cls
Wait 10
Csroff
Locate 0,0
Print "COMFILE"
Do
Loop
KEYPROCESS:
SCODE1=Getpad(1)
SCODE2=Getpad(1)
Debug HEX2 SCODE1, HEX2 SCODE2,Cr
SCODE2 = Not SCODE2
If SCODE1 <> SCODE2 Then Return ‘
Å If two key values are not the same, then ignore the values.
Print DEC2 SCODE3
Return
Comfile Technology, Inc. www.comfiletech.com • page
16
User Interface Panel User Manual
UIF-420A
<This source code is from UIF420A_TEST2.CUL file, which can be downloaded from website
www.comfiletech.com
’s UIF420A page.>
Owing to the above program (i.e., source code), the UIF’s keys’ values are converted as shown in the picture below.
That is, when a number key is pressed, the code of same value (as labeled) is transmitted; and other keys when pressed transmit a values larger than 10.
<The Key Code Values obtained via Table Conversion>
Regarding 2-Byte Reception
In this program, there is a command which transmits key data in 2 bytes. Originally a scan code is only 1 byte. But here the original byte’s inverted value is sent together with the original byte to prevent error or noise that may happen during communication.
PRINT 27,72
Once this command is executed, whenever a key is pressed a 2-byte value is transmitted. The above source code includes a part which compares the original byte and its inversion, and ignores the transmitted value if the two values differ.
Comfile Technology, Inc. www.comfiletech.com • page
17
User Interface Panel User Manual
UIF-420A
#. UIF-420A Beginner’s Guide (when RS232C is used)
▌How to connect CUBLOC and UIF-420A via RS232C
When CUBLOC (CUSB-22R) and UIF-420A are far apart, it is safer to use RS232 connection to send and receive data. The two devices are connected as shown in the picture below.
Here the RS232 cable should be a cross cable where both ends are of DSUB-9pin-MALE type. Cross cable is a type of RS232 cable where the Pin 2 and Pin 3 are crossed.
6
1
2
6
1
2
9
4
3
5
9
4
3
5
Just connect the 3 lines: pins 2,3 & 5.
Here all dip switches should be OFF in this RS232 mode and the Baud rate should be 19200.
Comfile Technology, Inc. www.comfiletech.com • page
18
Input source code as follows:
Const Device = CB280
Dim A As Integer
Dim B As Integer
Opencom 1,19200,3,50,50 ‘
Å Open the Chappen 1 an RS232 channel.
Set Uif 2,1 ‘
Å Use this command to set the type.
On Recv1 Gosub ABC ‘
Å Jump to ABC when a key is pressed.
Cls
Wait 10
Csroff
Locate 0,0
Print "COMFILE"
Do
Print LOC,10,0,Dec B
User Interface Panel User Manual
UIF-420A
Loop
ABC:
A=Get(1,1) ‘
Å Bring data from RS232 receive buffer.
Print LOC,1,1,Hex2 A
Return
SET UIF command is a command supported for UIF in CUBLOC STUDIO version 3.0.d or higher.
SET UIF <display type>, <channel no.> display type
: 1 = UIF416H, 2 = UIF420A
channel no.
: 1 = RS232 Ch1, 2 = RS232 Ch2, 3 = RS232 Ch3
When UIF is used in the RS232 mode, first the RS232 channel has to be opened using the OPENCOM command, and then the display type has to be specified using the SET UIF command.
When a key is pressed, data is received via RS232 Ch1. The data value can be checked using the GET command.
<THE END>
Comfile Technology, Inc. www.comfiletech.com • page
19
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project