LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer a File/Folder from other computer

Dear All,

 

I am working on a Windows platform PC with LabVIEW 10 and i want to transfer a File from the other PC. Both the PC's are connected in the network. I dont have a licensed FTP. Hence looking for other alternatives. 

 

 I found DataSocket, TCP,UDP as an option but those are all 2way communication means the server PC has to send and the client PC should receive. But i want only the client PC should access the server PC and transfer the required file. Is it possible? If so whic is the better option. Hope i have explained clearly.

 

 

0 Kudos
Message 1 of 11
(4,276 Views)

How about mapping a network drive in Windows?

0 Kudos
Message 2 of 11
(4,270 Views)

Oh No...I want it to do programmatically through LabVIEW .

0 Kudos
Message 3 of 11
(4,262 Views)

Hi GITA,

 

transferring data from one computer to the other always needs a server and a client. Point.

 

When using mapped network drives Windows will handle the client/server stuff.

When using FTP you need a FTP server on the computer with data to transfer.

When using LabVIEW you need a program on each computer to handle the client/server stuff. (There are more things to use like NetworkStreams, SharedVariables, UDP, good old COM ports, ...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 11
(4,258 Views)

Well in order for a network communication to work, there ALWAYS have to be compatible software protocol handlers on both sides of the link. You can't pull data out of the void. Windows networking works because it is an integral part of Windows, but it still requires a client-server connection. And it also requires an according configuration on the server side to allow specific access, since you wouldn't want to open your computer to the entire wild west of internet. However the Windows network protocol is way to involved to be directly handled from within LabVIEW, so your options are quite simple:

 

- Create your own protocol that requires you to install an according component both on the server and your client

- Use Windows networking to map a network share into your filesystem and access it from there

 

The last point can be done from within LabVIEW, either calling into the Winapi (cumbersome and only recommended for advanced LabVIEW programmers with some serious C programming knowledge) or using the System Exec function to execute the Windows "net" command line tool, that can establish, manipulate and close most Windows network connections.

Rolf Kalbermatter
My Blog
Message 5 of 11
(4,257 Views)

@GITA_A wrote:

 

 I dont have a licensed FTP. Hence looking for other alternatives. 

 


What do you mean by that? If only you don't want to purchase an FTP server software you can just use FileZilla Server. It's free.

http://filezilla-project.org/

If the 2 PCs are within the same network you only have to open the corresponding ports on the machine running the server.

 

Message 6 of 11
(4,221 Views)

Thank You ALL,

 

@GredW-

Spoiler

When using LabVIEW you need a program on each computer to handle the client/server stuff. (There are more things to use like NetworkStreams, SharedVariables, UDP, good old COM ports, ...)


I knew that each computer need a program to handle the client/server but my doubt is I have earlier used Internet Toolkit for transfering a file from NI RT controller to my HOST/Client PC where only the Internet toolkit was installed on both the machines and i have done the program in my Host PC specifying the IP address of the RT and the file path in the RT in the FTP code thats it i was able to get my files transferred when runned from Host but didnt do any programming on the RT code.

 

Any help would be appreciated.

 

0 Kudos
Message 7 of 11
(4,187 Views)

That is because NI uses FTP internally to download data files to the RT system, and therefore has installed an FTP server on them out of the box. Since it is a fully NI controlled environment they can do that.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 11
(4,181 Views)

Set up filesharing and/or firewall and you can access files through \\computername\sharename\folders\file.

 

Simple 🙂 

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 11
(4,174 Views)

I'm with Yamaeda.  Setup shared folders and access the files through that.  It will be way easier than anything else you could write.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 11
(4,155 Views)