|
|
Re: Use of events in Functional Block [message #1732523 is a reply to message #1731502] |
Tue, 17 May 2016 20:33 |
Mohammad Azeem Messages: 2 Registered: April 2016 |
Junior Member |
|
|
Hello Alex,
I don't know the exact use of events in the functional block, but to me it seems that it is related to provide some sort of notification to the object that some interesting/unusual thing has happen.
The IoT and Industry 4.0 due to its dynamic state, often needs some function to call or execute when its current state changes. The use of events might be helpful to provide the notification of the current state as realized in below cases:
a) When some fault or error occurred in the device, as in the functional block
Fault {
mandatory fatal_error as Boolean //"true if error occurred"
}
events {
fatal_error { // if the fatal_error occurred reset the device
resetDevcie();
}
}
Java Code:
=================
Function resetDevcie()
{
if(fatal_error)
{
// add logic to reset the device
}
}
b) When the function execution depends on some state, many times as in Industry 4.0 application, the same might be controlled with events :
Function Execute ( )
{
switch (state)
{
Case 1:
Case 2:
Case 3:
Default:
}
}
Functional Block:
===================
Status {
mandatory state as int //"collect the state of device"
}
events {
state { //execute function as per state
Execute ( );
}
}
The idea is to create the event specific functions whose execution depends on the variable defined inside the events block .Please let me know your thoughts on the same,
Thanks,
Azeem
[Updated on: Tue, 17 May 2016 21:08] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02955 seconds