IOXLoad

Top  Previous  Next

 

extern "C" __declspec(dllexport) int IOXLoad(

LOADPARMSIN *pParmsIn,

LOADPARMSOUT *pParmsOut

);

 

IOXLoad is called when a plugin is loaded.  It is used to supply information such as the event callback pointer and assigned plugin ID.  The plugin returns information to the main application such as whether the plugin is an input or an output and which configuration dialogs it makes available.

 

This is the routine that should read persistent configuration settings.  Hardware resources should not be claimed until a subsequent IOXControl open call.

 

 

The LOADPARMSIN structure fields

 

pluginInterfaceVersion: Set to the version number of the plugin interface expected by the main application.  The high 16 bits is the major version which will be incremented only when changes are severe enough to prevent  proper communication.  If the main app's major version does not match the plugin's major version, the info call should fail by returning a non-zero value

 

pluginPath: This is the full path and name of the plugin.  The passed pluginPath should be used as a base for building configuration file and other support file names rather than hard coding the name at compile time.  This allows a user to run multiple, independent copies of the plugin by simply copying the plugin library to a different file name.

 

pluginID:  The pluginID is calculated by IOX by running a checksum algorithm on the name.  This allows IOX to refer to plugins using a 32 bit identifier and ensures that the identifier will change if the plugin is copied to a different file name.  The pluginID is passed to the main application when generating a notification event.

 

pfnIOXEventCallBack:  This is a pointer to a flat C callback routine used when an input plugin wants to generate an event.

 

pLuaState: A pointer the Lua interpreter state which can be used by a plugin that needs to execute a Lua script or modify the Lua global environment.

 

 

The LOADPARMSOUT structure fields

 

pluginInterfaceVersion: Set to the version number of the plugin interface expected by the plugin.  The high 16 bits is the major version which will be incremented only when changes are severe enough to prevent  proper communication.  If the main app's major version does not match the plugin's returned major version, the main application will not load the plugin.

 

pluginInput: Set to a non-zero value to indicate this is an input plugin, that is, the plugin may generate events.

 

pluginOutput: Set to a non-zero value to indicate this is an output plugin, that is, this plugin may perform output actions.  Note, it is perfectly legal for a plugin to be both an input plugin and an output plugin.

 

pluginInterfaceVersion: Set to the version number of the plugin interface being used by the plugin.  The main application will inspect this return value to ensure that the major version matches its own major version.

 

showConfigure: Set to a non-zero value if the plugin can display a configuration dialog.

 

showProperties: Set to a non-zero value if the plugin can display a properties dialog.

 

showInSettings: Set to a non-zero value if the plugin can display an input settings dialog.

 

showOutSettings: Set to a non-zero value if the plugin can display an output settings dialog.