| Soft-PLC research is one of the most important research work of open NC system, which became the research hotspot of NC technology. This paper designs the software and hardware platform of SoftPLC in the Open NC system based CAN-Bus, on the base of which SoftPLC system is developed. The SoftPLC system consists of two parts of contents, one is CAN-Bus,the other is SoftPLC which includes SoftPLC developing system and SoftPLC running system simulator. The ladder diagram can be transferred to C program which works as the input of the SoftPLC running system simulator after users work out the ladder diagram, at the beginning of SoftPLC developing system. The special compiling program for PLC is not programmed in this paper, and the SoftPLC program is compiled by the compiler of VC++6.0, then be executed. The SoftPLC running system simulator in this paper is designed according the "Cycle Scan"work mode of PLC. In every working cycle, PLC go through three steps to run program, which include input sampling, executing users's program and output refurbishing. This paper introduces the timer offered by windows to realize "Cycle Scan"and achieves. The paper pictures the basic structure of the software of the open NC system based on the CAN-Bus. And applying the logic I/O card based on the CAN-Bus and AT89C52 micro-controller to the controlling system. Automatic const-weight packing machine has been widely used in chemical fertilizer, feed and light industry etc. Its control system is based on traditional PLC. SotfPLC technology based on PC is a new control technique and one of main research interests in Industrial automation field. The control system of distribute automatic const-weight packing machine based on CAN-bus and CoDeSys is introduced. It can be used to implement automatic const-weight packing, making an output statistic, printing report forms, monitoring remotely and so on. The simulation experiment indicate it can realize these function. |