S-Function & Hardware Interface

3 次查看(过去 30 天)
RED STONE
RED STONE 2013-5-16
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.

回答(1 个)

Kaustubha Govind
Kaustubha Govind 2013-5-16
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.

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by