Regular API function

simLoadModule / sim.loadModule

Description Loads a CoppeliaSim plugin. This should usually be done in the main client application, just after simRunSimulator was called. Alternatively, you can also dynamically load/unload a plugin, but depending on the plugin function, this might not work/lead to a crash. In case the dynamically loaded plugin registers custom Lua functions, those functions cannot be used in scripts that were already initialized (except for the script that called sim.loadModule). Normally, all plugins of type simExtXXX.dll (or or libsimExtXXX.dylib) in the CoppeliaSim directory are loaded at application start. Plugins that are meant to be dynamically loaded should use a different name, or a different directory. See also simSendModuleMessage and sim.unloadModule.
C synopsis simInt simLoadModule(const simChar* filenameAndPath,const simChar* pluginName)
C parameters
filenameAndPath: file name and path of the plugin
pluginName: name of the plugin. If the file name is simExtXXX.dll, then the name should be XXX
C return value
handle of the plugin if value is 0 or positive. otherwise:
-3: plugin could not be loaded
-2: plugin is missing entry points
-1: plugin could not initialize
Lua synopsis number pluginHandle=sim.loadModule(string filenameAndPath,string pluginName)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page