Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Vorto » Use of events in Functional Block(Nothing found related to events in the code genreated by Javabeans generator)
Use of events in Functional Block [message #1731327] Wed, 04 May 2016 10:03 Go to next message
Mohammad Azeem is currently offline Mohammad AzeemFriend
Messages: 2
Registered: April 2016
Junior Member
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 #1731502 is a reply to message #1731327] Fri, 06 May 2016 09:41 Go to previous messageGo to next message
Alexander Edelmann is currently offline Alexander EdelmannFriend
Messages: 39
Registered: January 2015
Member
Hi Azeem,

you are absolutely right. The current generator simply ignores these function block event definitions. That is rather bad. I created a github issue for that: https://github.com/eclipse/vorto/issues/171. Feel free to comment it, if you need.
I am not quite clear , though, about what it should actually generate from this besides the event classes itself. Do you have any idea or propsal?

Cheers, Alex
Re: Use of events in Functional Block [message #1732523 is a reply to message #1731502] Tue, 17 May 2016 20:33 Go to previous messageGo to next message
Mohammad Azeem is currently offline Mohammad AzeemFriend
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

Re: Use of events in Functional Block [message #1733600 is a reply to message #1732523] Mon, 30 May 2016 11:33 Go to previous message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
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

Previous Topic:Generate several files
Next Topic:ThingWorx Example Generator Problems
Goto Forum:
  


Current Time: Thu May 02 06:48:57 GMT 2024

Powered by FUDForum. Page generated in 0.03868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top