LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why my tcp client can't recive data

i use a tcp protocol creat a tcp program.but i find my tcp client can't recive any data .help me!
Download All
0 Kudos
Message 1 of 7
(3,392 Views)
Here's an example where the use of icons on the block diagram make debug harder. You have different data types in the client and server. In the server, you are sending an array of I8 (text ring?) but in the client, you are csating to an array of enums. If you want the data types to match, right click on the control in the server and select 'Create Constant'. Cut this from the server diagram and paste it onto the client daigram. Wire this into the type cast (type input). Delete the indicator you have on the client. Right click on the constant and select 'Create Indicator'. Wire this to the output of the type cast. Now, all of your data types match.
0 Kudos
Message 2 of 7
(3,386 Views)

yes.when i change the type of the client.i find i can recive data .but when i put it as a subvi ,i find my tcpserver can't send data out .why?

i put the tcpserver in while loop

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

I don't understand. Your server is already in a while loop and if you put the whole VI you've posted in another while loop, you just keep calling the TCP Listen and you certainly don't need to do this. This should only be done once at the beginning of your main. You would also need to eliminate the while loop in your posted VI if you want to call it as a subVI.

Message 4 of 7
(3,373 Views)
thank you,at this morning ,i delect the while loop and build a new vi for test,i find it can sent out data.and the tcpclient can receive data.
is all the vi as subvi want to delect some while loop?
0 Kudos
Message 5 of 7
(3,364 Views)


Dennis Knutson 写:

 you just keep calling the TCP Listen and you certainly don't need to do this. This should only be done once at the beginning of your main.


i can put the port out of the while loop,so it would be done once at the beginning of my main.but the data in it must de written all the time .i don't know how to change it better.

0 Kudos
Message 6 of 7
(3,357 Views)
If your main has a while loop (and it probably should), you can have the tcp write there. You can still make a subVI out of the code you originally posted, it just should not have it's own while loop.
0 Kudos
Message 7 of 7
(3,351 Views)