S-Function & Hardware Interface

6 views (last 30 days)
RED STONE
RED STONE on 16 May 2013
Hi everyone! I want to communicate with a RS-232 Port and a USB Port by a s-function way. I want to know how the S-function communicate with the operating system and where can I find the supported c function list in s-function.

Answers (1)

Kaustubha Govind
Kaustubha Govind on 16 May 2013
There is no limit on what C-functions you can use in your C-MEX S-functions, as long as the code is ANSI-C compatible. You just need to figure out the right build rules that you need (ie. header files, libraries, etc.), and supply them appropriately at the time of compiling the MEX-file. So essentially, you need to figure out how you would write standalone C-code for your application and compile it into a binary outside of MATLAB - if you are able to do so, you just need to write an S-function wrapper for that code. In fact you can even use the Legacy Code Tool to automatically generate an S-function for you, once you have your C code.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!