ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

configure Call Library Function Node for a structure with array as an input

I need to configure the Call Library Function Node for a function in dll with a structure argument. The structure has an array as one of its elements.
The prototype of the function is
 
long _stdcall CanRcvMsg(long handle, CAN_PACKET *packet);
 
where CAN_PACKET is
 
typedef struct _tagCAN_PACKET
{
    DWORD CAN_ID;       //  CAN id
    BYTE rtr;           //  RTR bit
    BYTE len;           //  Data length
    BYTE data[8];       //  Data
    DWORD time;         //  Occur time (non use)
    BYTE reserved;      //  future use
}CAN_PACKET
;
 
How can the CLF node be configured. Can the cluster with these elements be passed directly to the CLF node?
 

 
 
 
0 Kudos
Message 1 of 2
(2,955 Views)
Hi,
 
Configure the Call Library Node with the "Parameter Type" for the CNA_PACKET set to "Adapt to Type" and "data format" set to "Pointer to handle". Then specify the inputs to the Call Library Node with a cluster control/constant that defines all the data types for the CNA_PACKET. Attached is a sample project that builds and calls a dll with a cluster data type that has an Array of Numeric, Boolean and String.
 
Tunde
0 Kudos
Message 2 of 2
(2,940 Views)