LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Error 74 occurred at unflatten from string

Solved!
Go to solution
Highlighted

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
(285 Views)
Highlighted

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
(254 Views)
Highlighted

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

0 Kudos
Message 3 of 7
(207 Views)
Highlighted

@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
0 Kudos
Message 4 of 7
(204 Views)
Highlighted

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
(197 Views)
Highlighted
Solution
Accepted by topic author 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
0 Kudos
Message 6 of 7
(192 Views)
Highlighted

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
(187 Views)