The invention provides a high-expansibility universal
bus adaptation method, which comprises the following steps of: firstly, generating a
json configuration file, reading the
json configuration file and issuing the
json configuration file to an MB
software module by tool
software, receiving the json configuration file and responding to a
verification result of the configuration file by the MB, analyzing the json configuration file by the MB, generating a communication OD rule suitable for STM32 analysis, storing and issuing the communication OD rule to the STM32, dynamically generating
global configuration by the STM32 according to the OD rule, and executing the
global configuration according to the communication OD rule. And finally, the STM32 performs communication interaction with the PLC according to the
global configuration of the communication protocol. According to the method, decoupling, communication process channelization and communication content off-line configuration of typical industrial
bus communication are achieved, unification of product forms and common models of different service scenes are achieved, the research and development efficiency is greatly improved, and a technical basis is provided for rapid popularization and batch multi-scene use of products.