LonWorks has become a dominated fieldbus in building automation applications, especially in the last decade. There are many devices in buildings with none-LonWorks interface which also need to be horizontally integrated into LonWorks network, just as the devices with LonWorks interface, and a gateway is competent for the task. But traditional gateways have some limitation and drawbacks, and they may penalize the system performance of the whole building automation. We present a new approach with a common gateway unit (CGU) to solve the problems and meet our requirements. The three parts of the CGU hardware are addressed in the paper firstly, and each block diagram of each unit is introduced. Then overall software process is given, and three main units: configuration process, command process module, and variables updating module are illuminated in detail. We especially optimize the data access procedure between CGU and common serial devices, and the system access cycle is reduced considerably. In the end, a real CUG implementation is shown.