Link to an external DLL
Quote from David3542 on 11/06/2022, 06:50Hi
in your document you talked about link to an external DLL
but I cant link to external Dll
Do you have any example for it ?
Thanks in advance
Hi
in your document you talked about link to an external DLL
but I cant link to external Dll
Do you have any example for it ?
Thanks in advance
Quote from David3542 on 13/06/2022, 09:03is it possible to call an external Dll
( we make our own dll with c++ ) and then join to it and call it from script block ?
if its possible please give us a simple example . we cant handle it with that document
is it possible to call an external Dll
( we make our own dll with c++ ) and then join to it and call it from script block ?
if its possible please give us a simple example . we cant handle it with that document
Quote from mm_dev on 13/06/2022, 09:31That interface isn't for linking to existing DLLs, but for specifically designed RTSA Plugins. See page 51 of the document for how to write a plugin DLL.
However I suggest you try to use another interface if possible (e.g. Process or TCP). Plugin DLLs become part of the RTSA process itself, and any error in the DLL may cause the complete RTSA to crash without any indication about the actual problem. Unless you need to exchange massive amounts of data or can absolutely not tolerate any communication overhead there is generally little need to use the Plugin interface. It is likely more work to implement a plugin DLL than a standalone program to wrap the DLL you want to use as well, and the latter will be much easier to test and can potentially also be used outside the RTSA.
That interface isn't for linking to existing DLLs, but for specifically designed RTSA Plugins. See page 51 of the document for how to write a plugin DLL.
However I suggest you try to use another interface if possible (e.g. Process or TCP). Plugin DLLs become part of the RTSA process itself, and any error in the DLL may cause the complete RTSA to crash without any indication about the actual problem. Unless you need to exchange massive amounts of data or can absolutely not tolerate any communication overhead there is generally little need to use the Plugin interface. It is likely more work to implement a plugin DLL than a standalone program to wrap the DLL you want to use as well, and the latter will be much easier to test and can potentially also be used outside the RTSA.
Quote from David3542 on 13/06/2022, 11:46Quote from mm_dev on 13/06/2022, 09:31That interface isn't for linking to existing DLLs, but for specifically designed RTSA Plugins. See page 51 of the document for how to write a plugin DLL.
However I suggest you try to use another interface if possible (e.g. Process or TCP). Plugin DLLs become part of the RTSA process itself, and any error in the DLL may cause the complete RTSA to crash without any indication about the actual problem. Unless you need to exchange massive amounts of data or can absolutely not tolerate any communication overhead there is generally little need to use the Plugin interface. It is likely more work to implement a plugin DLL than a standalone program to wrap the DLL you want to use as well, and the latter will be much easier to test and can potentially also be used outside the RTSA.
Thanks you for your answer
My mission is send some data from RTSA block to my own Dll , and do some special process in my Dll and then return it to RTSA again or write in in the file and ...
I'm expert to make a C++ dll , but I don't know is it possible to link an external dll from script or not
Actually I think send data with http server to my own application and then receive it from this way can be a solution for this mission
But I prefer connect script block to my own Dll ( is it possible )
Quote from mm_dev on 13/06/2022, 09:31That interface isn't for linking to existing DLLs, but for specifically designed RTSA Plugins. See page 51 of the document for how to write a plugin DLL.
However I suggest you try to use another interface if possible (e.g. Process or TCP). Plugin DLLs become part of the RTSA process itself, and any error in the DLL may cause the complete RTSA to crash without any indication about the actual problem. Unless you need to exchange massive amounts of data or can absolutely not tolerate any communication overhead there is generally little need to use the Plugin interface. It is likely more work to implement a plugin DLL than a standalone program to wrap the DLL you want to use as well, and the latter will be much easier to test and can potentially also be used outside the RTSA.
Thanks you for your answer
My mission is send some data from RTSA block to my own Dll , and do some special process in my Dll and then return it to RTSA again or write in in the file and ...
I'm expert to make a C++ dll , but I don't know is it possible to link an external dll from script or not
Actually I think send data with http server to my own application and then receive it from this way can be a solution for this mission
But I prefer connect script block to my own Dll ( is it possible )
Quote from mm_dev on 13/06/2022, 12:42As said, you can load a plugin DLL (written in C/C++) that exports the functions described in the relevant sections of the documentation, like RTSA_PluginRead and RTSA_PluginWrite. These can then be called inside the script block using Plugin.read and Plugin.write. However you need to take care of all the data handling yourself (the functions only accept generic void * buffers) and invoke the provided callbacks correctly (as the script interface is asynchronous, you have to let the interpreter know when you're done).
I've attached a minimal demo plugin including the necessary bits for the script block (built using qmake, when using another build tool you need to define RTSA_DEMO_PLUGIN_LIBRARY for the symbols to be properly exported).
As said, you can load a plugin DLL (written in C/C++) that exports the functions described in the relevant sections of the documentation, like RTSA_PluginRead and RTSA_PluginWrite. These can then be called inside the script block using Plugin.read and Plugin.write. However you need to take care of all the data handling yourself (the functions only accept generic void * buffers) and invoke the provided callbacks correctly (as the script interface is asynchronous, you have to let the interpreter know when you're done).
I've attached a minimal demo plugin including the necessary bits for the script block (built using qmake, when using another build tool you need to define RTSA_DEMO_PLUGIN_LIBRARY for the symbols to be properly exported).
Uploaded files: