This block is used to interface with a file containing a set of functions written in C/C++ code. To use this block, configuration files must be updated.
The following steps must be taken to construct a block to import code into a VisualSim model:
If additional logic needs to be specified between the block port and the function, you can add this to the generated cpp wrapper file. Look at the Master-Slave Example in (VisualSim/VS/demo/Interfaces/VS_C_Library/Slave/MasterSlave1.xml) to checkout what can be added.
If you need to access multiple files, this is also specified in the Wrapper file. You can add more that also includes trigger specific functions based on the input values.
The output can return a struct or Data Structure to VisualSim. All input ports must be tokens.
The following requirements must be maintained.
File names must not contain _.
The block "Customize Name" must match the Library Directory parameter. If the block name does not change by itself, then the user must change the block name. Else a java.lang.nullexception is received.
If multiple c or cpp files are located in the same directory, then the $VS/bin/vsmake.{sh,bat} must be updated. All the delete lines must be commented out: *.cpp, *.java, *.h, Jni*.cpp and Jni*.h.
Parameter
|
Explanation
|
libraryDirectory |
The directory that holds the generated and intermediate files. Make sure you have an unique file for each model. |
nativeFunction |
The name of the native library and the cpp file name. The cpp or c extension is not required.
|
Created with the Personal Edition of HelpNDoc: Free CHM Help documentation generator