LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer file from one PC to other PC

Solved!
Go to solution

Hello,

 

I'm looking for a way to send a .CSV file from a PC to another PC in the same network.

I've found FTP, but I do not know how to work, and the labview example doesn't work for me.

 

 If you could help me, I would be really grateful.

0 Kudos
Message 1 of 11
(493 Views)

I recommend keeping it simple. If you are using windows, try the inbuilt tool for sharing the files over the network. I have seen professional test equipment doing it like this. https://support.microsoft.com/en-us/windows/file-sharing-over-a-network-in-windows-b58704b2-f53a-4b8...

 

 

Message 2 of 11
(466 Views)

Are you trying to learn how to transfer files over a network using your own program (LabVIEW), or do you actually need to transfer data files to another PC?

 

If you just need to transfer data, just use a shared folder, USB drive or cloud storage.  Otherwise, you will need to get admin rights and set up your desired protocol (FTP?).

 

On a home network this should be easy, but these days most company networks are clamped down so tightly the IT guys squeak when they walk. That's probably why the FPT Put and Get Files example doesn't work for you.  It transfers through the NI FTP Server and your IT likely has blocked those ports.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 3 of 11
(462 Views)

In most IT environments I've worked in you can easily transfer files with the syntax \\<hostname>\c$ and just use the native copy/move file nodes.

 

Edit: I think this works because of active directory, assuming the user has access to the folder on the remote machine

Message 4 of 11
(434 Views)

@avogadro5 wrote:

In most IT environments I've worked in you can easily transfer files with the syntax \\<hostname>\c$ and just use the native copy/move file nodes.


"\\<hostname>\c$" only works if the user performing the operation has administrator rights on the remote PC in question.

 

While you can use this yourself, it's not something you should program into your code.  Most other users won't have it.  If everyone does have it, then they probably shouldn't...

Message 5 of 11
(416 Views)

Thanks LLindenbauer, I see, but the problem is that I'm building a half industrial program, but It won't be installed or used in my company. We will handle it to another company, and we want to work as a "black box". When they send a specific commands by TCP, our program has to return the measurement files in the specified file.

0 Kudos
Message 6 of 11
(360 Views)

Thanks for the response NIquist, I didn't specified the porpoise of this program, as I said to another user, the problem is that I'm building a half industrial program, but It won't be installed or used in my company. We will handle it to another company, and we want to work as a "black box". When they send a specific commands by TCP, our program has to return the measurement files in the specified file.

I have admin right but only in our PC, not in the network or the future network.

0 Kudos
Message 7 of 11
(357 Views)

Thanks for the response avogadro5, I'm not familiar with the native comands of windows, so, how can I try if this could work in LabVIEW?

Witch TCP commands?

0 Kudos
Message 8 of 11
(351 Views)
Solution
Accepted by topic author Ricaru52

@Ricaru52 wrote:

Thanks LLindenbauer, I see, but the problem is that I'm building a half industrial program, but It won't be installed or used in my company. We will handle it to another company, and we want to work as a "black box". When they send a specific commands by TCP, our program has to return the measurement files in the specified file.


I see. I also think that this is a more professional way of doing it. Can you be more specific on what is going on with the TCP in your setup? Is it just single purpose, only used to transfer the data? Is it a whole control scheme where the machine can be completely controlled through the TCP connection? Is that control scheme already in place?

 

If you only need the network connection for that single purpose, then a dedicated FTP or HTTP server could suffice. This would be running as a service, independently of LabVIEW. Check https://en.wikipedia.org/wiki/Comparison_of_web_server_software#Operating_system_support - again, use the easiest one, and let it serve up the measurement folder. Incidentally, I also know professional test equipment that does it this way.

 

If you absolutely must have it all in LabVIEW, try the TCP examples. Maybe start here: https://www.ni.com/en/support/documentation/supplemental/06/basic-tcp-ip-communication-in-labview.ht...

Maybe also take a look at the "TCP Named Service" example. In the server, locate the part where the listener is configured

LLindenbauer_0-1738068521952.png

 

and set a fixed port:

 

LLindenbauer_1-1738068594840.png

Then set the same port in the client.

Message 9 of 11
(330 Views)

@LLindenbauer  ha escrito:

@Ricaru52 wrote:

Thanks LLindenbauer, I see, but the problem is that I'm building a half industrial program, but It won't be installed or used in my company. We will handle it to another company, and we want to work as a "black box". When they send a specific commands by TCP, our program has to return the measurement files in the specified file.


I see. I also think that this is a more professional way of doing it. Can you be more specific on what is going on with the TCP in your setup? Is it just single purpose, only used to transfer the data? Is it a whole control scheme where the machine can be completely controlled through the TCP connection? Is that control scheme already in place?

 

If you only need the network connection for that single purpose, then a dedicated FTP or HTTP server could suffice. This would be running as a service, independently of LabVIEW. Check https://en.wikipedia.org/wiki/Comparison_of_web_server_software#Operating_system_support - again, use the easiest one, and let it serve up the measurement folder. Incidentally, I also know professional test equipment that does it this way.

 

If you absolutely must have it all in LabVIEW, try the TCP examples. Maybe start here: https://www.ni.com/en/support/documentation/supplemental/06/basic-tcp-ip-communication-in-labview.ht...

Maybe also take a look at the "TCP Named Service" example. In the server, locate the part where the listener is configured

LLindenbauer_0-1738068521952.png

 

and set a fixed port:

 

LLindenbauer_1-1738068594840.png

Then set the same port in the client.



@LLindenbauer  ha escrito:

@Ricaru52 wrote:

Thanks LLindenbauer, I see, but the problem is that I'm building a half industrial program, but It won't be installed or used in my company. We will handle it to another company, and we want to work as a "black box". When they send a specific commands by TCP, our program has to return the measurement files in the specified file.


I see. I also think that this is a more professional way of doing it. Can you be more specific on what is going on with the TCP in your setup? Is it just single purpose, only used to transfer the data? Is it a whole control scheme where the machine can be completely controlled through the TCP connection? Is that control scheme already in place?

 

If you only need the network connection for that single purpose, then a dedicated FTP or HTTP server could suffice. This would be running as a service, independently of LabVIEW. Check https://en.wikipedia.org/wiki/Comparison_of_web_server_software#Operating_system_support - again, use the easiest one, and let it serve up the measurement folder. Incidentally, I also know professional test equipment that does it this way.

 

If you absolutely must have it all in LabVIEW, try the TCP examples. Maybe start here: https://www.ni.com/en/support/documentation/supplemental/06/basic-tcp-ip-communication-in-labview.ht...

Maybe also take a look at the "TCP Named Service" example. In the server, locate the part where the listener is configured

LLindenbauer_0-1738068521952.png

 

and set a fixed port:

 

LLindenbauer_1-1738068594840.png

Then set the same port in the client.


Thanks for the response.

The program do not need to be controlled from outside, It only needs to returns data when the other pc ask it for.

Following you recomendation I found how to send Big amounts of data via TCP https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019RbuSAE&l=es-ES , this is enough for what we are looking for. Just to send a lot of measurements at the same time.

 

Thanks!

0 Kudos
Message 10 of 11
(142 Views)