# Design and Performance of a XBee 900 MHz Acquisition System Aimed at Industrial Applications
## 3 Design of a Wireless Monitoring System
### Logical TDMA Protocol over XBee
Currently, the systems executes a static plan which must be designed before starting up the system, and it is not possible to change it in real-time. Although this feature may be implemented in the future, the authors believe that this approach may be suitable for a large number of industrial applications. Figure 3: Broadcast command frame sent from the Coordinator Node to the Smart Measuring Nodes. Figure 5 shows the structure of a configuration frame with one example. This frame allows for different configurations at the nodes. Configuration frames are issued to the devices attached to the destination address specified in the frame, (0x0013A20041 AF5A69 in Figure 5). The frame sets the Nodel to the device, 0x03. The configuration allows simple sampling and multiple sampling, which consist on taking several samples after the reception of one measurement order. Several parameters are related to this feature. For example, in Figure 5, four samples are taken per frame, N.SamplesFrame, and only one sensor of the board is used, N.Sensors. The sampling period used between measurement messages in this case is 25 ms, SamplingPeriod [ms] = 0x19. The offset defines the time interval that the smart node must wait from the reception of the command to its transmission. Several slots are defined for the offset. Finally, the checksum is used to detect transmission errors. Figure 6 shows the behavior of the system when nodes are configured for multiple sampling operations. It can be appreciated that the monitoring system behaves differently to Figure 2. In this configuration, when Smart Measuring Nodes receive a broadcast measuring order, it is their responsibility to sample at the required sampling frequency until a new broadcast measuring command is delivered by the Coordinator Node. This information is set up at the configuration stage, by means of the N.SamplesFrame and SamplingPeriod parameters sent in the frame of Figure 5. The offset indicates how much time the smart measuring node must hold the frame before sending it to the Coordinator Node. In this frame, an offset value of 0x02 means that it must wait two time slots to send the data collected. Thus, determinism is ensured since other devices, e.g., Smart Measuring Node 1 and Smart Measuring Node 2, may send the frames at offset = 1 and offset = 2, respectively. This configuration is repeated every time that Smart Measuring Nodes receive a broadcast measurement command, which is issued periodically according to the plan scheduled at the Coordinator Node. Figure 4: Frame used by the microcontroller at the Smart Measuring Nodes to send the values acquired from the sensors. Figure 5: Configuration frame sent by the Coordinator Node to one Smart Measuring Node. In Figure 6, three Smart Measuring Nodes were configured to take measures synchronously. The broadcast measuring command is issued periodically at T\({}_{\text{broadcast}}\) intervals, and every node takes three measures of the attached sensors at T\({}_{\text{sampling}}\) intervals. The correct use of the offsets allows one to increment the sampling period at the Smart Measuring Nodes. Figure 6 shows the broadcast measuring command and distributed collected values messages.