Intelligent storage and automatic distribution system of pharmacy

A technology of intelligent warehousing and automatic distribution, applied in the field of control systems, can solve problems such as complex environments, no standards, and heavy workload, and achieve the effects of reducing costs, saving space, and solving complex problems

Active Publication Date: 2016-05-25
4 Cites 9 Cited by

AI-Extracted Technical Summary

Problems solved by technology

Chinese pharmacies have not studied similar automatic medicine dispensing equipment abroad, and the original Chinese medicines have different shapes and qualities, and there is no unified standard, which greatly limits the development of automatic Chinese medicine dispensing equipment
The emergence of Chinese medicine decoction pieces packs has...
View more


The invention discloses an intelligent storage and automatic distribution system of a pharmacy, for performing intelligent warehouse position management, prescription analysis, instruction information processing and automatic notification set distribution on carton packed western medicine, traditional Chinese medicine decoction piece packages and the like. The system mainly comprises a data processing module used for obtaining prescription information, performing warehouse position management and processing the prescription information; a communication module used for communication between a master control computer and a lower computer PLC and transmitting instruction information; and a mechanical execution module used for executing medicine taking and medicine returning motion under the control of the PLC. The intelligent storage and automatic distribution system of the pharmacy realizes intelligent medicine storage of the pharmacy and automatic prescription extraction and medicine distribution, improves the operation efficiency of the pharmacy and well reduces the cost.

Application Domain

Programme control in sequence/logic controllers

Technology Topic

Distribution systemData processing +8


  • Intelligent storage and automatic distribution system of pharmacy
  • Intelligent storage and automatic distribution system of pharmacy
  • Intelligent storage and automatic distribution system of pharmacy


  • Experimental program(1)

Example Embodiment

[0025] The intelligent storage and automatic distribution system of the pharmacy of the present invention includes a data processing module, a communication module and a mechanical execution module. The data processing module of the present invention is an upper computer main control system written in C language, which analyzes and extracts the prescriptions in the database, and combines the unit drug storage location distribution table to generate the corresponding unit instructions, and communicates with the lower computer through the socket protocol. PLC) to communicate. The main controller of the mechanical execution module is a Panasonic PLC (FPX-C40T) and expands COM5 for communication. The slave controller is divided into a servo motor driver and a man-machine interface control panel. All medicines are evenly stored in multiple units according to the designed storage location distribution table. The main control and all units are linked in the same network domain through the switch, and are distinguished by different IP addresses; multiple sensor signals are used to determine the delivery of medicines The motion state of the platform ensures the accuracy of the medicine dispensing action; the combination of the servo motor and the driver ensures the accuracy of the movement position and the fast, efficient and stable dispensing process; the upper computer adopts multi-threaded operation and the number of units can be customized , High efficiency and stability, easy to expand.
[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0027] 1. Design ideas
[0028] The multi-unit pharmacy intelligent storage and automatic distribution system based on PLC and network communication of the present invention is mainly composed of a main control computer, a mechanical structure controlled by PLC and a human-machine interface touch screen, such as Picture 11 As shown; after the analysis of the distribution warehouse, the equipment works for multiple units at the same time. According to the needs of the pharmacy and the types of medicines, the quantity can be increased or decreased freely on this basis.
[0029] (1) Interface database and main control computer: The system is equipped with a main control computer, which is connected to the upper-level interface computer through a switch, and communicates through the socket protocol. In this protocol, the interface computer is the client side. The master computer is the server side. The interface computer integrates the prescription information read from the HIS and sends it to the main control computer. The main control computer has a SQL Server database locally. The main control computer corresponds the acquired prescription information with the position table in the local database, and processes the prescription information into corresponding position distribution information, and then decomposes it into the distribution information of the corresponding unit. It becomes an order to be issued to each unit at the same time, and then wait for the unit to complete before issuing the next set of prescriptions.
[0030] (2) Communication module: The Ethernet communication between the upper computer and the lower computer is realized through the COM5 expansion module. The communication between the host computer and the PLC is carried out in a responsive manner. Selecting a high transmission rate, stable and reliable industrial Ethernet as the transmission channel can greatly improve the stability of the control system. The PC end of the host computer and multiple groups of PLCs are connected in a network segment through a switch. By setting the parameters such as the PLC's IP address, point-to-point communication from PC to PLC can be carried out, which can improve transmission efficiency and reduce communication interference.
[0031] (3) PLC controlled mechanical action module: The structure is mainly composed of two medicine storage cabinets on the left and right, a lifting platform at the front, an electrical cabinet and a touch screen. The lifting platform is driven by a lifting servo motor. The lifting platform is equipped with two servo motors for dragging the medicine boxes of the left and right cabinets respectively. The three motors are respectively connected to the PLC through the drive. The touch screen acts as a man-machine interface, prompting the current medicine withdrawal situation. It is connected with PLC through RS-232 circuit, the communication mode is MEWTOCOL-COM master station/slave station, computer connection mode. In this communication mode, the screen is the master station, and the PLC is the slave station. Through the open program variable area of ​​the PLC, the screen can fine-tune the movement distance of the mechanical structure to overcome the different mechanical errors of multiple units. There are metal-sensitive limit switches in the mechanical structure, as well as light curtain protection and so on. The appearance and structure of the specific cabinet can be seen figure 1 with figure 2.
[0032] 2. Hardware design and communication
[0033] 2.1 PLC programming
[0034] The main task of the PLC is to maintain the communication with the upper computer, accept and parse the instructions from the upper computer, and feed back the information received by the upper computer and make corresponding actions. At the same time, it maintains interaction with the man-machine interface touch screen, and after completing all the actions included in a set of instructions, it can feed back to the host computer the information of completing the instructions.
[0035] The PLC program is mainly divided into three modules: serial port communication module, drug delivery action module and reset system module. In order to facilitate the debugging of the mechanical structure, a manual operation module is also provided to facilitate the debugging personnel to control the position of the three servo motors. Use FPWINPro7 software of Panasonic to write. The specific design flow diagram of the PLC program on the Pro7 side can be seen in image 3.
[0036] (1) Serial communication module
[0037] The PC is connected to the PLC through the COM5 communication plug-in to establish a socket communication channel. The serial communication method is still used between COM5 and the PLC. The main function of the serial communication module is to receive all instructions from the PC and perform preprocessing for the PLC to perform subsequent actions. control.
[0038] (2) Reset the system module
[0039] After the system is powered on, it waits for the host computer to send the self-check command. After receiving the command correctly, the system enters the self-check module to reset the A and B-axis pull box servo motors and the Z-axis lift servo motor to zero. After the self-check, it will go up. The position machine feedbacks that the self-check is successful and enters the waiting state for dispensing.
[0040] (3) Dispensing processing module
[0041] Dispensing processing is similar to tonic processing. Taking the dispensing processing as an example, the PLC receives the dispensing instructions, performs instruction analysis, arithmetic operations and logical elements, and takes out the medicines that need to be taken out from the A and B cabinets in turn. After taking out all the medicines The upper computer feeds back the message that the medicine has been taken. After all the units of the lower computer have taken the medicine, the prescription processing is completed.
[0042] 2.2 PLC expansion block communication settings
[0043] Regarding the communication between the upper computer (main control computer) and the lower computer (PLC), the COM5 extension block is used to set it, and the online COM5 extension block is set through the ConfiguratorWD software, and in the corresponding PLC programming software PRO7 Modify the corresponding settings. The communication mode between the COM5 expansion block and the computer is program control (general communication) mode. For the computer COM5 expansion block is the server side in the socket protocol, its IP and communication port need to be set. When communicating with the PLC internally, the COM5 expansion The block is serial communication, so it is necessary to set its baud rate and other attributes. See the specific WD setting process Figure 4 versus Figure 5 , See the COM5 expansion port communication settings corresponding to Pro7 Image 6.
[0044] 2.3 PLC I/O point distribution
[0045] To write a PLC program, you first need to analyze the resources required by the controlled object, and perform accurate calculations based on actual needs, so that the PLC can maximize the control requirements of the controlled object. Resource allocation to the I/O port of the PLC is the prerequisite for the program design of the PLC control system. There are many modules in the lower computer of the system. According to the needs, the input signals are: zero switch, limit switch, safety light curtain at the drug outlet, photoelectric Encoders, etc., output devices include: single-axis driver, dual-axis driver, several status lights, etc. The resource allocation table is as follows:
[0047] Except the photoelectric encoder, the other input and output devices are all connected to the I/O port of the PLC, and the photoelectric encoder is connected to the PLC through the AFPX-COM3 communication plug-in, plug and play, so I won’t repeat it here.
[0048] 3. System working process
[0049] The main control computer is responsible for receiving the prescription sent from the interface, converting it into the instruction required by the PLC, and issuing it to the corresponding IP of the corresponding unit through the socket protocol. When the main control computer is turned on, first initialize the database, update the drug information, read the corresponding unit IP from the configuration file, and generate the socket connection event of the corresponding unit. At this time, if the COM5 expansion block of the PLC is operating normally, the main control can be connected Corresponding IP and corresponding port, the socket connection event is triggered, and the host computer and PLC are in the monitoring state. If the COM5 expansion block does not operate normally, or the network is not smooth and the port cannot be opened normally, it will trigger an error event of the socket and display the corresponding error code, which is convenient for the operator to check.
[0050] When the operator confirms that all the units are online, they can control the main control computer to send self-check instructions to the units, and each unit will perform self-checking, the left and right drag box motors will return to the origin, the lifting platform will return to the origin, and the master will be notified after the self-check is completed. The control computer has completed its self-check. The main control computer confirms the completion of the self-checking process after all units have completed the self-checking, enters the dispensing process, waits for the prescription information sent by the interface computer, and presses it into the waiting prescription queue.
[0051] After receiving the instruction, the lower computer analyzes the instruction to raise the medicine taking platform to the corresponding floor height, pull out the medicines in the left and right cabinets, and then raise the medicine taking platform to the medicine taking port position, and at the same time light up the screen to display the medicine currently pulled out Wait for the personnel to fetch the medicine. After taking the medicine, the staff clicks on the touch screen to confirm that the medicine bottle is taken out, the lower computer returns to the medicine box that was taken out, and then recalls the remaining medicine in the instruction. When a group of instructions is completed, feedback information to the main control computer, indicating the unit After completing all the medicines of the prescription, the small thread corresponding to the unit of the main control computer continues to send the next prescription, while the main thread waits for the completion of all units to update the prescription information.
[0052] Data interaction process:
[0053] (1) Turn on the main control computer, connect all units, check the online status, and after judging that all units are online, the operator sends a self-check instruction. After the unit receives the self-check instruction, it will return a message confirming receipt of the self-check instruction, and start self-checking at the same time. After the self-inspection is completed, the information that the self-inspection is completed will be returned.
[0054] (2) After the main control computer completes the self-check, the state is restored, and it enters the dispensing mode, and pushes the unprocessed prescriptions and the prescriptions received from the interface into the prescription queue. Each unit thread also has the same queue. The thread queries the database, converts the specific prescription information into command information that the unit can handle, and issues it to the IP of each unit via Ethernet. After confirming the receipt of the prescription information, the crew immediately feeds back the information to the main control computer, and at the same time starts the action of dispensing the medicine. The first medicine is taken out from the left and right cabinets respectively, and the screen is lit to remind the staff to take the medicine.
[0055] (3) When the lower computer completes all the medicines of a prescription, it feeds back the information of the completion of a prescription of the unit to the master control, and the unit thread refreshes the database and marks the unit as complete. After that, the unit thread traverses the database again to confirm whether the rest of the units have completed the prescription. If all units are completed, the total status bit of the prescription in the database is updated as complete, and the main thread is notified to update the queue information, and finally the next prescription in the queue is sent; If the group flag in the unit is not completed, only the next prescription in the queue is sent. Since each unit has a sequence of completion, the unit thread corresponding to the last completed unit for a certain prescription is responsible for changing the overall status information.
[0056] 4. Software design
[0057] The main task of the main control system (PharmacySys) is to process the prescriptions sent from the HIS, generate instructions from the lower computer, control the lower computer to take out the medicines in the prescription, and notify the window system to confirm the taking of the medicine after taking it. The main control system also has the functions of warehouse coding, warehouse information management, and medicine allocation.
[0058] 4.1 Main control program initialization and self-check module
[0059] Turn on the main control software and enter the "System Operation Status" interface, which is used to display the execution of the prescription, the operation of the unit, etc. While creating the "System Running Status" interface, the system automatically calls the FormCreate(TObject*Sender) function and calls bt_Initial-> Click () function, enter the system initialization process. The specific contents of initialization are as follows:
[0060] (1) Add custom controls to the interface corresponding to the main control, which has N (N is the number of units) buttons and status bar groups corresponding to the unit status.
[0061] (2) The main control program is the HIS system, and the stocking system respectively provides a port so that they can transmit data through Socket. The port is first set during the initialization process.
[0062] (3) Generate a Process, which is a prescription queue processing thread, and a thread PLCProcess corresponding to the unit is generated in the Process thread. In the process of creating the unit thread, it completes the establishment of Socket communication with the lower computer, and informs the main interface to display the online status.
[0063] (4) Initialize some flag state variables.
[0064] (5) Process the NBCF (internal prescription table). NBCF is a data table dedicated to the main control program. It is a cyclic fixed-size data table.
[0065] (6) Interface status display.
[0066] (7) The main control and each unit keep monitoring.
[0067] (8) The self-check button can be pressed.
[0068] (9) Initialize the corresponding special processing
[0069] In the last step of initialization, the self-check button can be pressed. After the self-check button is pressed, the unit self-check processing process is executed. The main control monitors the self-check status of each unit. When all units feedback that they have received the self-inspection instruction and completed the self-inspection, they enter the normal processing flow. The self-check process actually enters the self-check mode of each unit thread. The specific main control operation interface such as Figure 7 Shown.
[0070] 4.2 Master control program prescription receiving and processing module
[0071] Before explaining the queue processing module, I will explain the HIS prescription receiving and processing modules. Although they are parallel, the processing of the queue is based on the HIS prescription receiving and processing.
[0072] This module is also a read event function ServerSOcket1ClinetRead connected to the HIS system Socket. It is responsible for reading the prescription information sent by HIS, analyzing it, storing it in HISCF (HIS prescription form) and generating a new internal prescription tuple, and adding it to NBCF. Finally, the value of the NBCFID field in the newly generated internal prescription tuple is pressed into the prescription queue.
[0073] 4.3 Main control program unit thread module
[0074] When the value of the NBCFID field in the newly generated internal prescription tuple is pressed into the main thread prescription queue, it is also pressed into the respective prescription queue of each unit thread. The Execute() function of each unit thread mainly has two modes, one is the self-check mode, and the other is the sending prescription instruction mode. Self-check mode, that is, the process of sending down the self-check command and waiting for feedback from the unit. The sending prescription instruction mode is the process of sequentially processing the prescription elements stored in the thread queue into position instructions. The internal execution flow of the designed thread can be seen in Picture 10.
[0075] 4.4 Drug storage information management module
[0076] The main control program completes the conversion of prescription drug information to location information by querying the location table. In order to ensure that the commonly used drugs in the prescription can evenly appear in each unit to ensure that the time taken by the drug picker to take the medicine in front of each unit is similar, When designing the warehouse table design, commonly used drugs are evenly placed in the three, four, five, three floors of each unit. Carrying out such a design can ensure that commonly used drugs appear evenly in each unit, and since the third, fourth, and fifth floors are closest to the drug inlet, the stroke of the mechanical structure is also the shortest.
[0077] At the same time, in order to facilitate the pharmacy staff to adjust the distribution of drug storage locations, add or delete drugs, etc., the main control interface also has a drug storage information management form. Pharmacy personnel can operate the drug position table (YPBCW) in the database by operating in this window, modify the position number, drug name and current inventory, etc. The specific implementation is as Figure 8 with Picture 9 Shown.


no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Apparatus and method for low-density cellular wood plastic composites

InactiveUS20050067729A1less-expensivelow cost

Method and system utilizing Excel format data to process welding performance data

ActiveCN105550267Asolve complexConvenient and quick organization of records

Haptic trackball device

InactiveUS7710399B2simple actuatorlow cost

Steering Arrangement for a Trailer

InactiveUS20110018231A1low cost

Classification and recommendation of technical efficacy words

  • solve complex
  • low cost

Method and system utilizing Excel format data to process welding performance data

ActiveCN105550267Asolve complexConvenient and quick organization of records

System and method for transmitting wireless digital service signals via power transmission lines

ActiveUS7929940B1reduce bandwidth requirementlow cost

System and method for determination of position

InactiveUS20090149202A1low costreduce requirement

Adaptive antenna optimization network

InactiveUS6961368B2low costminimal space

Antenna device and method for attaching the same

ActiveUS20150138022A1low costimproved strength characteristic
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products