当前位置:首页 - 常见问题解答 >

电脑弹簧机按键板的设计采用了是哪些原理?

来源: http://www.diannaothj.com    时间:2019-06-05 17:40:12 作者:山东银丰弹簧机设备

按键板,作为一个人机交互的操作界面,起着输入操作命令,编辑弹簧加工程序及修正数据的功用,对电脑弹簧机的操作控制起着重要作用。在实践应用中,为便当操作,需求将按键板的按键汉字化和直接化,这使得运用规范的PC键盘不太可能,所以开发一块廉价且通用的按键板就很有理想意义。
Keyboard, as a man-machine interactive operation interface, plays an important role in inputting operation commands, editing spring processing program and correcting data, and plays an important role in the operation and control of computer spring machine. In practice, in order to operate conveniently, it is necessary to make the keyboard Chinese characters and direct, which makes it impossible to use a standard PC keyboard. Therefore, it is ideal to develop a cheap and universal keyboard.
在PC机中,键盘和主机的通讯采用的是PS/2协议,由于电脑弹簧机的控制器是一个规范的工控PC机控制器,具有规范的键盘接口,为了使设计简单和通用,在这里运用这个规范的键盘接口,并采用PS/2协议来停止按键板和弹簧机械的通讯,设计时选用单片机AT89S51作为按键板的处置芯片停止按键的辨认和数据的接纳和发送。
In PC, the communication between keyboard and host computer is based on PS/2 protocol. Because the controller of computer spring machine is a standard industrial PC controller with a standard keyboard interface, in order to make the design simple and universal, this standard keyboard interface is used here, and PS/2 protocol is used to stop the communication between keyboard and spring machine. In the design, AT89S51 single chip computer is selected as the press. The disposal chip of the keyboard stops the identification of keys and the acceptance and transmission of data.
电脑弹簧机按键板采用薄膜面板开关方式,薄膜面板开关设计简单,操作便当,安放容易,直接贴在一外表就可运用,加上其防水防尘的性能,很合适工业控制的应用场所。对一个弹簧机械的按键板来说,其按键包括三类:数字键,功用键和编辑键。数字键完成的是数字的输入;功用键对应的是弹簧机的操作命令;编辑键用于对电脑卷簧机加工程序的编辑,如肃清、保管等。
The key board of the computer spring machine adopts the membrane panel switch mode. The membrane panel switch is simple in design, convenient in operation and easy to place. It can be used directly on the surface. With its waterproof and dust-proof performance, it is very suitable for industrial control applications. For a spring machine keyboard, there are three types of keys: digital keys, functional keys and editing keys. Digital keys accomplish the input of numbers; functional keys correspond to the operation commands of spring machines; editing keys are used toedit the processing procedures of computer spring coiling machines, such as cleaning, storage, etc.
弹簧机
一个设计合理的按键规划,与操作的便当性与牢靠性直接关联,关于详细各个键的布置,应综合思索操作的便当和规划的美观 ,薄膜面板下面的行列阵电路采用单面柔性电路板(FPC)制造,电路起凸的方式保证了按键时的手感。
A well-designed key planning is directly related to the convenience and reliability of the operation. For the detailed layout of each key, we should consider the convenience and beauty of the operation. The row and array circuit under the film panel is made of a single-sided flexible circuit board (FPC). The way of circuit bulging ensures the touch of the key.
硬件的设计在这里采用AT89S51作为按键板的主处置芯片。AT89S51是一个低功耗、高性能的8位CMOS单片机,有32个I/O口可供运用,能满足行列扫描口较多时的请求,并具有软件看门狗。与前面的按键规划相对应,采用78的矩阵行列构造。行线用89S51的P2口,列线用P0口,由于P0口无内部上拉电阻,因此列线须外接上拉电阻。AT89S51的电源都由主机的PS/2接口提供,采用频率为12MHz外部晶振。用P3.6和P3.7作为数据线和时钟线和主机停止通讯。
The hardware design here uses AT89S51 as the main processing chip of the keyboard. AT89S51 is a low-power, high-performance 8-bit CMOS microcontroller. It has 32 I/O ports for use. It can satisfy the requirements when there are more row scanning ports and has a software watchdog. Corresponding to the previous key planning, the matrix column structure of 78 is used. Line with 89S51 of the P2 port, line with P0 port, because P0 port without internal pull-up resistance, so the line must be connected with external pull-up resistance. The power supply of AT89S51 is provided by the PS/2 interface of the host, and the external crystal oscillator with frequency of 12 MHz is used. Use P3.6 and P3.7 as data line and clock line to stop communication with the host.
软件的设计是按键板完成的关键,采用单片机C言语编程。它经过主程序和一系列的子程序来完成。主程序用于系统的初始化,子程序的调用。子程序包括接纳主机命令子程序,发送数据子程序,接纳数据子程序,行列扫描子程序以及发送键码子程序。接纳主机命令子程序用于面板接纳主机的命令,并作出相应的响应,这在DOS以上的系统中很重要,否则主机不供认按键板的存在。发送数据子程序用于发送数据帧到主机,每一位数据的发送都是按PS/2协议的时序请求所编写的。
Software design is the key to the completion of the keyboard, using single-chip C language programming. It is completed by the main program and a series of subroutines. The main program is used for system initialization and subroutine invocation. Subprograms include host command subroutine, data sending subroutine, data receiving subroutine, row scanning subroutine and key code sending subroutine. The host command subroutine is used to accept the host command and respond accordingly. This is very important in the system above DOS, otherwise the host will not acknowledge the existence of the keyboard. The sending data subroutine is used to send data frames to the host. Each bit of data is sent according to the timing request of PS/2 protocol.
接纳数据子程序用于接纳主机发来的数据帧,每一位数据的接纳也是由时序规则的。行列扫描子程序作用是对按键板上键的辨认,并将该键对应的码发送到按键缓冲区暂存起来。PS/2协议中,当一个键被按下或按住时就发送该键的通码 (MAKE),被释放时就发送断码(BREAK),每个按键都被分配了独一的通码和断码(协议中统称为扫描码),这样主机经过扫描码就可辨认按键的类别。在弹簧机的按键板中,由于面板中的键不全是规范的,关于那些自定义的键,可将该键与一规范键的扫描码对应起来,例如可将面板中的启动与规范键A对应,这样当启动被按下时,发送给主机的就是字母A的扫描码,经过重定义主机系统中的相关控制局部,就可完成启动弹簧机的功用。
Admission data subroutines are used to receive data frames sent by hosts, and the acceptance of each bit of data is also based on timing rules. The function of the row scan subroutine is to identify the key on the keyboard and send the corresponding code to the key buffer for temporary storage. In PS/2 protocol, when a key is pressed or held down, the key's code (MAKE) is sent, and when released, the break code (BREAK) is sent. Each key is assigned a unique password and break code (collectively referred to as the scan code in the protocol), so that the host can identify the type of keys through the scan code. In the key board of spring machine, because the keys in the panel are not all normative, for those custom keys, the key can be corresponded to the scan code of a normative key. For example, the startup in the panel can be corresponded to the scan code of the normative key A. When the startup is pressed, the scan code of the letter A is sent to the host computer. After redefining the relevant control part of the host system, the scanning code of the letter A can be completed. Function of starting spring machine.
发送键码子程序用于发送按键缓冲区中的数据。而关于面板中的锁键,完成的是面板的锁死,在工控系统中,这个关于操作系统的牢靠性是很有必要的,当该键按下时,则不发送缓冲区中的数据,同时清空缓冲区,多按一下则可解锁。为了避免死机现象的发作,在主程序的循环中参加软件看门狗。
Send keycode subroutine is used to send data in key buffer. In the industrial control system, the reliability of the operating system is very necessary. When the key is pressed, the data in the buffer will not be sent, and the buffer will be emptied. If you press more, the lock will be unlocked. In order to avoid the occurrence of crash, the software watchdog is involved in the main program cycle.

上一篇:数控弹簧机的装机应该注意哪些?
下一篇:多弹簧和单弹簧机械密封制造的区别
联系我们