The use of the Internet of Things (IoT) technologies and principles in industrial environments is known as the Industrial Internet of Things (IIoT). The IIoT concept aims to integrate various industrial devices, sensors, and actuators for collection, storage, monitoring, and process automation. Due to the complexity of IIoT environments, there is no one-size-fits-all solution. The main challenges in developing an IIoT solution are represented by the diversity of sensors and devices, connectivity, edge/fog computing, and security. This paper proposes a distributed and customized IioT (Industrial Internet of Things) framework for the interaction of things from the industrial environment. This framework is distributed on the fog nodes of the IIoT architecture proposed, and it will have the possibility to interconnect local things (with low latency) or global things (with a latency generated by the Internet network). To demonstrate the functionality of the proposed framework, it is included in the fog nodes presented in other paper. These fog nodes allow the integration of CANOpen networks into an IioT architecture. The most important advantages of the proposed architecture are its customizability and the fact that it allows decision operations to be carried out at the edge of the network to eliminate latency due to the Internet.