Answer: 1, Prodave communication
Prodave is a software package provided by Siemens, which provides an interface for high-level language programming and plc communication.
Communication interface: MPI
Because MPI port is the programming port of each cpu, plc does not need to add another communication module, so this scheme is more economical, and the prodave software package comes with examples and detailed instructions, which should be relatively simple and convenient to use (I just glanced at the document in a hurry and didn't do the experiment). There is a lot of information about this on Baidu. Of course, the speed of mpi is limited. If you connect pc and plc with an ordinary pc adapter, the highest speed will reach 38.4kbps. I wonder if prodave can support mpi cards (56 1 1 etc.). If so, the speed can reach 187.5kbps.
2. Serial communication
I have read some papers, and the communication between pc and plc is realized through serial communication. There are several requirements in this case:
A, need to add a serial communication module for plc, such as 300, you need cp340 or cp34 1 (the former is cheaper);
B, serial communication needs to be programmed in plc, that is, receiving messages and sending messages, calling FB2/FB3 (if using CP 340).
C, the speed of serial communication is obvious to all, and the data throughput of cp340 or cp34 1 is also limited, that is, the message length is limited, so I personally think that serial communication is not suitable if the communication data is large.
D, the message format is relatively free, but reasonable. Although no specific experiments have been done, personally, I think we can refer to the message structure of modbus for programming, and even adopt modbus specification, but in this case, programmers should be familiar with modbus programming on pc side and plc side.
3、opc
Opc is a very popular thing in recent years. In fact, I hate the setting of opc security certification. However, using opc programming to access plc is really a very relaxed and comfortable thing. What you need to do is to understand the structure and programming of opc, especially writing opc in vb is an idiot's work, and of course you have to sacrifice a lot.
Earlier, I experimented with vb to access 300 through opc (Ethernet), including the opc interface provided by Siemens simaticnet and the third-party kepserver.
The advantages of opc interface programming are high communication speed and simple programming.
4, Ethernet programming
Using Ethernet programming to access plc can actually be divided into two types:
One is socket interface, which needs to be programmed in plc to receive/send, probably fc5/fc6. I don't remember much. Of course, people familiar with Siemens industrial communication can easily define a connection in plc and fill in information such as address and port number. The Pc uses socket interface to program, and the simplest one is the wisock control in vb, which of course covers up many details. Socket programming is an art, paying attention to speaking, learning and singing:)
The advantage of this method should be that pc-side programming is simpler (compared with the latter), and it can not be limited to windows platform, because the socket interface is better supported, such as unix.
The second is to use the sapi interface function of Siemens, so that there is no need for too much programming in plc. Of course, the programming on the pc side is more difficult, and ms can only be written in C, so I flinch.
Beginners can learn with plc video tutorial, and the technology of plc is good.