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 Error 74 occurred at unflatten from string

Solved!
Go to solution

Hi,

I created a simple tcp sender and receiver to test that I can send and receive tcp data before adding it in my actual code.

I'm using ports on my computer to send and receive data but I'm running into Error 74 on the listener side. How can I resolve this?

I have attached the code.

Thanks

0 Kudos
Message 1 of 7
(2,636 Views)

You are trying to unflatten the data in a way that is completely different than the flattening.

 

Why?

 

Also, you didn't wire in any bytes to read in the TCP Read. So it defaults to 0.  You can unflatten nothing.

 

Look at LabVIEW examples for TCP sender and receiver.  You need to determine how many are being send and wire that into the TCP Read.

0 Kudos
Message 2 of 7
(2,605 Views)

Thanks RavensFan for pointing out those mistakes. I will make the changes.

0 Kudos
Message 3 of 7
(2,558 Views)

@RavensFan wrote:

Look at LabVIEW examples for TCP sender and receiver.  You need to determine how many are being send and wire that into the TCP Read.


Personally, I am a big fan of the STM library, which abstracts this away for you.


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 7
(2,555 Views)

Hi RavensFan,

I've made changes to my sample code however the data received on the listener side isn't being parsed correctly. Each element in the data cluster is updated with all values sent instead of one specific data element. You can run the code and see it. I'd like to work with the native labview tcp functions for now but will check the STM library later. Can you take another look at the code to see what I'm doing wrong? I've attached the modified code.

Thanks

0 Kudos
Message 5 of 7
(2,548 Views)
Solution
Accepted by SolPS

Your receiver first needs to read the 4 bytes to get the message size, convert that into an I32, read that number of bytes, and then convert the read data into the cluster.  Again, the STM library takes care of this for you.


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 7
(2,543 Views)

Thank you crossrulz. My sample code is now working correctly. I will check out the STM library.  Thanks again for your help!

0 Kudos
Message 7 of 7
(2,538 Views)