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 » IEC 61850 Sampled Values(Data Packet creation error)
IEC 61850 Sampled Values [message #1807080] Wed, 22 May 2019 10:14 Go to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
I have written two communication layers for enabling sampled value communication. I am very new to development of these topics.

Few queries in this regard:


  1. Which variable stores the value of the data from the FB? Why is serialization required?
  2. When I manually create the data packet and send it over the network and try to read the data over wireshark, I lose two bytes of data every time. Any ideas on this?
  3. How to configure data display on the FB's after data is received through and the network?
  4. The aim is to just show the data on the FB's, there is no hardware I/O's involved.


Any help in this regard is deeply appreciated.
Re: IEC 61850 Sampled Values [message #1807152 is a reply to message #1807080] Thu, 23 May 2019 19:01 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi,

I'll try to answer your questions although you give as very little information

ad 1) in the layer you can access the FB and the CommFB has helper methods to access the in and outputs of your FB. Please refer to other top layers for reference on that. Serilaisation is need to define how the data of data types needing more then one byte is mapped to the byte stream to e sent on the network.

ad 2) no idea

ad 3) I'm not sure if I understand your question, but I think the answer from 1 applies here as well.

I hope this helps,
Alois
Re: IEC 61850 Sampled Values [message #1807160 is a reply to message #1807152] Thu, 23 May 2019 21:41 Go to previous messageGo to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
Hi Alois,

Thank you for the reply.

1. If serialization is the need to define how the data of data types needing more than one byte is mapped, the question I have is while creating the Ethernet frame for the sampled value what is to be serialized? Just the data or the whole Ethernet frame packet?
2. The question was on how to get the data from FB and then update the output data. I guess going through the methods in CommFB can be helpful. I will keep you updated regarding this.

Thank you,
Karthik
Re: IEC 61850 Sampled Values [message #1807172 is a reply to message #1807160] Fri, 24 May 2019 06:12 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi Karthik,

you are welcome. Regarding your question 1: This strong depends on the protocol and the library you are using. If you use the IP layer from 4diac FORTE then you only have to provide the data content of the IP frame.

Alois
Re: IEC 61850 Sampled Values [message #1807282 is a reply to message #1807172] Mon, 27 May 2019 11:43 Go to previous messageGo to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
Hi Alois,

I am not using IP layer. Since, Sampled Values/ GOOSE are data link layer as per definition. I have modified the first set of files (bsdsocketinterface.hcpp) file to include methods for socket connection and disconnection for a data link layer communication. and a second set of files svcomlayer.hcpp (written on the basis of ipcomlayer.hcpp) we form the data packet as per SV frame rules.

The plan is to get the data from the FB writing set of files similar to (FBDKasn1ayer.hcpp) to then send it to the lower layer (svcomlayer.hcpp). So the question is, if the data is to be serialized in this case? or we need to serialize the data packet?

Karthik
Re: IEC 61850 Sampled Values [message #1807303 is a reply to message #1807282] Mon, 27 May 2019 19:31 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi Karthik,

First of all please let me warn you about changing 4diac FORTE code. This has not only license issues but this may also bring you maintenance problems. If we update the code you have to manually add our fixes and updates to your code. If possible separating your code by extending from our classes or using our classes as members of yours is always better.

Where and in which form to generate your data packet depends on several things. We have split the data serialization following the FBDKasn1 approach [1] from the network code because this gave us much more flexibility. We can now send and receive FBDKasn1 encoded data across different network protocols by just defining a different layer below it. For example we used it on MQTT, AMQP, TCP, UDP, CAN, Serial communication. Also we can insert more layers like encryption. The same holds with the lower layers we can put different on top e.g., sending other encodings across MQTT.

So in your case it can make sense to have two layers if you want to send the same data packet across different transport means. If this is always the same for you I would say it would be easier for you to have one layer where you take the data from the FB generate the correct packet and send it over the network.

Cheers,
Alois


[1] To be correct FBDKasn1 layer implements the Interoperability Provisions defined in the "IEC 61499 Compliance Profile for Feasibilty Demonstrations"
Re: IEC 61850 Sampled Values [message #1807331 is a reply to message #1807303] Tue, 28 May 2019 09:41 Go to previous messageGo to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
Hi Alois,

Thank you. As you might know that SV/GOOSE are data-link layer communications. Most of the network protocols which are presently configured are higher level communications like TCP, UDP. If there are methods to actually access the Ethernet sockets in the 4diac forte code (something which allows me to send some lower level protocols like ARP or even some random data), please let me know. My case is more of an experimental project and also like a test case. As of now I face no issues in the modifications done. But I will keep your suggestions in mind.

Karthik
Re: IEC 61850 Sampled Values [message #1807368 is a reply to message #1807331] Tue, 28 May 2019 16:03 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi,

sorry I have no idea how SV/GOOSE works.

If you need raw sockets then I would recommend to implement this in your own independent layer using the API from the operating system you are targeting. Especially when you are doing a first experiment.

Cheers,
Alois
Re: IEC 61850 Sampled Values [message #1807608 is a reply to message #1807368] Tue, 04 June 2019 17:35 Go to previous messageGo to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
Hi,

I am currently doing the same, I have removed the codes from existing FORTE code. But, recently when I tried implementing Publish/Subscribe over UDP example as shown in the documentation, I face an error. The the event from the E_Delay block doesn't drive the REQ of INT2INT FB to 1. Please find the image attached for your reference. Could you tell me what I may have done wrong in this?

Karthik
Re: IEC 61850 Sampled Values [message #1807609 is a reply to message #1807608] Tue, 04 June 2019 19:26 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
With the information that you gave I would assume that you have a 4diac FORTE without the convert and teh IEC 61131-3 module.

Do you get any error messages in the deployment console?
Re: IEC 61850 Sampled Values [message #1808347 is a reply to message #1807609] Fri, 21 June 2019 19:21 Go to previous messageGo to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
Dear Alois,

Yes, I had forgot to enable the CONVERT and IEC-61131 modules in forte. It works fine as of now. Thank you.

As of now, I have a data link layer setup between a laptop and raspberry Pi and this comms protocol is expected to communicate at a rate of 4000 packets/second. This is not possible to obtain in regular Linux kernel (Vanilla). In case of installing a Linux RT kernel patch, how to enable forte to run in real time? I use a RT patch on Ubuntu!

Thank you,
Karthik

[Updated on: Fri, 21 June 2019 19:21]

Report message to a moderator

Re: IEC 61850 Sampled Values [message #1808392 is a reply to message #1808347] Sun, 23 June 2019 17:51 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi,

the easiest way is to use the chrt command [1] on FORTE. With that you can give FORTE as a whole higher real-time properties. If you need finer control you need to change also the thread implementation in FORTE.

Cheers,
Alois

[1] https://www.cyberciti.biz/faq/howto-set-real-time-scheduling-priority-process/
Re: IEC 61850 Sampled Values [message #1808545 is a reply to message #1808392] Wed, 26 June 2019 15:30 Go to previous messageGo to next message
Karthik Sharma is currently offline Karthik SharmaFriend
Messages: 7
Registered: May 2019
Junior Member
Hi,

Thanks for the support link. It unfortunately does not work because I have data being generated from multiple sources. I have a multiple client and single server connected to a single switch situation and I have to check for the data packets and then reject 1/3rd of them as they have all the same destination address (sort of broadcast) and the data checking happens from one of the encoded data-bytes inside the data packet. So I need to run a check loop and this has created the delay. Unfortunately this is how my system is expected to work. and the following error is received.

ERROR: T#XXXXXXX: External event queue is full, external event dropped!

I am intending to implement multi-threaded process to handle the data packets using posix pthread until the dropping happens this would enable me to read less amount of data. How is TCP/UDP reception implemented if there are multiple data packets which are broadcast into a single switch at a very high fast rate?

Thanks,
Karthik

[Updated on: Wed, 26 June 2019 16:22]

Report message to a moderator

Re: IEC 61850 Sampled Values [message #1808550 is a reply to message #1808545] Wed, 26 June 2019 17:08 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi,

is it possible to have the three clients in three different resources? Then you would automatically have three different threads. But I'm from your description not perfectly sure of multithreading is solving your problem. Would it be possible that you share your application with us. Either here in the forum or privately to me (e.g., private channel to azoitl mattermost.eclipse.org, or alois.zoitl@gmx.at)?

Alois
Re: IEC 61850 Sampled Values [message #1808622 is a reply to message #1808550] Thu, 27 June 2019 21:36 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
Hi,

I gave your issues a second thougt and got two further ideas . First of all I would run 4diac FORTE with the perf tools. This would give us hints where the execution time is spent. This would give us hints where to focus the optimization efforts.

Another thing that I know is that we are currently are utilizing mutexes for protecting data connections. This costs quite some performance (roughly 40%) depending on your application (which I still have to get) you can disable this mutex and get more performance out of 4diac FORTE.

Currently we can not remove this mutex in general. We are considering different approaches for getting rid of it. But we haven't found anything yet.

[Updated on: Fri, 28 June 2019 06:08]

Report message to a moderator

Re: IEC 61850 Sampled Values [message #1808714 is a reply to message #1808622] Sat, 29 June 2019 18:58 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 914
Registered: January 2014
Senior Member
As I was doing an experiment today I noted a few more generic things that should be considered when working on high performance applications in 4diac FORTE:

  • Set your CMake build to RELEASE build type
  • Ensure that you build at least with the -O2 compile option, even better is O3. Check compile output for that. You can set that option in the CXX and CFlags options of CMake
  • Disable all test options in your CMake config
  • Disable all logging output and remove any hard coded printfs or similar. Console output is very costly!

Previous Topic:Some idea about how to implement persistence of input parameters in 4diac-forte
Next Topic:@Mr. Zoitl about PLCopen
Goto Forum:
  


Current Time: Sat Dec 07 11:12:01 GMT 2019

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

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

Back to the top