01-27-2025 08:48 AM
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.
Solved! Go to Solution.
01-27-2025 10:01 AM - edited 01-27-2025 10:45 AM
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...
01-27-2025 10:14 AM
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.
01-27-2025 12:19 PM - edited 01-27-2025 12:28 PM
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
01-27-2025 01:19 PM
@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...
01-28-2025 03:47 AM
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.
01-28-2025 03:53 AM
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.
01-28-2025 04:07 AM
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?
01-28-2025 07:00 AM
@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
and set a fixed port:
Then set the same port in the client.
02-04-2025 06:05 AM
@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
and set a fixed port:
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
and set a fixed port:
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!