Lab 2a - Introductory

上传人:东****0 文档编号:156467629 上传时间:2020-12-18 格式:PDF 页数:23 大小:689.41KB
返回 下载 相关 举报
Lab 2a - Introductory_第1页
第1页 / 共23页
Lab 2a - Introductory_第2页
第2页 / 共23页
Lab 2a - Introductory_第3页
第3页 / 共23页
Lab 2a - Introductory_第4页
第4页 / 共23页
亲,该文档总共23页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《Lab 2a - Introductory》由会员分享,可在线阅读,更多相关《Lab 2a - Introductory(23页珍藏版)》请在金锄头文库上搜索。

1、读万卷书 行万里路 1 Lab 2 Lab 2 Introductory Introductory and Autopsy Laband Autopsy Lab Tutorial OverviewTutorial Overview This lab guides a developer through simple, yet complete, lessons in the use of Vantiq Automation Services. It uses an example from the Internet of Things (IoT): processing engine sens

2、or data to detect and diagnose an overheating engine. The lessons include the definition of data types to record sensor data and rules to process that data and to correlate sensor data to provide overheating alerts. The tutorial also includes lessons on how to generate simulated sensor data and to m

3、onitor the situational results generated by that data in real-time. Lesson 1: Creating Data TypesLesson 1: Creating Data Types The simulated engine for this example includes two sensors: temperature and speed. These two sensors each produce a stream of data which is stored in the Situational Awarene

4、ss database. The first task is to define the data types for that sensor data. Navigate to the DevelopTypes tab in the Developer Portal: 读万卷书 行万里路 2 Use the NewNew TypeType button to create a temperature sensor type: The EngineTempUpdate type contains two properties: systemId: a String property which

5、 identifies which system contains the engine temperature: an Integer property containing the engine temperature, in degrees Fahrenheit Both systemId and temperature are required to make sure the sensor sends well-formed data. Once these two user properties are defined, use the SaveSave button to sav

6、e the EngineTemp type. 读万卷书 行万里路 3 Use the NewNew TypeType button again in the same manner to create a speed sensor type, EngineSpeed, with two properties: speed: an Integer property containing the engine speed, in miles per hour systemId: a String property which identifies which system contains the

7、 engine Both speed and systemId should be marked as required properties. Use the NewNew TypeType button a third time to create an overall system status type, SystemStatus, which is used to correlate the most recent properties of engine temperature and speed: engineSpeed: an Integer containing the mo

8、st recent engine speed engineTemp: an Integer containing the most recent engine temperature systemId: a String property which identifies which system contains the engine Only systemId should be marked as a required property since the properties of engineSpeed and engineTemp will be updated by sensor

9、 properties as they become available. Finally, use the NewNew TypeType button a fourth time to create a type, SystemHUD, which could represent a heads-up display to alert the user to an engine overheating condition: alertMsg: a String property which contains any alert message, if present systemId: a

10、 String property which identifies which system contains the engine 读万卷书 行万里路 4 Only systemId should be marked as a required property since the property of alertMsg will be updated by the Vantiq server using Rules, which youll define in an upcoming lesson. The systemId property is a unique identifier

11、 that is present in all four types and allows the sensors to be associated with one system (e.g. car or industrial machine). Lesson 2: Creating Data InstancesLesson 2: Creating Data Instances For our example, you must create two entries in the Situational Awareness database that define a simulated e

12、ngine: one of type SystemStatus and one of type SystemHUD. Navigate to the DataAdd Record tab in the Developer Portal, then use the TypeType pull- down menu to create an entry for our engine status entry: Select the SystemStatus Data Type since you are creating a SystemStatus entry. Enter Auto012345

13、6789 as the systemId property, which represents our simulated engine system identifier. Use the AddAdd NewNew RecordRecord button to save the entry. This creates one SystemStatus entry for the Auto0123456789 engine system. 读万卷书 行万里路 5 Navigate to the DataAdd Record tab again to create an entry for o

14、ur HUD entry: Select the SystemHUD Data Type since you are creating a SystemHUD entry. Enter Auto0123456789 as the systemId property. Use the InsertInsert NewNew RecordRecord button to save the entry. This creates one SystemHUD entry for the Auto0123456789 engine system. Lesson 3: Creating RulesLess

15、on 3: Creating Rules Rules are used to recognize that data has been added to or modified in the Situational Awareness database and organize that data for further processing. In our example, there are three Rules: two that correspond to the engine temperature and speed sensor data streams and one to

16、update the heads-up display (HUD). Navigate to the DevelopRules tab in the Developer Portal: 读万卷书 行万里路 6 Use the NewNew RuleRule button to create our temperature sensor processing rule: The processEngineTempStream rule is defined as follows: RULE processEngineTempStreamRULE processEngineTempStream WHEN INSERT OCCURS ON EngineTempWHEN INSERT OCCURS ON EngineTemp UPDATE Sy

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 教学课件 > 高中课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号