LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp

Solved!
Go to solution

Hi,

I want to send cluster though

I want to send cluster though tcp which consists of strings , dbl, timestamp. I am getting an error while reading from TCP.

while writing I have used the string length and concatenated the cluster value changed to string using flatten to string.

While reading I am getting an error that Labview data is corrupt. While reading first I tried to get the length and then tried to convert the string using unflaten from string.

 

Can anyone help me regarding the same. 

0 Kudos
Message 1 of 12
(3,480 Views)

There are examples in LabVIEW and across the forums for how to do this.

 

We won't be able to help you in your particular case because you only gave us a quick description and are leaving it up to our imaginations to figure out how you might have actually programmed it.

 

Try attaching your VI if you want to get help.

0 Kudos
Message 2 of 12
(3,463 Views)

Hi riyak,

 

This error occur moslty if you have wrong datatype during unflaten from string.

 

Please make sure you use same datatype at both flatten to string and unflatten from string end.

 

Please post you code for better solution...

 

0 Kudos
Message 3 of 12
(3,456 Views)

Hi,

I have attached the vis. Please tell me the way how to solve it

Download All
0 Kudos
Message 4 of 12
(3,445 Views)

In your RX VI, you are type casting the TCP reference to an I32 when you should be type casting the string from the fist read.

 

Edit: Just noticed that you are also type casting to an U16 when it should be an I32.


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 5 of 12
(3,436 Views)

But Still error  74 is coming

0 Kudos
Message 6 of 12
(3,428 Views)

Changed the reference and Type cast to I32 .. but still giving as error ..

0 Kudos
Message 7 of 12
(3,424 Views)
Solution
Accepted by topic author Reshu

And the other stupid thing that was missed: you have to tell the first TCP Read to read 4 bytes (the length of an I32).


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
Message 8 of 12
(3,413 Views)
Spoiler
 

 

0 Kudos
Message 9 of 12
(3,409 Views)

Still giving an error.. what more could be the reason. 

0 Kudos
Message 10 of 12
(3,401 Views)