Chinese medicine pharmacy's automatic medicament discharging control device
Technical field
The present invention relates to a kind of control device, especially a kind of Chinese medicine pharmacy's automatic medicament discharging control device.
Background technology
With the improvement of living standards, generally existing machine replaces the phenomenon that manpower, automation appears in a certain degree
On liberated the labour of the mankind.For the bigger hospital of some scales, there are hundreds of kinds of Chinese medicines in the Chinese medicine pharmacy of hospital,
For the pharmacist that Chinese medicine pharmacy makes up the prescription, traditional dispensing program is that this hundreds of kinds of medicines are assigned to several pharmacists, is then just taken
Prescription looks for medicine to make up the prescription, and expends a large amount of manpowers and labour.Only recruitment extensive work personnel are just needed to be responsible in this block of Chinese medicine pharmacy
It makes up the prescription, thus also brings additional expense, and it is unreasonable also to seem on personnel depaly.And automatic technology is in each neck now
Domain is applied like the mushrooms after rain, and automatic dispensary has also been widely used within the hospital, especially pharmaceutical chemists, and technology is also ratio
It is more ripe and stable.And due to many differences of Chinese medicine and Western medicine, and application range also relative narrower, cause to rarely have in the market from
Dynamicization Chinese medicine dispensing equipment.
Existing pharmaceutical chemists automation equipment is broadly divided into four classes:Hand type automatic dispensary, the automation of drug storage slot type
Pharmacy, bulk drug automatic dispensary, the cabinet type automatic dispensary of numerical control rotary.
Hand type automatic dispensary is only used by the smaller hospital of recipe quantity and pharmacy, and the prescription of domestic institute of traditional Chinese medicine
Measure it is larger, be not suitable for use this automatic dispensary;Drug storage slot type automatic dispensary is mainly used in based on box packed medicine
Pharmacy;The workflow of bulk drug automatic dispensary is fairly simple, and drug is all stored in a manner of in bulk in prescription, takes medicine
When, a standard-sized storing medicine bottle or polybag are taken out by manipulator, then bulk drug is packed into bottle by drug manipulator
In or bag in, exit be transmitted to by transport mechanism give patient after sealing and labelling, since foreign countries use medicine separation body
System, can use this pharmacy very well, and hospital of China is based on box-packed Western medicine and Chinese patent drug, therefore third type discomfort
With;The cabinet type automatic dispensary of numerical control rotary can dispense the drug of various packagings, the disadvantage is that no matter dispensing amount how much, medicine
Room is required for mass motion, and since the limitation of transmission chain speed keeps movement velocity relatively low, has seriously affected drug outbound and has entered
Library efficiency.
Invention content
The purpose of the present invention is to provide a kind of Chinese medicine pharmacy's automatic medicament discharging control devices.
Realizing the technical solution of the object of the invention is:A kind of Chinese medicine pharmacy's automatic medicament discharging control device, including data turn
Connection module, hierarchical control module, human-machine interface module and display module;
One end of data switch module is connected with computer, receives and parses through prescription information, the other end and hierarchical control mould
Block is connected, and command information is distributed to hierarchical control module, hierarchical control module controls motor movement, while hierarchical control module
It is connected with human-machine interface module, the output order of hierarchical control module is sent to display module by human-machine interface module.
Compared with prior art, the present invention its remarkable advantage is:
(1) present invention uses top-down multilevel hierarchy, and completion specific functions at different levels, exploitation can be relatively independent.
(2) each layer of the present invention can be independent of each other, and can be individually shielded with independent operating after any one layer of failure, system after
Continuous work, efficiency can effectively improve.
(3) microcontroller is selected in each module of the invention, overall cost is effectively controlled while guaranteed efficiency.
(4) it due to each layer independent work, works for later maintenance, when failure is easy to investigation, fault location.
Description of the drawings
Fig. 1 is the structure chart of Chinese medicine pharmacy's automatic medicament discharging control device of the present invention.
Fig. 2 is the work flow diagram of Chinese medicine pharmacy's automatic medicament discharging control device in the embodiment of the present invention.
Specific implementation mode
The invention will be further described in the following with reference to the drawings and specific embodiments.
In conjunction with Fig. 1, a kind of Chinese medicine pharmacy's automatic medicament discharging control device, including it is data switch module, hierarchical control module, man-machine
Interface module and display module;
One end of data switch module is connected by RS-232 interface with computer, and prescription information is received and parsed through, another
End is connected by RS-485 interfaces with hierarchical control module, and command information is distributed to hierarchical control module, hierarchical control module
Motor movement is controlled, while hierarchical control module is connected by RS-485 interfaces with human-machine interface module, human-machine interface module is logical
It crosses RS-232 interface and the output order of hierarchical control module is sent to display module;Wherein, display module be with display and
The touch screen of input function.
Further, the hierarchical control module includes control unit, encoder, executive device, light curtain and close switch;
The executive device includes motor and the chain by motor control transmission;Described control unit is connected to the motor, control
Electric motor starting, stopping and velocity of rotation processed;The input terminal of the encoder is connected to the motor, and output end is connected with control unit,
Turnning circle for obtaining motor and displacement, and turnning circle is sent to control unit;The light curtain is for judging motor
Whether opening for getting medicine has pharmacist to take medicine when operation, and light curtain trigger signal is sent to control unit, and control unit receives triggering
It is out of service that motor is controlled after signal;It is positioned proximate to switch trigger gear on the chain, is run close to switch setting in chain
The side of track is triggered close to switch when motor initial operation, and trigger signal is sent to control unit, and control unit is protected
Deposit the current number of turns of encoder and angle information, the reference zero as motor operation.
Described control unit includes that first singlechip, motor-drive circuit, encoder-driven circuit, light curtain signal acquisition are logical
Road, close to switching signal acquisition channel, first communication module and the first power module;
The first singlechip is connected to the motor by motor-drive circuit, control electric motor starting, stopping and velocity of rotation;
The encoder is connected by encoder-driven circuit with microcontroller, and it is single that motor turnning circle is sent to control
Member;
The light curtain signal sampling channel is respectively used to acquisition light curtain signal close to switching signal acquisition channel and approaches open
OFF signal, and it is sent to first singlechip;
The first communication module is received and dispatched for first singlechip and external reception interconnecting module and human-machine interface module
Data;
First power module is hierarchical control module for power supply.
The data switch module includes second singlechip, second communication module and second power supply module;
Second singlechip by data interaction between second communication module realize the parsing to send instructions under computer and
It is packaged to split and issues work, parse and control corresponding data transmission;
The second communication module is used to receive the data that computer is sent with hierarchical control module, or sends the second list
The data transmission that piece machine is sent realizes the serial communication of data switch module and other modules to external module;Second source mould
Block is data switch module for power supply.
The human-machine interface module includes mainly third microcontroller, third communication module and third power module;
The third microcontroller is realized by the data interaction between third communication module bristles with anger under hierarchical control module
The parsing and packing of order issue idsplay order work;Third communication module is used to receive what hierarchical control module was sent with touch screen
Data, or the data transmission that third microcontroller is sent realize the string of human-machine interface module and other modules to external module
Port communications;Third power module is powered for human-machine interface module.
Wherein, first~third microcontroller selects the MSP430F149 of TI companies;
The present invention is further explained in the light of specific embodiments.
Embodiment
For three layers, the connection type by PC to bottom is:PC machine is connected by cable with router, then from router
Separated time is connected to serial server, and serial server is connect by communication line with the RS-232 interface of data switch module, data
The RS-485A interfaces of interconnecting module are connect by communication line with the RS-485A interfaces of first layer control module, and other two pieces
The RS-485A of hierarchical control module is then coupled by grade on line, the RS-485 grade on line grades of each layer human-machine interface module
It is connected with hierarchical control module after connection, RS-232 is connected with touch screen.
System work process:
First, by taking dispensing flow as an example, specific implementations at different levels are described according to the direction of whole system data flow.
Respective protocol is formulated by system function, must include that slave computer executes complete dispensing in the instruction issued by PC machine
The required all information of process, including the position of medicine and the various information for needing to show personnel's viewing easy to operation.So
The fractionation layer by layer and parsing by data switch module-hierarchical control module-human machine interface's module are issued afterwards, on demand needed for taking-up
Information, then be packaged issue remaining information on demand.
Agreement 1 between PC machine and data switch module:
Dispensing instructs (hereinafter referred to as instructing 1):
Wherein, device number:01H~07H
Position in storehouse ID:High four of first character section indicates that (0001 indicates first layer, 0010 second layer, 0100 third to level number
Layer), low four indicate left and right (0011 indicates left, and 1100 indicate right);Second byte representation bay number;
All information of a prescription, including machine group number, patient's name, medicine name and its corresponding number are contained in instruction 1
The position etc. of amount and drug storage in the unit, wherein machine group number is for confirming whether instruction is correctly issued to unit, data
Thus interconnecting module can determine whether for right instructions, finally to decide whether to receive;Patient's name is for pushing up screen display;Medicine name and
Quantity is used to show for the touch screen of corresponding position.
Dispensing feedback (feedback 1):
To PC to feed back after data switch module receives instruction 1, expression has been connected to right instructions, and otherwise host computer repeats
It sends, until receiving this feedback;
Dispensing status query instruction (instruction 2):
This instruction is that PC machine sends instructions under and 1 and issues after receiving correct feedback 1, for inquiring shape residing for current unit
State, to determine the operation of next step.
Dispensing query feedback (feedback 2):
Device number 01H~07H
State byte:First second is the state of first layer, and so on;00 failure, 01 does not complete, and 11 complete.
This feeds back the inquiry instruction for replying PC machine, tells host computer unit current state.
Agreement 2 between data switch module and hierarchical control module:
Dispensing instructs (hereinafter referred to as instructing 3):
Level number 01H~07H.
This instruction determines to operate in next step after being parsed by hierarchical control module, is turned according to position in storehouse ID control motors
It is dynamic, and patient's name, medicine name and quantity these information are all packaged without any processing and are handed down to human-machine interface module, by man-machine
Interface module issues LED, LCD and completes display.
Dispensing feedback (feedback 3):
This instruction gives data switch mould after hierarchical control module receives the right instructions 3 that data switch module issues
The feedback of block, the operation received after instruction 1 with data switch module is the same.
Dispensing status query instruction (instruction 4):
Data switch module currently takes whether medicine state is completed for inquiring, i.e., whether touch screen is clicked, end-state
Summarize the inquiry instruction for replying PC.
Dispensing query feedback (feedback 4):
State byte:Seven or eight is to work as layer state:00 failure, 01 does not complete, and 11 complete.
Hierarchical control module is used to reply the unit current state instruction of data switch module.
Agreement 3 between hierarchical control module and human-machine interface module:
Instruction 5:
This instruction is handed down to human-machine interface module by hierarchical control module, and human-machine interface module is handed down to after motor goes to position
To show medicine name and its quantity.
Feedback 5:
This feedback is the current state instruction that human-machine interface module is used to reply hierarchical control module, when touch screen is clicked
It is to complete later, is otherwise unfinished state.
In conjunction with Fig. 2, for the prescription of a Chinese medicine, the workflow of entire drug discharge control device is:
The data that PC machine is sent out a prescription by agreement 1 instruct 1 to data switch module, and data switch module is returned after receiving
The expression of complex feedback 1 receives right instructions, then splits instruction 1 by level number according to agreement, is packaged into instruction 3, is pressed according to level number
Layer receives instruction 3 toward hierarchical control module, hierarchical control module is handed down to according to level number, feedback 3 is replied, then according to position in storehouse ID
Control motor rotation allow corresponding medicine storehouse produce come, in place afterwards be packaged and under send instructions 5 give human-machine interface module, wherein instructing 5
Containing the information such as medicine name and quantity, for being shown to the front and back corresponding touch screen in left and right two;It is incited somebody to action when taking the pharmacist of medicine
After medicine in medicine storehouse takes, the touch screen on corresponding position is clicked, touch screen can give human-machine interface module one feedback, human-machine interface
Corresponding flag bit set can be completed in mouth mold block when hierarchical control module, which is sent out, inquires by 5 recoil states of feedback.
Feedback of status per level-one is completed using passive form, i.e., PC machine issues dispensing inquiry instruction 2 and inquires data
Interconnecting module state, data switch module reply residing corresponding state by feedback 2, when state is " being completed ", PC machine
Dispensing instruction 1 is issued, data switch module replys feedback 1 after receiving;Data switch module reply after in the same fashion under
Dispensing inquiry instruction 4 is sent out, hierarchical control module replys corresponding state by feedback 4, and issuing dispensing when state is " being completed " refers to
3 are enabled, hierarchical control module replys feedback 3 after receiving;Similarly, hierarchical control module then presses agreement 3 and human-machine interface module is handed over
Mutually, entire dispensing flow can orderly not disorderly progress.When human-machine interface module is connected to the instruction 5 that hierarchical control module is sent
Afterwards, it replys, then parses first, it would be desirable to the data of display are packaged is issued to touch screen by the intrinsic agreement of touch screen, wherein
Content includes the bright of font size, display location on the screen and screen or goes out, and the light on and off of screen are indirectly by being layered
Control module controls;After touching screen with hand, picture switching is completed by screen itself, is switched to " operation is completed " shape
State, and hierarchical control module issues the instruction 5 for the screen that goes out after obtaining this completion status, human-machine interface module analysis instruction is simultaneously
Packing issues, and completes the screen that goes out.
Corresponding inquiry instruction is constantly issued repeatedly after wherein having issued dispensing instruction every time, if next stage is replied " not
Complete " then inquire always, until state is " being completed ".
The present invention is not all issued to hierarchical control module by hierarchical control module self deconsolidation process using instruction
Mode, but the fractionation that sends instructions under host computer is realized by data switch module, alleviates the task of hierarchical control module, make
Task is equalized.