文中采用多线程的方式实现了基于消息并结合仿真的单件生产实验系统的控制。其中工件线程通过在执行函数中下达工件到达指令,用来模拟工件进入生产系统的动作,机器线程则通过在线程的执行函数中向机械手发送工件加工请求来模拟机器。线程间通过消息队列进行通信。在介绍了该方法的思路后,阐述了结合仿真的生产过程控制的多线程的实现方法,并给出了实验结果。实验结果表明该方法能较好地完成单件生产实验系统的控制。通过对于单件生产实验系统的控制,可以灵活地设定生产计划,并完成。
In this paper, a message - based multi - thread method combined with simulation is implemented for the control of one - of - a - kind production system. The part thread simulates the action of the part entering into the production system by issuing instruction in execution function. The machine thread simulates the machine by sending requests to the manipulator. And the threads use the message queue to communicate with each other. After the introduction of its main idea, the implementation of the multi - threaded control method is elaborated in this paper, and an example of the implementation is given. The result shows that this method is helpful to the produetion control of one- of- a- kind production system. By the control of one - of- a - kind production system, the production plan can be flexibly made and accomplished.