Skip to main content



      Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Identifying function blocks individually within the code
Identifying function blocks individually within the code [message #1834018] Fri, 30 October 2020 06:09 Go to next message
Eclipse UserFriend
Hi,
I am using a simple blink example with a redundant application. I wish to send a stream on each individual FB and wished to see if there was a way to identify them through the code. for example, I want to check if the FB is E_SWITCH then perform some task, and then check if the FB is E_SWITCH_1 and then perform something else. Is there a way to do so?

[Updated on: Fri, 30 October 2020 07:56] by Moderator

Re: Identifying function blocks individually within the code [message #1834036 is a reply to message #1834018] Fri, 30 October 2020 10:50 Go to previous messageGo to next message
Eclipse UserFriend
hi,

can you please expand a bit on what you mean with sending a stream on each individual FB?

Regarding the identification of individual FBs: In 4diac FORTE each FB type is a class and each FB instance will be an instance of this class. In the C++ code you can access the instance name of the FB and us that for identification.

If you would like to get event streams a hook can be the code in the CFunctionblock base class where input events are received and outputevents are sent.

I hope this is in the direction that you asked.

BR,
Alois
Re: Identifying function blocks individually within the code [message #1834038 is a reply to message #1834036] Fri, 30 October 2020 11:25 Go to previous messageGo to next message
Eclipse UserFriend
Like in the attached image the E_CYCLE is sending out Events to both E_SWITCH and E_SWITCH_1. since they are sent as multicast, as soon as the ReceiveFromUDP function is called my custom function gets called for both the SWITCHES, What I would like to do is check if it is E_SWITCH then call the custom function and similarly for E_SWITCH_1.

VG,
Shobhit

[Updated on: Fri, 30 October 2020 11:28] by Moderator

Re: Identifying function blocks individually within the code [message #1834042 is a reply to message #1834038] Fri, 30 October 2020 15:31 Go to previous messageGo to next message
Eclipse UserFriend
Ah thanks for the clarification. IEC 61499 states that FBs are encapsulated and they will behave the same independent to whom they are connected. Given your setup I think it would make more sense to have a dedicated configuration parameter as part of your receiving layer (I think it is also better to not modify our udp receiving code but have a dedicated layer on top which handles that, I remember Mario de Sousa had a nice paper on that topic). Or if that is not what you want better check on resource or devices. Although I think the first option is better configureable by the user.
Re: Identifying function blocks individually within the code [message #1834444 is a reply to message #1834036] Tue, 10 November 2020 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Can you please point in the direction to get the FB names, I have been trying a few things but seemingly cannot fetch the FB names in the BSDSocketinterface.cpp file as intended.
Re: Identifying function blocks individually within the code [message #1834452 is a reply to message #1834444] Tue, 10 November 2020 09:47 Go to previous message
Eclipse UserFriend
You should definitly change BSDSocketinterface.cpp for this task. Please create an additional layer. And I still think you should give the information as parameter to your layer and not search for FB instance names in the runtime.
Previous Topic:FORTE and OpenDSS
Next Topic:Arrowhead framework & Registering Services
Goto Forum:
  


Current Time: Tue Jul 01 21:53:21 EDT 2025

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

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

Back to the top