<p>Bonjour,</p>
<p>Ok pour opérations sur des tableaux d'entiers.</p>
<p>J'ai reconfiguré le prototype de la fonction AddTabint2 de la façon suivante (2 fonctions dans la bibliothèque) :</p>
<p> </p>
<p>#include "extcode.h"</p>
<p>#pragma pack(push)</p>
<p>#pragma pack(1)</p>
<p> </p>
<p>#ifdef __cplusplus</p>
<p>extern "C" {</p>
<p>#endif</p>
<p>typedef struct {</p>
<p><span class="Apple-tab-span" style="white-space: pre;"> </span>int32_t dimSize;</p>
<p><span class="Apple-tab-span" style="white-space: pre;"> </span>int32_t CommandeNumRique[1];</p>
<p><span class="Apple-tab-span" style="white-space: pre;"> </span>} Int32ArrayBase;</p>
<p>typedef Int32ArrayBase **Int32Array;</p>
<p> </p>
<p>/*!</p>
<p> * AddTabInt</p>
<p> */</p>
<p>void __cdecl AddTabInt(Int32Array *tabA, Int32Array *tabB, </p>
<p><span class="Apple-tab-span" style="white-space: pre;"> </span>Int32Array *tabRes);</p>
<p>/*!</p>
<p> * AddTabInt2</p>
<p> */</p>
<p>void __cdecl AddTabInt2(int32_t tabA[], int32_t tabB[], int32_t tabRes[], </p>
<p><span class="Apple-tab-span" style="white-space: pre;"> </span>int32_t *NBelts);</p>
<p> </p>
<p>long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);</p>
<p> </p>
<p>/*</p>
<p>* Memory Allocation/Resize/Deallocation APIs for type 'Int32Array'</p>
<p>*/</p>
<p>Int32Array __cdecl AllocateInt32Array (int32 elmtCount);</p>
<p>MgErr __cdecl ResizeInt32Array (Int32Array *hdlPtr, int32 elmtCount);</p>
<p>MgErr __cdecl DeAllocateInt32Array (Int32Array *hdlPtr);</p>
<p> </p>
<p>#ifdef __cplusplus</p>
<p>} // extern "C"</p>
<p>#endif</p>
<p> </p>
<p>#pragma pack(pop)</p>
<p> </p>
<p>Le code scilab pour l'utiliser :</p>
<p>a=[12,25,24]</p>
<p>b=[2,41,9]</p>
<p>nbelts=3</p>
<p>NomsFonctions=['AddTabInt','AddTabInt2']</p>
<p>link('F:\Prog LabVIEW\Dll labview\dll2\SharedLibTabIntAdd.dll',NomsFonctions,'c')</p>
<p>res = call("AddTabInt2",a,1,"i",b,2,"i",nbelts,4,"i","out",[1,3],3,"i")</p>
<p>disp(res)</p>
<p> </p>
<p>résultat :</p>
<p>-->exec('C:\Documents\Scilab\TestDllAddTabInt2.sce', -1)</p>
<p> </p>
<p> 14. 66. 33. </p>
<p> </p>
<p>Au niveau de LabVIEW il faut définir des pointeurs sur les données.</p>
<p>(si quelqu'un est intéressé je peux faire un petit document sur cette configuration)</p>
<p> </p>
<p>reste à tester les tableaux de double.</p>
<p>Cordialement</p>
<p>TR</p>
<p> </p>