In order to have S-Functions work in Simulink and the Real time workshop generated code, refer to the section "Writing S-Functions: Writing S-Functions for Real-Time Workshop" in Simulink documentation. In general placing the C source file of the S-Function in the same directory as the model will allow it to be included in the DLL.
Another option is to compile the C source (of S function) into a DLL and call it using the Call Library Node in LabVIEW. though it may require you to reengineer the model a bit. Thanks SumitG NI R&D