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 » FORTE - Matlab TCP/IP communication(Contribution to the community.)
FORTE - Matlab TCP/IP communication [message #1764178] Fri, 26 May 2017 12:41 Go to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
I just finished working on a Matlab class that enables the communication between Matlab and SERVER/CLIENT function blocks running on FORTE.

Since you have all been so helpful with my questions in the last few weeks, I would like to share my work with anyone in the community who may find it useful for validating IEC 61499 applications using Matlab simulations.

It uses only Matlab code and extends the tcpip class with wrapper methods (designed to match the FB interface) which automatically translate Matlab data types into byte-data that FORTE CSIFBs can understand and vice versa.
(uint8 <--> USINT; LREAL <--> double, etc. - currently, only numeric data types, BOOL, DATE_AND_TIME, STRING and WSTRING are supported).

A brief documentation can be found in the readme and some demo applications (system exports) that are designed to communicate with the Matlab object are provided along with a corresponding Matlab demo script. I will eventually update it in my free time.

https://github.com/MrcJkb/tcpip4diac.git


--------------------------------------
CHANGELOG
- I added support for transferring between Matlab datevec (a 6x1 double vector date/time format) and DATE_AND_TIME.
- Multiple STRING and WSTRING inputs and outputs at any positions are now possible.
- Using WSTRING issues a warning message because Matlab does not support wide chars and the usage has not been extensively tested.
- Added support for arrays (numeric data types, logical and DATE_AND_TIME. Only LREAL arrays have been tested extensively so far).
- Added reqNorsp() method for the purpose of sending data, performing computations in Matlab and then awaiting a response. See updated readme for usage example.

index.php/fa/29582/0/

[Updated on: Wed, 28 June 2017 09:49]

Report message to a moderator

Re: FORTE - Matlab TCP/IP communication [message #1764182 is a reply to message #1764178] Fri, 26 May 2017 13:20 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 523
Registered: January 2014
Senior Member
Wow! Thanks a lot. I can imagine that several users would be interested in that. If you have some text that we could put in a news item I'm happy to publish this also in the 4diac's news section on the webpage. Or if you want you can also write a tutorial on it for the 4diac help.
Re: FORTE - Matlab TCP/IP communication [message #1764195 is a reply to message #1764182] Fri, 26 May 2017 15:06 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
No problem.
Glad I could contribute something potentially useful :)

The GitHub repository includes a readme with detailed explanations on the syntax. And I added a demo script (with explanatory comments) along with two exported systems (.sys files) for the following demos:

- Client on Matlab, SERVER_1 FB on FORTE
- Server on Matlab, CLIENT_1 FB on FORTE

I don't think I'll have time to write any more about it anytime soon, since I will be setting up a Matlab/4diac co-simulation for validating an application and generating CSVs for function block unit tests. But I will probably add a section about it in my thesis (which should be published online by the end of this year).
Re: FORTE - Matlab TCP/IP communication [message #1764196 is a reply to message #1764182] Fri, 26 May 2017 15:06 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
No problem.
Glad I could contribute something potentially useful :)

The GitHub repository includes a readme with detailed explanations on the syntax. And I added a demo script (with explanatory comments) along with two exported systems (.sys files) for the following demos:

- Client on Matlab, SERVER_1 FB on FORTE
- Server on Matlab, CLIENT_1 FB on FORTE

I don't think I'll have time to write any more about it anytime soon, since I will be setting up a Matlab/4diac co-simulation for validating an application and generating CSVs for function block unit tests. But I will probably add a section about it in my thesis (which should be published online by the end of this year).
Re: FORTE - Matlab TCP/IP communication [message #1764434 is a reply to message #1764196] Mon, 29 May 2017 16:30 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 523
Registered: January 2014
Senior Member
I can perfectly understand that. Would you mind if I write a short news entry to advertise your work?
Re: FORTE - Matlab TCP/IP communication [message #1764444 is a reply to message #1764434] Mon, 29 May 2017 20:43 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
Of course not. I'd be happy to see a news entry about it. If the info in the readme and demo script is enough info for the 4diac help, I could also combine them into one document and add a few explanatory screenshots.
Re: FORTE - Matlab TCP/IP communication [message #1765333 is a reply to message #1764444] Thu, 08 June 2017 13:59 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 523
Registered: January 2014
Senior Member
Sorry for the late reply. I'm not sure if we should move your documentation into a 4diac documentation. The advantage if it stays with your github project is that that all is one place and people using it can comment there. So I've slight tendency to put in the 4diac help only a short one or two line introduction with a link to your github project. What do you think?
Re: FORTE - Matlab TCP/IP communication [message #1765346 is a reply to message #1765333] Thu, 08 June 2017 15:12 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
No problem. Yes, that sounds like a better idea.
Now that I am setting up a larger co-simulation, I realized that I had to make quite a few updates to the tool. So it would definitely be less work to have the documentation in only one place.
Re: FORTE - Matlab TCP/IP communication [message #1765486 is a reply to message #1765346] Sat, 10 June 2017 19:59 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 523
Registered: January 2014
Senior Member
Today I finally found time to do a first news post on your library [1]. I think this could also be the text for the 4diac help. What do you think?

[1] https://www.eclipse.org/4diac/en_news.php#en_news_20170610
Re: FORTE - Matlab TCP/IP communication [message #1765505 is a reply to message #1765486] Sun, 11 June 2017 13:43 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
Cool :)
Yes, I think it would do fine for the help. I just added support for arrays and a few additional demos, too.
Re: FORTE - Matlab TCP/IP communication [message #1766641 is a reply to message #1765505] Fri, 23 June 2017 18:16 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 523
Registered: January 2014
Senior Member
Today I finally managed to copy it to the help [1]. I the next days it will also be mirrored to the web page. I hope it draws more attention to your library.

[1] https://sourceforge.net/p/fordiac/fordiac-ide/ci/7b84edcd015c5f18fcd32c53331e20f4400394ff/tree/
Re: FORTE - Matlab TCP/IP communication [message #1766754 is a reply to message #1766641] Mon, 26 June 2017 19:04 Go to previous message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
Thanks for your support :)
Previous Topic:Set up Unit Test project in VS
Next Topic:There are some differences between my ide and document.
Goto Forum:
  


Current Time: Wed May 23 14:33:37 GMT 2018

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

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

Back to the top