gl.dll is created for Matlab users.
To add GridLAB-D CMEX module to Matlab's library, use the Matlab setpath command.
For a list of supported function, give the command
>> gl('help')
Functions | |
| void | cmex_create (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Create an object. | |
| void | cmex_get (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Get a value (object, clock, or global). | |
| void | cmex_getenv (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Get an environment variable. | |
| void | cmex_global (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Define a new global variable. | |
| void | cmex_list (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Get a list of entities. | |
| void | cmex_load (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Import an GLM or XML model. | |
| void | cmex_module (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Force a module to be loaded immediately (modules are loaded automatically). | |
| void | cmex_object_list (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| void | cmex_set (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Set a value. | |
| void | cmex_setenv (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Set an environment variable. | |
| void | cmex_start (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Start the GridLAB-D simulation executive. | |
| void | cmex_version (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
| Get the version of GridLAB-D CMEX running. | |
| void cmex_create | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Create an object.
gl('create', class, property, value, ...) | plhs | {properties} |
| prhs | (class, property1, value1, property2, value2, ..., propertyN, valueN) |
Definition at line 446 of file cmex.c.
References class_get_class_from_classname(), object_set_value_by_name(), and output_error().
| void cmex_get | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Get a value (object, clock, or global).
gl('get',name)
| plhs | {data} |
| prhs | (name) |
Definition at line 688 of file cmex.c.
References class_find_property(), class_get_class_from_classname(), class_get_property_typename(), convert_from_timestamp(), convert_to_object(), global_find(), output_error(), PT_double, PT_int32, and timestamp_current_timezone().
| void cmex_getenv | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Get an environment variable.
gl('getenv',name) | plhs | () |
| prhs | (name, value) |
Definition at line 420 of file cmex.c.
References output_error(), and output_message().
| void cmex_global | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Define a new global variable.
gl('global',name,value) | plhs | () |
| prhs | (name,value) |
Definition at line 322 of file cmex.c.
References global_create(), output_error(), PT_char1024, PT_complex, and PT_double.
| void cmex_list | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Get a list of entities.
entlist = gl('list',type[, criteria]) | plhs | entlist |
| prhs | () |
Definition at line 272 of file cmex.c.
References cmex_object_list(), and output_error().
| void cmex_load | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Import an GLM or XML model.
gl('load',filename) | plhs | () |
| prhs | (filename) |
Definition at line 508 of file cmex.c.
References loadall(), output_error(), and output_message().
| void cmex_module | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Force a module to be loaded immediately (modules are loaded automatically).
gl('module',modulename) | plhs | () |
| prhs | (modulename) |
Definition at line 545 of file cmex.c.
References int64, module_load(), output_error(), output_message(), and output_verbose().
| void cmex_object_list | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
| plhs | entlist |
| prhs | () |
Definition at line 225 of file cmex.c.
References convert_from_set(), find_first(), find_next(), find_objects(), object_name(), and output_error().
Referenced by cmex_list().
| void cmex_set | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Set a value.
gl('set',id,property,value) | plhs | () |
| prhs | (object_id,property_name,value) |
Definition at line 617 of file cmex.c.
References convert_to_object(), global_setvar(), object_get_property(), object_set_value_by_name(), output_error(), and PT_double.
| void cmex_setenv | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Set an environment variable.
gl('setenv',name,value) | plhs | () |
| prhs | (name, value) |
Definition at line 386 of file cmex.c.
References output_error().
| void cmex_start | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Start the GridLAB-D simulation executive.
gl('start') | plhs | () |
| prhs | () |
Definition at line 533 of file cmex.c.
References exec_start(), and output_error().
| void cmex_version | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Get the version of GridLAB-D CMEX running.
[major minor] = gl('version') | plhs | [major minor] |
| prhs | () |
Definition at line 301 of file cmex.c.
References legal_notice().