LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP IP bytes and subset of bytes for server and clients connection

Solved!
Go to solution

Hello

 

I have a problem about server and client connection using TCP/IP. So in the client i have 41 cases, 1 case for timeout others are for button cases that when they are pressed then the LED in the server will be turn on and if they are clicked again the LED will be turn off. But when I reach cases 10, 11, 12 until 41 (button cases) the LED will be turned on if clicked one time but when it double clicked then the LED won't turn off. So how do you resolve the problem? Is it about subset or bytes to read because the first subset is 1 but cases no 10 until 41 won't work but i change the subset into 2 then the cases works for turn on the LED but it won't work for turn off the LED.

 

I also upload the vi into this for the reference.

 

the username for client is user and the password is pass.

 

Thanks

Download All
0 Kudos
Message 1 of 7
(3,548 Views)

Your server is not parsing the messages correctly. The client is packaging them up correctly by sending the data length and then the data itself. However the server is not looking at the data length parameter and is parsing the message using assuming the message data length is constant. Fix your server to actually parse the message and you should be in business.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 7
(3,543 Views)

i'm still new in LabView so i don't know how to change the length of data into not constant at the server. Can you show it by fixing the problems in the vi? hehehe

 

Thanks

0 Kudos
Message 3 of 7
(3,540 Views)

Good Morning,

 

From the comment above it looks like you need to parse your message.  Here is a link to an KnowledgeBase article that shows you how to do just that.  Hope this helps!

 

Parse String Input

http://decibel.ni.com/content/docs/DOC-2110

 

I hope you have a great rest of the day!

 

-Cody C

0 Kudos
Message 4 of 7
(3,509 Views)

Hi ican,

it would be better if you change the ID to a fixed length. You can use typecast to get always 4Byte (if the value is U32 or I32) for the ID. Concatenate it with your one byte for the status.

 

See the attached image.

 

Hope it helps

Mike

Message 5 of 7
(3,505 Views)

Hy MikeS81

 

I have tried what you are suggesting but it won't work and the client have problem while sending the data. Can you uploaded the vi based on what you did because it won't work?

 

I also upload the vi based on what you did.

 

Thanks

Download All
0 Kudos
Message 6 of 7
(3,498 Views)
Solution
Accepted by topic author ican

Hi ican,

you did not change the client. See the attached picture. The mistake in the server part is, that the 4 was connected on both split functions to the length. See the Server picture for the needed difference.

 

Mike

Download All
Message 7 of 7
(3,486 Views)