<< mdaqBlockAdd C/C++ code integration mdaqBlockDelete >>

MicroDAQ toolbox >> MicroDAQ toolbox > C/C++ code integration > mdaqBlockBuild

mdaqBlockBuild

Build/Rebuild MicroDAQ custom block C/C++ source code

Description

This function rebuilds/builds all modified user blocks C source files. Function allows to compile library with debug symbols and with -o2 optimization. In order to recompile whole library all object files needs to be deleted from userlib directory (mdaqToolboxPath() + "src\c\userlib")

Function compiles every C source file from userlib directory. In order to compile external user C source code e.g. used in custom block, C source needs to be placed in userlib directory or Makefile (from userlib directory) needs to be modified to compile external code.

If block.use_sim_script is set to false then C source will be compiled to shared library which will be used in simulation mode. It guarantees the same code on host (simulation mode) and target (code generation) side. In order to use this option the external C compiler is required. List of supported compilers can be found at: https://help.scilab.org/doc/5.5.2/en_US/supported_compilers.html

Calling Sequence

mdaqBlockBuild(debug);

Arguments

Examples

// call mdaqBlock to initialize block structure describing new MicroDAQ block		
block = mdaqBlock();
block.name = "test"; // set block name 
block.param_name = [ "param1" "param2" "param3" ]; // set block parameters
block.param_size = [ 1 2 4 ]; // set block parameters sizes
block.param_def_val(1) = 1;  // assign default values to defined block parameters according to block.param_size
block.param_def_val(2) = [ 2; 3 ]; 
block.param_def_val(3) = [ 4; 5; 6; 7 ]; 
block.use_sim_script = %F;

// define block inputs (four inputs: input 1 - vec size 1, input 2 - vec size 2, input 3 - vec size 4, input 4 - vec size 1)
block.in = [ 1 2 4 1];

// define block outputs (two outputs both with vector size 1)
block.out = [ 1 1];

// create block - generate block code and corresponding C source file
mdaqBlockAdd(block);

// modify generated C source file

// recompile modified files
mdaqBlockBuild();

See Also


Report an issue
<< mdaqBlockAdd C/C++ code integration mdaqBlockDelete >>