Use of events in Functional Block [message #1731327] |
Wed, 04 May 2016 06:03  |
Eclipse User |
|
|
|
Hello,
Can you please let me know the use of events in the functional block. I just created the test information model to play around with the vorto functionalities. I used the java bean code generator to generate the code artificats but found nothing related to events in the genearted code.
Currently in the functional block there is no section defined for the events. I manually added the events after the fault section (referred from tutotrial) and seems the code genertaor is unable to recognise this section.
Thanks,
Azeem
|
|
|
|
Re: Use of events in Functional Block [message #1732523 is a reply to message #1731502] |
Tue, 17 May 2016 16:33   |
Eclipse User |
|
|
|
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 17:08] by Moderator
|
|
|
Re: Use of events in Functional Block [message #1733600 is a reply to message #1732523] |
Mon, 30 May 2016 07:33  |
Eclipse User |
|
|
|
Hi Azeem,
in Vorto it is currently not in scope to specify function calls as you did in your example. Vorto focuses only on describing interfaces.
The event section within functionblocks allows to specify the structure of an event. That means it specifys the data type that is send in case the event is fired. However currently there is no mechanism in Vorto available to link the event to an eventable property. This is something we need to improve and we are definitely looking for ideas and feedback! Would you be interested in collecting related ideas together with the Vorto community in the Vorto Wiki?
Cheers,
Olaf
|
|
|
Powered by
FUDForum. Page generated in 0.05358 seconds