Hello,
in fact, Embedded Wizard allows to extend the prototyping environment by user specific functionality. This can also be an interface to modbus. We call this concept 'intrinsic modules'. Unfortunately there is actually no documentation in our knowledge base describing how to create the intrinsic modules. This item is waiting on our to-do list. There are, however, two examples installed together with Embedded Wizard demonstrating the creation and usage of intrinsic modules. These examples are Applet and Extern Bitmap. You can find them in the directory Embedded Wizard 9.20\Examples just below your Documents folder.
From technical point of view, intrinsic modules are regular Win32 DLLs you can create with Microsoft Visual Studio. Accordingly each of the above mentioned examples contains a sub-folder where you find a MSVC project together with C/H files to create the intrinsic module used by the example. I recommend you to review these folders. Generally, when you wish to create your intrinsic module, please note following:
- Name the resulting *.dll file to *.ewi file. (The file extension has to be ewi).
- Ensure the EWI file is stored either in the directory of your Embedded Wizard project or one of the directories containing the unit files.
- Within your DLL project you will need to include the header file intrinsics.h found in the folder Chora\Sdk just below the installation directory of your Embedded Wizard.
- Within one of the C files used to build the DLL you have to define a description of the intrinsic module. This looks for example so:
/* Description of this Embedded Wizard Module */
EW_MODULE
(
INTRINSICS_IFC_VERSION,
L"IntrinsicsModule",
L"This is the intrinsics module to load the Game into Embedded Wizard"
)
- Within one of the C files used to build the DLL you have to define a table with all the C functions you want to publish to Embeded Wizard. This table stores besides the function names also the exact parameter types, etc. Such table looks like the following:
/* This is the intrinsics-table. This table contains registration-entries for
intrinsics implemented in this Embedded Wizard module */
EW_DEFINE_INTRINSICS
EW_INTRINSIC
(
L"GameInit",
L"handle",
1,
L"point",
L"aSize",
GameInit
)
EW_INTRINSIC
(
L"GameDone",
L"void",
1,
L"handle",
L"aGame",
GameDone
)
EW_INTRINSIC
(
L"GameMove",
L"void",
2,
L"handle,point",
L"aGame,aOffset",
GameMove
)
EW_INTRINSIC
(
L"GameAnimate",
L"void",
2,
L"handle,uint32",
L"aGame,aTime",
GameAnimate
)
EW_INTRINSIC
(
L"GameUpdate",
L"bool",
1,
L"handle",
L"aGame",
GameUpdate
)
EW_INTRINSIC
(
L"GameGetBitmap",
L"handle",
1,
L"handle",
L"aGame",
GameGetBitmap
)
EW_END_OF_INTRINSICS
For details regarding the above tables please see the header file intrinsics.h found in the folder Chora\Sdk just below the installation directory of your Embedded Wizard.
- Embedded Wizard loads the EWI files automatically when you start the prototyping (or even you open a GUI component in the Composer window). Thereupon the functionality provided in the intrinsic module can be called directly from Chora by using the published function names and parameters as described in the table above.
I hope it helps you.
Best regards
Paul Banach