MATLAB Answers

0

S-Function & Hardware Interface

Asked by 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.

  0 Comments

Sign in to comment.

1 Answer

Answer by 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.

  0 Comments

Sign in to comment.