I have a Labview server application where the data, 1d fixed sized array, is sent to a specific port in my machine through Labview TCP/IP blocks. Now I am trying to pass this 1d array into my c++ code. To this end, I created a client vi and then I converted it into three Labview dlls; initialize, read and close. "Init" initializes the port, "read" supposedly reads the port and write the content of the port to an array called Myarray, and finally "close" closes the connection. I am calling read.dll in a while loop in c++. The read dll is supposed to read the port and return the 1d array at the port. I attached the pictures of server vi, init.vi , read vi and close.vi. When converting read.vi into Labview dll, I defined the output function parameter to be an Array Data Pointer. Labview-created header file for the read vi is attached here.
In order to read the output of the read.dll file in c++, I am using the following code;
int main(int argc, char* argv[])
{
uInt32 a;
double MyArray[8]; //Initialization of array
a=Init(); //Calling the init.dll to initialize the port
int i=0;
while (i<100)
{
Read(a,MyArray,8); //Calling READ.DLL to read the 1d array at the port and write it to Myarray.
std::cout << "The result is" << MyArray[2] << '\n'; \\PRINTING ONE MEMBER ON THE SCREEN to see if I managed to read the 1d array.
i=i+1;
}
Close(a); // Calling close.dll to close the port
return(1);
}
However, I can't see anything on the screen. I did this successfully for a double number. In that application, my server sends a double number, and I read this number with Labview read.dll on the vc++ side just fine. Now, I am trying to do the same with an array with the methodology defined above. I am wondering if there is anyone out there who can help me out with the problem. Thank you so much!!
Kind Regards