Block for calling a computational function written in scilab
[sim, out] = ld_scilab4(sim, events, in, invecsize, outvecsize, comp_fn, ForwardVars, par)
A nicer interface to scilab. (See modules/scilab/demo/scilab_demo.sce for an example)
in *+(invecsize) - input
out *+(outvecsize) - output
out = calc_cmd
comp_fn - scilab function that is executed online. Prototype:
function [block]=sample_comp_fn( block, flag )
flags are: 1 calc outputs, 4 initialise, 5 terminate
For further details have a look at the example.
ForwardVars - %t or %f Forward variables to the online Scilab instance
The structure par must contain at least the following elements:
include_scilab_fns - list( fn1, "fn1", fn2, "fn2" ) , whereby fn1 and fn2 stand for Scilab functions
scilab_path - Path to scilab5 executable. Use "BUILDIN_PATH" if you do not have special needs.
InitStr - execute str in the begining. e.g. to define global variables
Nice feature: ld_scilab4 will look for variables that are not defined within comp_fn, if ForwardVars = %t
and will try to transfer these variables from the Scilab instance running at
the development host to the on-line running Scilab instance.
This works only for single value variables only, though.
NOTE: For now the flag "update states" is not called; Also a "reset states" flag is required.