LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I adapt data to fit the DLL function parameters whose are structure?

Hello, I call a DLL function with Labview 7.1.1 that have three parameters:

  1.  int  = nTargetType
  2. Pointer of the ComConfig structure: typedef struct  {
                                                                 int                     nComType;
                                                                 BFLOADER_UART_CONFIG_T  tUartConfig;

                                                                      } BFLOADER_COM_CONFIG_T;    

Where the tUartConfig is like that :

typedef struct
{
 int nComPort;
 int nBaudRate;
 int nDataBit;
 int nParity;
 int nStopBit;
 int nCtrlFlow;

} BFLOADER_UART_CONFIG_T;

3.  unsigned long *ComDevice

Did I have to write a CIN for the parameters type adaptation and after call my DLL function or I need to re-write the entire DLL in order to have parameters compatible in LabView  (my OS is Windows2000) thanks

 

0 Kudos
Message 1 of 4
(2,662 Views)

I have never tried to wire a type struct to a node. I don't think you can, but am very interested to find out maybe you could try a cluster with contents of the same type.

This statement is out of my depth (I am but a humble electrical engineer), but isn't there a way to overload the function and give it different parameters with which to call the function? If so it won't change the way you call the function from line code and you could add an overloaded function to work with your G code.

PS: When I went to respond to your post I accidentally selected a rating of one which apparently has an effect on your icon relating to your status on the list. I'm sorry, I hadn't had any coffee, yet and I thought it was the reply button. I think it's a great question, at least a 5 and maybe even a six.

-Rick

0 Kudos
Message 2 of 4
(2,652 Views)
I think if you pass a cluster of Int followed by a cluster with 6 Int, you should get what you require.

See below Picture



Shane.

Message Edited by shoneill on 07-28-2006 03:08 PM

Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 3 of 4
(2,647 Views)

Thank you very much Shoneill, I put your solution and the DLL don't crash anymore.

I just have to investigate the returned values that don't really what I expect...see you soon for other issues on that item ! !

PS: Attached file is the picture of the Calling DLL Function with clusters

Tahnks a lot...

Message 4 of 4
(2,641 Views)