Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Send data to another pc through TCP

Hi everyone

 

I have a VI running on a Touch Panel Computer that acquires and saves automatically a txt file every x minutes. Since the memory of the PC is not big, I want to send these files to another pc. I have seen some examples on the TCP/IP technique and I found an example that seems ok to my case but there are some problems.

 

1)  I can't connect my data to the Type Cast because it seems that the Type cast does not accept Polymorphic Data. How I can modify it?

2)  How can I modify my VI to be able to send the saved files to another pc automatically?

 

Thanksto everyone for the reply

Blokketto

0 Kudos
Message 1 of 5
(6,517 Views)

Hello Matomato,

 

Do you have access to the internet toolkit?

 

I have had a look at your code and you are correct in saying you cannot type cast the polymorphic data; you will have to extract the individual data elements in the Y axis of the graph data. You can take these elements and have then TCP streamed to a server, however if you wanted to transfer a file via TCP you would have to strip down the file and send the characters one at a time (this would take substantially longer than FTP). I would strongly recommend if you want to send files across a network that you use FTP (FILE transfer Protocol) rather than TCP. You could then setup a FTP server client to which you could write your data to. I would suggest you read the following articles and resources, and perhaps have a look at some examples before you proceed with any file writing.

 

What is FTP?

FTP Basics

 

If you have the internet toolkit.

 

Example:

 

Open LabVIEW >> Help >> Find Examples >> Search >> FTP >> FTP Browser.vi

 

Let me know if this helps

Regards

Andrew George @ NI UK
0 Kudos
Message 2 of 5
(6,510 Views)

HI Andy

 

No, unfortunately, I don't have the Internet Toolkit.I have seen a bit about the FTP and, as you said, it looks better than the TCP.

I know that to transfer these data, which are signals acquired continuously, can take time via TCP, but for now this is better than nothing.

Can you help me to solve this problem.

I will take in consideration the use of the FTP and the internet toolkit in a second moment.

Thanks

 

matomato

 

0 Kudos
Message 3 of 5
(6,506 Views)

Hello Mario,

 

I have included a simplified version of TCP communication for the purposes of demonstration for the online community. Please see the code of basic TCP communication attached.

Regards

Andrew George @ NI UK
0 Kudos
Message 4 of 5
(6,478 Views)

Hi Andy

 

Thanks for the reply and the Vis.

I will try these asap and I let you know.

Regards

 

matomato

0 Kudos
Message 5 of 5
(6,476 Views)