LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass char table to a DLL

Hello fellows,  (using LabVIEW 8.5 full dev with WinXP)
 
 I'm dealing with calling DLLs functions. So, I have the DLL code to build for passing from LabVIEW a table of char like this:
 
char table [ ] = {0x04, 0x0F, 0x04, 0x00,0x00,0xFA,0x00}
 
So I pass the data by creating a table of char in labview and select "Adapt to type" when passing this table in the calling DLL function node.
 
Then I wrote the data to a Pipe to be interpreted by the other program.
 
here is the c program:
extern "C" _declspec (dllexport) void test_Write_Event(HANDLE HandlePipe, char InputArray[255] ,char OutputArray[255],int size)
{
 BOOL fileRead;
 DWORD bytesWrite;
 int i;
 char *pEvent = "";
   
  /* Copy the input array */
  for(i = 0; i < size; i++)
  {  
   pEvent[i] = InputArray[i];
  }
  OutputArray = InputArray;
  //Write to pipe
  fileRead = WriteFile(HandlePipe,
                    pEvent,
        (size),
        &bytesWrite, NULL); 
 
}
 
I don't know if my data type adaptation is right ?? some help !
 
PS: the vi to test this DLL function attached
0 Kudos
Message 1 of 1
(2,575 Views)