Chapter 3 Sensors
Objectives of this Chapter
After reading this chapter, we will be able to do the following:
L describe different types of sensors used in the scenario and their usage.
L understand how the sensor is scheduled in the latency queue and scheduled queue, and when it is processed.
L callback functions can be compiled for data and timing sensors.
L set the priority of the delayed queue sensor (Delay-queue sensor.
This chapter describes how to add sensor nodes to a scenario. A sensor is an inventor object that can monitor multiple types of events and call user-provided callback functions when these events occur. Sensors are divided into two categories:Data SensorTo respond to data changes in the node domain, subnode, or path;Timing SensorTo respond to certain scheduling conditions.
Sensor Overview
A sensor is a special object class. It can be associated with the scenario database of inventor. It calls the user-provided callback function to respond to database changes or certain time events. Data sensor (fromSodatasensorTo monitor some data in the database. When the data changes, it notifies the application. Timing sensor (imageSoalarmsensorAndSotimersensorThe application will be notified when some types of time events occur. Note: The time "Event" only occurs in inventor. They are not part of the event model described in Chapter 10th. Figure 12-1 is a partial classification tree of a sensor.
For the complete translation of this chapter, please download the following link:
The inventor mentorOriginal English version. Download
The inventor mentorChinese translation. Download
The inventor mentorSample Code. Download