Data Driven vs Command Driven Event Driven vs

  • Slides: 72
Download presentation

Data - Driven Φιλοσοφία vs. Command - Driven

Data - Driven Φιλοσοφία vs. Command - Driven

Event - Driven Φιλοσοφία vs. Polled - Scheduling

Event - Driven Φιλοσοφία vs. Polled - Scheduling

Neuron C (NV, CP, FB, Events, Msgs) Ø Network Variables (Δήλωση στη Neuron C

Neuron C (NV, CP, FB, Events, Msgs) Ø Network Variables (Δήλωση στη Neuron C και Firmware) Δημιουργεί το ένα μέρος του Lonworks Device Interface. Standard Network Variable Types = SNVT’s Πχ. network output SNVT_lev_disc nvo_switch; Ø Configuration Properties (Device Behavior Customization) Δημιουργεί το άλλο μέρος του Lonworks Device Interface. Standard Configuration Property Types = SCPT’s Μορφοποιούνται από κάποιο Network Tool (πχ. Lon. Maker) Ø Functional Blocks (Network Variables + Configuration Properties) defined by Functional Profiles Ø Event driven scheduling system Πχ. // Event driven Task when (io_changes(Switch 2) ) { nvo_switch_state = input_value; } ØLower level messaging service Πχ. // Message Task when (msg_arrives(10) ) { ………… }

Neuron C (Timer, I/O Object) Ø Timer (Δηλώνονται στη Neuron C σαν μεταβλητές και

Neuron C (Timer, I/O Object) Ø Timer (Δηλώνονται στη Neuron C σαν μεταβλητές και ελέγχονται από το Firmware) Πχ. stimer 1 = 5; // start timer 1 with value 5 seconds when (timer_expires(timer 1) ) { ………… } ØI/O Objects (Δήλωση στη Neuron C και Firmware) Είναι standardized I/O Device Drivers για το Neuron chip. Πχ. IO_4 input bit Switch 1; IO_1 output bit relay 1; IO_6 output bit io_nw 1_cs = CS_OFF; IO_7 output bit io_nw 2_cs = CS_OFF; IO_8 neurowire master select(IO_0) kbaud(20) io_nw 1; IO_8 neurowire master select(IO_7) kbaud(20) io_nw 2;

I/O OBJECTS

I/O OBJECTS

Direct I/O Objects (logic at pins) Timer / Counter I/O Objects

Direct I/O Objects (logic at pins) Timer / Counter I/O Objects

Serial I/O Objects (I or O) Serial I/O Objects Parallel I/O Objects

Serial I/O Objects (I or O) Serial I/O Objects Parallel I/O Objects

Neuron Chip I/O Objects

Neuron Chip I/O Objects

EVENTS “WHEN”

EVENTS “WHEN”

Προκαθορισμένα (Predefined) Events Συστήματος / Scheduler Πχ. when (timer_expires(timer 1) ) { ………… }

Προκαθορισμένα (Predefined) Events Συστήματος / Scheduler Πχ. when (timer_expires(timer 1) ) { ………… } Events από Ι/Ο Πχ. when (io_changes(Switch 2) ) { ………… }

Προκαθορισμένα (Predefined) Events από NV Πχ. when (nv_update_occurs(nvi_relay_state) ) { io_out(relay 1, nvi_relay_state); }

Προκαθορισμένα (Predefined) Events από NV Πχ. when (nv_update_occurs(nvi_relay_state) ) { io_out(relay 1, nvi_relay_state); } Events από Messages Πχ. when (msg_arrives(10) ) { ………… }

User - Defined Events Κάθε Neuron C έκφραση η οποία έχει Boolean αποτέλεσμα Δηλαδή

User - Defined Events Κάθε Neuron C έκφραση η οποία έχει Boolean αποτέλεσμα Δηλαδή 1 ή 0 (True or False) Πχ. when ((timer_expires(timer 1) ) && (flag == TRUE)) // Task to execute { ………… }

NETWORK VARIABLES (NV’s) nvo (output NV) nvi (input NV)

NETWORK VARIABLES (NV’s) nvo (output NV) nvi (input NV)

Node 1 Node 2 nvo… nvi 3…. Node 1 Node 2 Node 3 nvo…

Node 1 Node 2 nvo… nvi 3…. Node 1 Node 2 Node 3 nvo… nvi 1…. nvi 2…

NV Declaration Modifier (sync, polled …) Class (const, eeprom …) Conn (ackd, unackd …)

NV Declaration Modifier (sync, polled …) Class (const, eeprom …) Conn (ackd, unackd …) Type (SNVT…) Παραδείγματα Απλή δήλωση Με Priority Χωρίς ACK

Δομές - SNVT Structures

Δομές - SNVT Structures

Enumeration Lists

Enumeration Lists

CONFIGURATION PARAMETER TYPES (SCPT’s)

CONFIGURATION PARAMETER TYPES (SCPT’s)

FUNCTIONAL BLOCKS

FUNCTIONAL BLOCKS

ΣΥΝΑΡΤΗΣΕΙΣ ΤΗΣ NEURON C (Functions)

ΣΥΝΑΡΤΗΣΕΙΣ ΤΗΣ NEURON C (Functions)

Execution Control

Execution Control

Network Configuration

Network Configuration

Integer Mathematics Κλπ ………………. .

Integer Mathematics Κλπ ………………. .

Floating point Mathematics Κλπ ………………. .

Floating point Mathematics Κλπ ………………. .

Strings

Strings

Utilities

Utilities

I/O

I/O

Preprocessor / Compiler Directives

Preprocessor / Compiler Directives