LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing structure pointer to dll

The power of google. 😉
intvsteve
LabVIEW R&D
0 Kudos
Message 11 of 13
(1,532 Views)

Hi guys!

First of all I'm sorry for my awful english! I have a big problem: maybe it's the same you are talking about in previous rows. I'm trying to use a dll in labview. I've found two situation once that I've solved and another one that is stopping me. I'm able to configure this kind of situation:

 

ls50errortype CALLTYPE Ls50P2Open(ls50p2apiconfiginfostruct &configinfo)

 

typedef struct  {
  ls50p2cardconfigstruct CardConfigInfo[MAXMFCARDS]; 

  int Ls50P2CardCount;

  ls50p2carddatastruct DataInfo[MAXMFCARDS][2];

}ls50p2apiconfiginfostruct;

 

 

 

I configure  ls50p2apiconfiginfostruct type with an array of unsigned 8-bit in "call lybrary function" interface and everything works properly!!!  

But now look at the next example. My structure is different because now I have a pointer and I don't know how to do to configure this in call lybrary function labview window:

 

ls50errortype CALLTYPE Ls50P2LoadDecomSetupAndStart(pdecomsetupstruct &decomsetupdata)

 

 

typedef struct decomsetupstruct
{
   decompolaritycodetype eDataPolarity;          
  bool                  bFACEnable;               
  decomsubframemodetype eSyncMethod;            
  bool                  bForceSync;             
  short int             FrameSyncTolerance;     
  bool                  bGMode;                 

} *pdecomsetupstruct;

 

 I don't know how to fix this problem because I don't understand if with labview visual tool is possible to set this situation. That pointer is making me insane 🙂

If you have a bit of time please help me my work must go on.

Best regards!

 

Francesco

 

 

 

 

 

 

 

0 Kudos
Message 12 of 13
(1,513 Views)

sauel wrote:
.... My structure is different because now I have a pointer and I don't know how to do to configure this in call lybrary function labview window:

 

ls50errortype CALLTYPE Ls50P2LoadDecomSetupAndStart(pdecomsetupstruct &decomsetupdata)

 

typedef struct decomsetupstruct
{
   decompolaritycodetype eDataPolarity;          
  bool                  bFACEnable;               
  decomsubframemodetype eSyncMethod;            
  bool                  bForceSync;             
  short int             FrameSyncTolerance;     
  bool                  bGMode;                 

} *pdecomsetupstruct;

 

 I don't know how to fix this problem because I don't understand if with labview visual tool is possible to set this situation. That pointer is making me insane 🙂

If you have a bit of time please help me my work must go on.

Best regards!

 

Francesco

 


If that function prototype is correct, then it's expecting a C++ reference to a pointer. If such is the case, then it's possible that the function itself could return a different pointer to the caller - and the LV Call Library Node does not support this. After all, LabVIEW cannot know how it should deallocate a pointer returned in such a fashion.

 

In this case, Francesco, you must write a wrapper DLL that converts between the LV data and this other type.

intvsteve
LabVIEW R&D
0 Kudos
Message 13 of 13
(1,503 Views)