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: 

Sending multiple data with TCP in labview

I have some data written down on a labview of a PC (like a person's name, surname, age......) and using the TCP connection I'd like to send it over to another labview. I've made identical interfaces in both, where I want to display all the details in the corresponding strings/numbers. How can I do that? I can send one data string, but more than one I don't know, and in a way that it's displayed in the same way...I've tried using concatenate string and sending that but it doesn't work either. 

0 Kudos
Message 1 of 9
(5,039 Views)

I recommend you take a look at the STM library.  This article might give you some good ideas: Command-based Communication Using Simple TCP/IP Messaging


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(5,034 Views)

Thanks!! But I was thinking more about using a TCP connection? I can send a single array, but if I try to send a cluster array, where I have all the data of the person (name and so on), it gives error. I try to concanate strings, but after on the receiver i can't unconcanate it in separate parts...

0 Kudos
Message 3 of 9
(5,011 Views)

What error do you get?  Can you show the code you currently have?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(5,005 Views)

Here I send them. I'm tried to do with an array otherwise but when the connection is done the receiver can't decode the message.... I've also tried putting one string with concanate string but then the receiver gets all the words togehter. I need "name" and "surname" to be separate, but if possible, to be sent at the same time. 

Download All
0 Kudos
Message 5 of 9
(4,998 Views)

Use Flatten To String on the sender side and Unflatten From String on the reciever.  By default, these as the string length to the data so that the unflatten side knows how many bytes to use for the string.  If you have a cluster, you can just wire the cluster straight into them as well.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(4,990 Views)

Thanks! I understand, I think. But I've tried to apply it and it still gives me an error. Maybe it has something to do with the amount of bytes transferred? It tells me"error 74 has ocurredt unflatten from string" (memory or data structure corrupted). 

Download All
0 Kudos
Message 7 of 9
(4,970 Views)

In your Client VI, you did not wire up the actual data to the second TCP Write.  Therefore your data is not being sent.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 9
(4,953 Views)

Thaanks! I hadn't wired it up because if I did it would give me error, but I've found out where was the mistaken and I've corrected it. 

0 Kudos
Message 9 of 9
(4,930 Views)