Preface
In practical application , Students often ask : How does the upper computer communicate with MES Information exchange ?
Today I would like to introduce , The upper computer and MES Several common ways of docking .
database
Database is a skill that any developer must master , therefore , For some simple interactions , It should be acceptable to both parties through the database , Pay attention here , Try to avoid handling production data sheets , According to the actual business scenario , By adding a data table dedicated to interaction , To reduce operational errors .
file
sometimes , The upper computer can also communicate with... Through files MES Interaction , It can be files in various formats , text file 、excel、xml Fine . such as , Host computer or MES Generate text files regularly , The generation time of the other party's detection file , To determine whether the process is completed , Then realize the follow-up process .
Transport layer TCP
there TCP Refers to the transport layer TCP, Both parties have agreed on the contents of the agreement , adopt Socket Connect , Send and receive , To achieve data communication .
application layer TCP
application layer TCP Including some defined application layer protocols , such as ModbusTCP、MQTT、OPCUA etc. .
KepServer
There are developers from some manufacturers , For convenience , Will use KepServer To do data interaction ,KepServer You can not only walk OPC, It also supports databases or Iot Gateway Plug-ins and other methods .
WebService
WebService It's a SOA( Service oriented programming ) The architecture of , It is not dependent on language , It doesn't depend on the platform , Different languages can be implemented ( adopt xml describe ) Call each other between , adopt Internet Based on Http The interaction between network applications of the protocol . adopt SOAP stay Web Software services provided on , Use WSDL The document explains , And pass UDDI To register .
WebApi
WebApi Is a simple build HTTP A new framework for services . stay .Net On the platform WebApi It's an open source 、 ideal 、 structure REST-ful Service Technology , Can be deployed in applications and IIS On .
Of course , We can also pass Http Protocol to achieve docking , After all WebApi The essence of Http agreement .
WCF
WCF Is based on SOAP Of , The data format is XML,WCF yes Web Service(ASMX) The evolution of , Can support a variety of protocols , image TCP,HTTP,HTTPS,Named Pipes, MSMQ. however WCF The main problem is , It's very complicated to configure , therefore WCF Less and less used .