Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Does 4DIAC support Bluetooth Low Energy connection?(Does 4DIAC support Bluetooth Low Energy connection?)
Does 4DIAC support Bluetooth Low Energy connection? [message #1859686] Thu, 22 June 2023 12:14 Go to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
I want to use Bluetooth Low Energy connection on Beaglebone. Is there any guideline for this topic? Also, I want to program more features on that Bluetooth connection such as when and what will be transferred and start/stop the communication process, synchronization, multiple devices connection, etc. How can I do that?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859744 is a reply to message #1859686] Sat, 24 June 2023 12:06 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

For that you most probably will need to develop your own set of communication function blocks. You can have a look on our communication development documentation to get background how we normally integrate a new communication protocol. https://eclipse.dev/4diac/en_help.php?helppage=html/development/forte_communicationArchitecture.html
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859762 is a reply to message #1859744] Mon, 26 June 2023 08:59 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
What is the difference between segments, such as CAN, EPL, and Ethernet? Which one should I use for the above Bluetooth Low Energy connection? Or I need to develop new segments myself?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859772 is a reply to message #1859762] Mon, 26 June 2023 15:31 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Segments are currently used only in the tool mostly for documentation purposes. They have no effect on the run-time behavior. For that 4diac FORTE only uses the parameters given to the communication FB.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859789 is a reply to message #1859772] Tue, 27 June 2023 11:37 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Does Publish/Subscribe still necessary? Shall it be placed before or after the new communication FB? For example, Application-> Subscribe/Publish -> Communication FB -> Ethernet or Application -> Communication FB -> Subscribe/Publish-> Ethernet?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859790 is a reply to message #1859789] Tue, 27 June 2023 11:45 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Did you have a look on our communication architecture document I posted above? We are currently doing all of our communication via either PUBLISH/SUBSCRIBE or CLIENT/SERVER.

But if you develop your own communication FBs you don't need PUBLISH SUBSCRIBE. However I don't understand what you meen with -> Ethernet or Application ->
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859793 is a reply to message #1859790] Tue, 27 June 2023 12:08 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Nice, I got it. Thank you so much for your support.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859803 is a reply to message #1859793] Tue, 27 June 2023 16:42 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Great!
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859946 is a reply to message #1859803] Thu, 06 July 2023 14:23 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Any hints on how to write basic functions for this Bluetooth communication, such as openConnection, closeConnection, etc? It seems like all communication protocols are different to each other, and none of them use Bluetooth Low Energy. Will this link be appropriate for references?
https://marketplace.eclipse.org/content/bluetooth-binding

[Updated on: Thu, 06 July 2023 14:24]

Report message to a moderator

Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1859950 is a reply to message #1859946] Thu, 06 July 2023 15:34 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Unfortunately a generic answer is hardly possible. You have seen that each of the protocols is doing different things. How to implement this depends a lot on any libraries and hardware you are using.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860515 is a reply to message #1859950] Fri, 11 August 2023 08:15 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Hi, thanks for your reply. I have another problem. Currently, I want to start a kind of round running independently and within each round I need to perform a chain of actions at a fixed time.
Let's say: Round 1 starts at time 10ms, then action A should be called at 30ms, then action B is called at 40ms, and action C is called at 60ms.
Then Round 2 starts at time 110ms..... will perform those chains of actions again.

Which class should I inherit from to perform those task? I reviewed CEventSourceFB, CExternalEventHandler, CThread, CEventChainExecutionThread, and CThreadBase but not quite clear what's the difference between those and how it works. Can you provide a short description of those and if possible suggest which one I should use?

Again, many thanks for your support.

[Updated on: Fri, 11 August 2023 08:16]

Report message to a moderator

Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860518 is a reply to message #1860515] Fri, 11 August 2023 12:50 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

I think you could build that requirement with E_CYCLE and E_DELAY chains. Also you could look at the E_TRAIN or E_TABLE fbs.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860536 is a reply to message #1860518] Mon, 14 August 2023 08:27 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Can I implement it as External Event Handler for communication FBs?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860539 is a reply to message #1860536] Mon, 14 August 2023 10:18 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

For sending or receiving? For sending I'm not sure if it is a good idea. For receiving it could work.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860549 is a reply to message #1860539] Tue, 15 August 2023 13:45 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Is it possible to use standard Pulish/Subcriber/Server/Client FBs, and then create a new class inherited from CEventSourceFB. Then, somehow connect 2 objects with each other?

If it possible, in what way should I connect these two?

[Updated on: Tue, 15 August 2023 13:46]

Report message to a moderator

Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860551 is a reply to message #1860549] Tue, 15 August 2023 19:11 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

In general yes it is possible. But not sure if you should do this with standard communication FBs. What you could do is to write your one communication layer that is doing something what you need. But as said in my comments above I think separating the fb and the timing behavior may be the better option.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860563 is a reply to message #1860551] Thu, 17 August 2023 09:18 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Correct me if needed. So I will create another communication layer that handles time events?

What class should I inherit from CExternalEventHandler + CThread or CEventSourceFB? I am not sure what CExternalEventHandler is used for and whether it can register and receive events from Timer or not. If I use CExternalEventHandler + CThread, will it have the same structure as http_handler?
For CEventSourceFB, as the basic Client/Server/Publish/Subscribe already has CBaseCommFB to manage input/output,... Is it possible for using 2 internal classes CBaseCommFB and CEventSourceFB for 1 physic FB on 4diac IDE? Should the new class define all input/ output?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860627 is a reply to message #1860563] Tue, 22 August 2023 12:03 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Hi, It's quite a long time since my last question. Does anyone have any idea for below question?

What class should I inherit from CExternalEventHandler + CThread or CEventSourceFB? I am not sure what CExternalEventHandler is used for and whether it can register and receive events from Timer or not. If I use CExternalEventHandler + CThread, will it have the same structure as http_handler?
For CEventSourceFB, as the basic Client/Server/Publish/Subscribe already has CBaseCommFB to manage input/output,... Is it possible for using 2 internal classes CBaseCommFB and CEventSourceFB for 1 physic FB on 4diac IDE? Should the new class define all input/ output?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860633 is a reply to message #1860627] Tue, 22 August 2023 13:44 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Sorry I was rather busy.

Before coming to your question a few points for clarification: An ExternalEventHandler is a class that represents one single source of external events (e.g., a network interface, a timer interrupt). As External Events are something critical you should use them sparsely and well considered.

With the information that you provide I'm still not sure what you would like to achieve and why this has to be in a communication layer. We have blocks that can generate timed events which you can then use to trigger the sending of data. Reception of data is currently linked to the arriving of the data.

If we could have a bit more background we can also give better guidance on how to best implement certain features in Eclipse 4diac.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860655 is a reply to message #1860633] Thu, 24 August 2023 08:05 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
I am trying to implement this communication protocol into 4DIAC:
https://dl.acm.org/doi/pdf/10.1145/3274783.3274849

This protocol divides slots for each time transmit/receive. Within these slots, data processing tasks such as "Tx decision", "process prior Rx packet", "house-keeping", and "prepare next Tx packet" should be called at a specific time within the slot. See figure 2, you might have a better grip on the problem.

Again, many thanks for your support. I really appreciate.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860672 is a reply to message #1860655] Thu, 24 August 2023 19:04 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Is it necessary that you do that in a communication layer. I'm not perfectly sure if publish, subscribe, client or server are fitting. Would it make more sense to develop your one communication FB?

Does all this code has to be in C++. What speaks against using FBs for the timing and data processing decisions? And use a Subscribe for the data reception and a Publish for the data sending. You could wrap everything into a CFB or Subapp if that makes it better to use.

Do you need timed activities for sending?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860684 is a reply to message #1860672] Fri, 25 August 2023 05:46 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Is it possible to develop my own communication FB using a standard CComLayer class? If possible, yes, I think it will be easier for the users.

Got, your point. So, within the sub-app, there will be 1 FB for timing, 1 FB for data processing decisions, and then a Subscriber and a Publisher? Is it possible to send structure data with adjustable size to subscribers? Or it should be a fix data type?

Yes, the sending activities need to be on time.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860687 is a reply to message #1860684] Fri, 25 August 2023 07:09 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Quote:
Is it possible to develop my own communication FB using a standard CComLayer class? If possible, yes, I think it will be easier for the users.

I think this is a lot of effort. Would not be my first step if I where you.

Quote:
Got, your point. So, within the sub-app, there will be 1 FB for timing, 1 FB for data processing decisions, and then a Subscriber and a Publisher? Is it possible to send structure data with adjustable size to subscribers? Or it should be a fix data type?

If you set it up with ANY and use Communication layers that will handle the any's correctly it should work. I guess using PUBLISH_ / SUBSCRIBE_1 and STRUCT data should work best in your case.

The reason I suggested the discrete approach with FBs is that you can get quicker to first results and see how it is working and do first measurements. If 4diac FORTE has then to much overhead you can always improve later.


Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860692 is a reply to message #1860687] Fri, 25 August 2023 12:55 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
Ok, I understand. Thank you very much for your support.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1860694 is a reply to message #1860692] Fri, 25 August 2023 13:44 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Happy to support you.
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1861418 is a reply to message #1860694] Wed, 11 October 2023 21:23 Go to previous messageGo to next message
Han Nguyen Thanh Tuyet is currently offline Han Nguyen Thanh TuyetFriend
Messages: 24
Registered: June 2023
Junior Member
How to handle ANY data type correctly? I tried to find the correct way to handle struct data transmission between FBs but was unsuccessful. It seems like we should already know the size of the struct data before sending it to other FBs and that FBs should already know the size of the struct? Should I serialize the struct before sending and deserialize after receiving (sending and receiving between FBs)?
Re: Does 4DIAC support Bluetooth Low Energy connection? [message #1861603 is a reply to message #1861418] Sat, 21 October 2023 16:58 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

You can ask any variables what concrete type they represent and based on that determine how to send them. You can see an example for that in the FBDK ASN.1 layer.
Previous Topic:How to use client fbd for http
Next Topic:[esp32][how-to] forte build instruction.
Goto Forum:
  


Current Time: Sun Apr 28 06:58:09 GMT 2024

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

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

Back to the top