FORTE - Matlab TCP/IP communication [message #1764178] |
Fri, 26 May 2017 12:41 |
Marc Jakobi Messages: 67 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.
[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 |
|
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 #1765333 is a reply to message #1764444] |
Thu, 08 June 2017 13:59 |
|
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?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04641 seconds