LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extern Code imtegration and struct definitions in .dll

Hi,
first i'd like to say, that LabVIEW is a very great Tool. It is not as difficult as other Tools but never easy too.

My problem:
I would like to call a function, which is in a .dll. I already have used the call library function, but this time it is more difficult. The functions definition (in the .dll) is as follows:
DWORD __stdcall CAN_Write( TPCANMsg* pMsgBuff);

TPCANMsg has the following struct:
typedef struct {
DWORD ID; // 11/29 Bit-ID
BYTE MSGTYPE; // Bits of MSGTYPE_*
BYTE LEN; // Number of Databytes (0.8)
BYTE DATA[8]; // Databytes 0..7
} TPCANMsg;

I want to receive all the information, which is defined in the struct. In case of this, it should be pr
inted into a table, to make the data visible.

Question:
How can I solve my Problem?
What argument and return types I have to choose in the configuration tab of call library function?
And how can I "save" the received information in such a form (like an array?), to put it into a table??

Thanks a lot, to my supporter 😉

And sorry because of my very bad english, but some years have gone since i have learned english.

Greetings
BKern

Germany
0 Kudos
Message 1 of 2
(2,951 Views)
This can be a tricky thing to do in LabVIEW. There is actually a Knowledge Base on National Instruments' website which discusses how to call DLLs with pointers to complex data structures. Also, there is an example here which demonstrates how to do this in LabVIEW. Let us know if you have any more troubles with this.
J.R. Allen
0 Kudos
Message 2 of 2
(2,951 Views)