## 4 Application of the Concepts: Design of an In-Line Measuring Machine
### Implementation of Connectivity
Temperature, pressure, and humidity in the machine's measurement area are collected at approximately 182 Hz. Data from accelerometers and gyroscopes can be reported at a rate of up to 2000 Hz. It is important to note that there are no universally accepted definitions for Edge and Fog computing. In our case, we propose that the GC can be considered an edge device because it performs functions beyond data acquisition tasks. In addition to collecting data from the laser control, the GC coordinates other basic automatic functions: It processes the orders of the operator (start or stop the process), instructs the pneumatic clamps to hold the part, and the pneumatic stage to insert the part or remove it from the measurement area. Beyond these automatic functions, the controller displays a certain degree of intelligence. For example, the control reacts only when the operator has both hands at the button boxes, a safety feature, and unclamps the part to allow for removal only if all measurements are within specs. The processing units that serve as Fog devices were chosen based on their processing capacity and on the interface they handle to facilitate connection. In this particular case, an embedded development platform, BeagleBone Red (BBR), was selected to serve as a fog computing stage due to additional features such as compact size, ease of programming, and flexibility. It can be connected with almost any type of device, from simple components, such as switches, to more complex devices, such as smart sensors, as well as to the Cloud. As seen in Figure 10, the BBR receives information and data from the GC and the XDK. In this case, the BBR is mostly used as the manager and distributor of all the data. Part measurement data are sent to a screen and displayed in a manner that facilitates interpretation. Basically, measurements are displayed directly on an image of the workpiece. A green circle is shown when measurements are within specification; measurements out of specification are shown in red. The BBR also conditions and formats the data to be transmitted to the Cloud. The protocol used is HTTPS with a post method using a URL address. Data are saved on a Google drive where the engineering department of the factory monitors the measuring process. The response time at the fog computing level is less than 2 s. Most of this is needed to display the measurement data on the HMI. The continuous data handling requirement in each cycle is around 600 KB, which corresponds to all information that is sent to the Cloud. Because the BBR is the closest device to the IoT gateway (the node to the LAN), this work proposes that it may be considered a Fog Device. Figure 11 presents an integrated diagram of the functions performed by the machine. The functions associated with Connectivity are presented in more detail, and describe the type of signal that is being processed as well the protocol used. The last stage is the connection to the Cloud. In this particular case, the BBR is the only device with Internet access. The BBR was configured to access the company's WLAN to get a secure connection with the Cloud. A request using HTTP to an URL hosted was used for sending data to the virtual Cloud through a Wi-Fi adapter. A BBR application was developed using Qt Creator, which has a code editor with support for C+. The library of C+ that allows HTTP method is \"curl\", which is an open-source code used in command lines or scripts to transfer data [48]. The program that receives and writes data from BBR code to the virtual Cloud is an App script of Google drive with the \"doGet\" function. Data are saved in seven different spreadsheets within a Google spreadsheet, and consequently seven apps scripts were  
Figure 11: Integrated function diagram. Functions that provide Connectivity are shown at the bottom. developed to save data. The structure of \"doGet\" function is shown in Appendix A. Each group of data received is saved with a timestamp, which recorded the date and hour.