LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Listening for a file transfer

relax! That easy for you to say :- )

I have a lot of processes running; I want to avoid more. The remote computer periodically sends the host a file. Can't I use the TCP Listen vi's to wait for a transer from a specific address? Data socket, UDP?
0 Kudos
Message 11 of 15
(974 Views)
You've previously mentioned that the client uploads the file via ftp, which means you must be running an ftp server on the Mac that's running the LabVIEW application. While there is a TCP Listen VI I do not believe that it will allow you to act on a connection if some other process is also listening and accepting connections on that port, such as your ftp server. Even if it did, you wouldn't know when the file transfer is completed. Keep in mind that, as mentioned previously in your related thread, these functions are meant to operate at a network layer that doesn't handle "sniffing". For that you need to use something like Ethereal, or its Pcap library.

You previously mentioned in the other thread (see how having all the information in one place helps) you could set up the Linux side to ping the Mac. Instead of pinging you could simply perform a "regular" TCP connection. This will allow you to use the TCP Listen VI so the Mac knows there's a file available.
Message 12 of 15
(954 Views)
I think I understand but let me restate.
First, I have two machines on a local net; One is a MAC running LabVIEW; The other which creates the files I'm interested in is running Linux (may not important) and not running LabVIEW.
I can send the file from the Linux machine to the MAC using ftp but you are telling that without Ethereal or something similar, I will not be able to use MAC LabVIEW to listen in on the file transfer.
On the hand, you are telling me that I could send a TCP/IP signal to the MAC telling me that file is ready for transfer and I could pull it over from the MAC side.
Right? This sounds good. Do you know where I get the Linux TCP/IP commands?

Thanks
0 Kudos
Message 13 of 15
(950 Views)

@exo wrote:
I think I understand but let me restate.
First, I have two machines on a local net; One is a MAC running LabVIEW; The other which creates the files I'm interested in is running Linux (may not important) and not running LabVIEW.
I can send the file from the Linux machine to the MAC using ftp but you are telling that without Ethereal or something similar, I will not be able to use MAC LabVIEW to listen in on the file transfer.

Correct. The LabVIEW TCP/IP functions are not capable of duplicating or simulating a sniffer program.


On the hand, you are telling me that I could send a TCP/IP signal to the MAC telling me that file is ready for transfer and I could pull it over from the MAC side.
Right? This sounds good.

I wasn't suggesting sending a TCP/IP signal. I was suggesting opening a regular TCP/IP connection when the file is ready. In fact, you can use the connection to send a command to the LabVIEW program by just sending character data like "GET FILE xxxxx", and then just close the connection. All you need on the LabVIEW side is a simple listener. There's an example that ships with LabVIEW that's a simple data client. I'm assuming, of course, that the C code on the Linux side is modifiable.


Do you know where I get the Linux TCP/IP commands?

Unfortunately, no, as I don't use Linux. However, I'm sure the 'net will be replete with examples, as this is a fairly straightforward operation.
Message 14 of 15
(932 Views)
Thanks
0 Kudos
Message 15 of 15
(918 Views)