Utility model content
The purpose of this utility model is to be directed to technical problem existing for prior art, there is provided it is a kind of based on numerical control control
Operation of serial-port system, solve in the case of transmitting data information, data connecting line is more, cost is high and data transmission efficiency
The problem of low.
Technical scheme is used by the utility model solves its technical problem:
A kind of operation of serial-port system based on numerical control control, including:The numerical control module and operation of serial-port mould of electric connection
Block;The operation of serial-port module includes level conversion unit, single chip control unit, key scan unit, parallel-serial converter list
First, parallel input block, string-and converting unit and indicator unit;
The level conversion unit, key scan unit, parallel-serial converter unit and string-and converting unit respectively with institute
State single chip control unit electric connection;The parallel input block is electrically connected with the parallel-serial converter unit;The string-
And converting unit is electrically connected with the indicator unit.
As further improvement of the utility model, the level conversion unit includes electrical level transferring chip and connection
Device;
The pin 13 of the electrical level transferring chip is connected with the pin 3 of the connector, and the electrical level transferring chip is drawn
Pin 14 is connected with the pin 2 of the connector;The pin 11 of the electrical level transferring chip is the transmitting terminal of transmission level data;Institute
The pin 12 for the electrical level transferring chip stated is the receiving terminal for receiving level data.
As further improvement of the utility model, the single chip control unit includes singlechip control chip and pressed
Key asembly;
The button assembly include button KEY1-KEY8 and button L1-L4, the button KEY1-KEY8 respectively with institute
The P0.0-P0.7 ports for stating singlechip control chip connect one to one;The button L1-L4 controls with the single-chip microcomputer respectively
The P1.0-P1.3 ports of chip connect one to one.
As further improvement of the utility model, the pin 5 of the singlechip control chip is data receiver, described
Data receiver receives the data input of 8 bytes;The pin 7 of the singlechip control chip is data sending terminal, the data
Transmitting terminal sends the data output of 6 bytes;The singlechip control chip uses 9600 communication baud rates, to the level conversion
Unit timing transmission data.
As further improvement of the utility model, the key scan unit includes level change in measure loop, obtains
Take the button loop of the command information of corresponding button.
As further improvement of the utility model, the command information is transferred to the single chip control unit, described
The command information is transferred to the numerical control module by single chip control unit.
As further improvement of the utility model, the parallel-serial converter unit includes 74HC165 chips, described parallel
Input block 250 includes toggle switch;
The D0-D2 ports of the 74HC165 chips connect one to one with the 1-3 pins of the toggle switch respectively,
The D3-D5 ports of the 74HC165 chips connect one to one with the 5-7 pins of the toggle switch respectively.
As further improvement of the utility model, the toggle switch inputs parallel control information, the parallel control
To the 74HC165 chips, the parallel control information is converted to Serial Control by the 74HC165 chips to be believed information transfer
Breath, and it is transferred to the single chip control unit.
As further improvement of the utility model, it is described string-and converting unit include 74HC595D chips, the instruction
Lamp unit includes LED light and load resistance;
QA-QH port of the one end of the LED light respectively with the 74HC595D chips connects one to one, described
The other end of LED light is connected by the load resistance with external power supply.
As further improvement of the utility model, the 74HC595D chips receive the finger of the single chip control unit
Information and serial control information are made, and is converted into parallel indicator lamp information, and by the parallel indicator lamp information transfer to institute
State indicator unit.
Compared with prior art, the beneficial effects of the utility model are:
The parallel control information that operation of serial-port module receives is converted to serial control information by the utility model embodiment, and
The numerical control module is transferred to by RS232 serial communication interfaces, need to only be used during a variety of data messages are transmitted compared with
Few I/O ports, make the connection of the operation of serial-port module and the numerical control module simpler;The present embodiment is by using this reality
With the operation of serial-port system controlled based on numerical control described in new embodiment, the use of connecting line is greatly reduced, is reduced into
This, accelerates efficiency of transmission, improves the cost performance of product.
Embodiment
For the ease of understanding the utility model, the utility model is more fully retouched below with reference to relevant drawings
State.Preferred embodiment of the present utility model is given in accompanying drawing.But the utility model can come in fact in many different forms
It is existing, however it is not limited to embodiment described herein.On the contrary, the purpose for providing these embodiments is made to public affairs of the present utility model
Open the understanding more thorough and comprehensive of content.
Unless otherwise defined, all of technologies and scientific terms used here by the article is led with belonging to technology of the present utility model
The implication that the technical staff in domain is generally understood that is identical.It is simply in term used in the description of the present utility model herein
The purpose of description specific embodiment, it is not intended that in limitation the utility model.
As shown in fig.1, it is a kind of knot of the operation of serial-port system based on numerical control control described in the utility model embodiment
Structure schematic diagram, the operation of serial-port system include the numerical control module 100 and operation of serial-port module 200 being electrically connected with, the numerical control
Module 100 is the control axis of the system, and the axle for controlling the system moves and the operation of related electric;The string
Mouthful operation module 200 is the operation center of the system, for inputting in real time or output data information, and the data is believed
Breath is real-time transmitted to the numerical control module 100 by serial line interface;In embodiment of the present utility model, the serial line interface is
RS232 interface, the serial line interface are the expansion interface using serial communication mode;In other embodiment of the present utility model
In, the serial line interface can be RS485 interfaces, RS422 interfaces etc..
Operation of serial-port module 200 described in the utility model embodiment includes level conversion unit 210, single-chip microcomputer control list
Member 220, key scan unit 230, parallel-serial converter unit 240, parallel input block 250, string-and converting unit 260 and instruction
Lamp unit 270;The level conversion unit 210, key scan unit 230, parallel-serial converter unit 240 and string-simultaneously change list
Member 260 is electrically connected with the single chip control unit 220 respectively;The parallel input block 250 and the parallel-serial converter list
Member 240 is electrically connected with;It is described string-and converting unit 260 be electrically connected with the indicator unit 270.
In embodiment of the present utility model, the level conversion unit 210 is used to realize the numerical control module 100 and institute
State the transmission of 200 data messages of operation of serial-port module;The key scan unit 230 is used to after scanning button obtain
Command information is transferred to the single chip control unit 220;The parallel input block 250 is used for input function switch, and (figure is not
Show) parallel control information, and by the parallel control information transfer into the parallel-serial converter unit 240, the present embodiment institute
Toggle switch, scram button, the NC (normally-closed contact) that the functional switch stated is included in the operation of serial-port module 200 start
Switch and NC shutdown switches etc.;The parallel-serial converter unit 240 is used to the parallel control information of reception changing bunchiness
Row control information, and the serial control information is transferred to the single chip control unit 220;The single chip control unit
220 for receiving the command information of the key scan unit 230 and receiving the Serial Control of parallel-serial converter unit 240
Information, and transmitted after the command information and the serial control information are changed by the level conversion unit 210 respectively
Data interaction is carried out to the numerical control module 100;In addition, the command information and the serial control information also will be transmitted to institute
State string-and converting unit 260;It is described string-and converting unit 260 command information of reception and serial control information are converted into
Parallel indicator lamp information, and will the indicator lamp information transfer parallel to the indicator unit 270, the indicator unit
270 are used to light corresponding indicator lamp after the parallel indicator lamp information is received.
It is the reference circuit schematic diagram of the level conversion unit 210 described in the utility model embodiment shown in reference picture 2,
The level conversion unit 210 includes electrical level transferring chip U202 and connector J201, described electrical level transferring chip U202
For switching levels data, the connector J201 is used for transmission level data;The pin 13 of the electrical level transferring chip U202
It is connected with the pin 3 of the connector J201, the pin 14 and connector J201's of the electrical level transferring chip U202 draws
Pin 2 connects;The pin 11 of electrical level transferring chip U202 described in the present embodiment is transmitting terminal, and the electrical level transferring chip U202 leads to
Cross the transmitting terminal transmission level data;Described electrical level transferring chip U202 pin 12 is receiving terminal, the level conversion
Chip U202 receives level data by the receiving terminal.
Because the electrical level transferring chip U202 data received from the data receiver are Transistor-Transistor Logic level data, and institute
It is EIA bidirectional level data to state the data received in numerical control module 100, i.e., is carried out in the electrical level transferring chip U202 domestic demands
After TTL-EIA two-way level convertings, and sent from the data sending terminal, by the connector J201 by the EIA
Bidirectional level data transfer is to the numerical control module 100, and the numerical control module 100 is according to the EIA bidirectional levels data to institute
State system and carry out corresponding control.
In embodiment of the present utility model, the level conversion unit 210 also includes being used to ensure external power supply voltage
Stabilization filter capacitor, filter capacitor described in this implementation be 5, the filter capacitor as illustrated include C204, C206,
C207, C209 and C210;The level conversion unit 210 is also including pull-up resistor R210, R211, the pull-up resistor R210
One end be connected with the pin 12 of the electrical level transferring chip U202, one end of the pull-up resistor R211 and the level conversion
Chip U202 pin 11 connects, the pull-up resistor R210 and the first pull-up resistor R211 other end with external electricity
Source connects;The external power supply is used to provide the power supply needed for data transmission procedure, and the external power supply described in the present embodiment
There is provided by+5V power supplys;The pull-up resistor R210 and pull-up resistor R211 are used to improve the electrical level transferring chip U202
Driving force during sending and receiving data.
It is the circuit reference schematic diagram of single chip control unit 220 described in the utility model embodiment shown in reference picture 3,
The single chip control unit 220 includes singlechip control chip U7 and button assembly.
The button assembly include button KEY1-KEY8 and button L1-L4, the button KEY1-KEY8 respectively with institute
The P0.0-P0.7 ports for stating singlechip control chip U7 connect one to one, and correspond to and connect respectively on the button KEY1-KEY8
Then pull-up resistor R45-R38, the pull-up resistor R45-R38 are used to strengthen the button KEY1-KEY8 transmission key command
Driving force during information;The button L1-L4 respectively with the P1.0-P1.3 ports of the singlechip control chip U7 one by one
Corresponding connection.
The pin 5 of singlechip control chip U7 described in the present embodiment is data receiver, and the single-chip microcomputer controls core
Piece U7 pin 7 is data sending terminal;The data receiver can be used for the data input for receiving 8 bytes, and the data are sent
End can be used for the data output for sending 6 bytes, and the singlechip control chip U7 uses 9600 communication baud rates, to the electricity
The flat timing transmission data of converting unit 210;
The pin of singlechip control chip U7 described in the present embodiment 24,23 and the string-and converting unit 260 is corresponding connects
Connect, by writing programme-control LOCK595, DATA595 signal, so as to control the institute being connected with the string-and converting unit 260
State the indicator light switch of indicator unit 270;The singlechip control chip U7 pins 22,21 and the parallel-serial converter unit
240 corresponding connections, by writing programme-control LOCK165, DATA165 signal, so as to control the parallel input block 250
Starting or disconnect, parallel input block 250 includes functional switch described in the present embodiment, such as:Toggle switch, scram button, NC
(normally-closed contact) starting switch and NC shutdown switches etc.;In this embodiment, the single chip control unit 220 also includes pull-up
Resistance R50-R54, the DATA165, LOCK165, DATA595, LOCK595, CLK signal respectively with the pull-up resistor R50-
R54 one end is connected one to one, and the other end of the pull-up resistor R50-R54 is connected with external power supply, the pull-up
Resistance R50-R54 is used for the driving force for strengthening the DATA165, LOCK165, DATA595, LOCK595, CLK signal.
In embodiment of the present utility model, the single chip control unit 220 also includes filter capacitor, the filtered electrical
Hold the stabilization for ensureing external power supply voltage, filter capacitor described in this implementation is 5, that is, C7, C8, C9, C11 in illustrating
And C17;Also include crystal oscillator Y1, the crystal oscillator Y1 for providing clock signal for the singlechip control chip U7;Also include
Load capacitance R46, R49, load capacitance R46, R49 are connected on the filter capacitor C9 and crystal oscillator Y1, described negative
The circuit that electric capacity R46 is used to protect the filter capacitor C9 is carried, the load capacitance R49 is used for the electricity for protecting the crystal oscillator Y1
Road.
Shown in reference picture 4, for the circuit reference schematic diagram of key scan unit 230 described in the utility model embodiment, institute
Stating key scan unit 230 includes button loop, and the button loop is divided into the row arrangement of 4 rows 8, i.e., described button loop is matrix
Formula button loop.
The button loop is used for level change in measure loop, obtains the command information of corresponding button;The matrix form
Button loop is used for the button that quick lock in is pressed in the case where number of keys is more, and reduces the occupancy of I/O ports;
In the present embodiment, with reference to Fig. 3, the button KEY1-KEY8 of the single chip control unit 220 is in the matrix form button loop
For cross direction profiles, its button L1-L4 is genesis analysis in the matrix form button loop, and set button KEY1-KEY8 with
Button L1-L4 intersection point be the matrix form button loop button, the button in the loop of matrix form button described in the present embodiment
For 30, for example, button S1 be genesis analysis button L1 and cross direction profiles button KEY1 intersection point, button S2 for longitudinal direction point
The button L1 of cloth and the button KEY2 of cross direction profiles intersection point, button S29 are the button L4 of genesis analysis and pressing for cross direction profiles
Key KEY5 intersection point, button S30 be genesis analysis button L4 and cross direction profiles button KEY6 intersection point;By that analogy, press
Key S3-S28 connected mode is identical with button S1, S2, S29, S30 connected mode.
In embodiment of the present utility model, corresponding command information, the button can be generated after by next button
Scanning element 230 is obtained by scanning per a line or each row produce the position of level change so that it is determined that the button pressed
Command information corresponding to the button being pressed is taken, and the command information is transferred to the single chip control unit 220, by institute
State single chip control unit 220 and be transferred to the numerical control module 100, the numerical control module 100 is made according to the command information
Corresponding operation.
It is parallel-serial converter unit 240 described in the utility model embodiment and parallel input block 250 shown in reference picture 5
Local circuit reference view, as shown in phantom in FIG. (dotted line is not in the scope of protection of the utility model), it is described simultaneously
Row input block 250 includes toggle switch J7, and the toggle switch J7 is used to input parallel control information, and is controlled described parallel
Information transfer processed is to the 74HC165 chips U14;The parallel-serial converter unit 240 includes 74HC165 chips U14, described
74HC165 chips U14 pin 1,9 connects one to one with the pin 22,21 of the singlechip control chip U7 respectively, described
74HC165 chips U14 is used to toggle switch J7 inputs parallel control information being converted into serial control information, and by setting
In the 74HC165 chips U14 LOCK, Q7 and CLK port transmission to the single chip control unit 220;Wherein, it is described
74HC165 chips U14 Q7 ports are serial control information output port, and LOCK ports are data latch port, and CLK ports are
Clock information port.
In the present embodiment, the D0-D7 ports of the 74HC165 chips U14 are parallel control information input terminal mouth, described
Pin 1-3 of the 74HC165 chips U14 D0-D2 ports respectively with the toggle switch J7 connects one to one, described
Pin 5-7 of the 74HC165 chips U14 D3-D5 ports respectively with the toggle switch J7 connects one to one;It is described parallel defeated
Entering unit 250 also includes pull-up resistor R70-R75, and one end of the pull-up resistor R70-R75 is connected with external power supply, the other end
It is connected respectively in the D0-D5 ports of the 74HC165 chips U14, the model of pull-up resistor R70-R75 described in the present embodiment
With resistance all same, the pull-up resistor R70-R75 is used for the drive for strengthening the parallel control information of the toggle switch J7 inputs
Kinetic force.
It is parallel-serial converter unit 240 described in the utility model embodiment and parallel input block 250 shown in reference picture 6
Integrated circuit schematic diagram, the SDI ports of the 74HC165 chips U14 are shift control port, and with next 74HC165 cores
The Q7 ports connection of piece, for receiving the serial control information of next 74HC165 chips;It is and described next
The catenation principle of 74HC165 chips is identical with the 74HC165 chips U14, is not being repeated in the present embodiment;The utility model
Embodiment uses multiple 74HC165 chips, makes the I/O ports of single-chip microcomputer increase.
In the present embodiment, increase the I/O ports of single-chip microcomputer, be specially:By the D0-D7 ends of the 74HC165 chips U10
Mouth connects one to one with external I/O input ports IN7-IN14,74HC165 chips U11 D0-D1 ports and external I/
O input ports IN15-IN16 connects one to one, and 74HC165 chips U11, U12, U13 D6-D7 respectively with external I/O
Input port IN5-IN6, IN3-IN4, IN1-IN2 connect one to one;Parallel input block 250 is unlimited described in the present embodiment
In that including toggle switch J7, can also be other functional switches located at the operation of serial-port module 200, as shown in J3, J4
Can to be scram button, NC (normally-closed contact) starting switches and NC shutdown switches etc..
It is string-and the office of converting unit 260 and indicator unit 270 described in the utility model embodiment shown in reference picture 7
Portion's circuit reference schematic diagram, as shown in phantom in FIG. (dotted line is not in the scope of protection of the utility model), the string-simultaneously
The pin 12,14 of converting unit 260 including 74HC595D chips U1, the 74HC595D chips U1 respectively with the single-chip microcomputer control
Coremaking piece U7 pin 24,23 connects one to one, and the 74HC595D chips U1 is used to receive the single chip control unit
220 command information and serial control information, and parallel indicator lamp information is converted into, and the parallel indicator lamp information is passed
It is defeated to arrive the indicator unit 270;The indicator unit 270 includes LED light, and the LED light is receiving
After stating parallel indicator lamp information, corresponding LED light is lighted.
In the present embodiment, the LED light is 8, and it includes D1, D3, D5, D7, D9, D11, D13, D15, and institute
State the model and power all same of LED light;The indicator unit 270 also include load resistance R1, R3, R5, R7, R,
R11, R13, R15, the one end of one end of the LED light respectively with the load resistance connect one to one, the load
The other end of resistance is connected with external power supply, the LED light that the load resistance component is used in protection circuit;It is described
QA-QH port of the other end of LED light respectively with the 74HC595D chips U1 connects one to one.
It is string-and the integrated circuit of converting unit and indicator unit described in the utility model embodiment shown in reference picture 8
Schematic diagram, the SDI ports of the 74HC595D chips U1 are connected with the SDO ports of next 74HC595D chips, and it is described under
The catenation principle of one 74HC595D chip is identical with the 74HC595D chips U1, is not being repeated in the present embodiment.
In the present embodiment, the LED light is set to 37, and is connected to U1, U2, U3, U5 QA-QH ports
And U4 QA-QE ports, wherein U4 QF, QG port are connected with indicator lamp LEDM1, LEDM2 of another model respectively;And U6
QA-QH ports connected one to one respectively with external I/O output ports OUT1-OUT8.
The parallel control information that operation of serial-port module 200 receives is converted to Serial Control letter by the utility model embodiment
Breath, and the numerical control module 100 is transferred to by RS232 serial communication interfaces, during a variety of data messages are transmitted only
Less I/O ports need to be used, make the connection of the operation of serial-port module 200 and the numerical control module 100 simpler;This implementation
Example greatly reduces connecting line by using the operation of serial-port system based on numerical control control described in the utility model embodiment
Use, reduce cost, accelerate efficiency of transmission, improve the cost performance of product.
Above-described embodiment is the preferable embodiment of the utility model, but embodiment of the present utility model is not by above-mentioned
The limitation of embodiment, it is other it is any without departing from Spirit Essence of the present utility model with made under principle change, modify, replace
Generation, combination, simplify, should be equivalent substitute mode, be included within the scope of protection of the utility model.