From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp data b/w labview and c++

Solved!
Go to solution

Hi

 

 i am trying to establish TCP connection b/w LABVIEW and C++ program. Server is established in C++ while client is implemented in labview.Although connection is successfully establish b/w server and client, both are unable to correctly understand data send/receive among them. Forexample if i want to send an int type send_array from server, i use standard WINSOCK function "send" like that:

 

send(AcceptSocket,(char*)send_array,129*4,0);

 

but when client in labview receive this array, it shows unexpected values.As a client, I used "simple data client.vi"  with one modification i.e. as sent data size(129*4 bytes) was fixed, only one TCP read was used . 

 

Same problem exists if i send data from client to server.

 

Kindly help me

 

Best Regards

0 Kudos
Message 1 of 5
(3,259 Views)
Solution
Accepted by topic author ASIM_BHATTI

It's probably an big/little edian problem. If you are using the Flatten/Unflatten from String functions, you can specify which to use.

0 Kudos
Message 2 of 5
(3,250 Views)

Hi,

 

I have the same problem.

Do you have the solution?

 

thanks

0 Kudos
Message 3 of 5
(3,003 Views)

@juanrads wrote:

Hi,

 

I have the same problem.

Do you have the solution?

 

thanks


Did you read the post from Dennis which is even marked as solution? As short as it is it does provide all information that is needed for the solution of the problem the OP had!

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(2,981 Views)

 

It has been long since this problem occured. I think "little indian/big indian" was the issue in my case which was finally solved 

 

Thanks & Regards

asim

0 Kudos
Message 5 of 5
(2,943 Views)