NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Active Participant
GITA_A
Posts: 221
0 Kudos

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.

 

 

Active Participant
Todd_Lesher
Posts: 383
0 Kudos

Re: Transfer a File/Folder from other computer

How about mapping a network drive in Windows?

Active Participant
GITA_A
Posts: 221
0 Kudos

Re: Transfer a File/Folder from other computer

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

Proven Zealot
GerdW
Posts: 9,550

Re: Transfer a File/Folder from other computer

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


CLAD, using 2009SP1 + LV2011SP1 (sometimes even LV2013SP1) on WinXP+Win7+cRIO
Kudos are welcome :smileywink:
Trusted Enthusiast
rolfk
Posts: 4,597

Re: Transfer a File/Folder from other computer

[ Edited ]

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
CIT Engineering Netherlands
a division of Test & Measurement Solutions
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
Active Participant
dan_u
Posts: 1,186

Re: Transfer a File/Folder from other computer


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.

 

Active Participant
GITA_A
Posts: 221
0 Kudos

Re: Transfer a File/Folder from other computer

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.

 

Trusted Enthusiast
rolfk
Posts: 4,597
0 Kudos

Re: Transfer a File/Folder from other computer

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
CIT Engineering Netherlands
a division of Test & Measurement Solutions
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
Trusted Enthusiast
Yamaeda
Posts: 2,708
0 Kudos

Re: Transfer a File/Folder from other computer

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

 

Simple :smileyhappy: 

 

/Y 

LabVIEW 8.2 - 2013
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV
Proven Zealot
crossrulz
Posts: 8,324
0 Kudos

Re: Transfer a File/Folder from other computer

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



There are only two ways to tell somebody thanks: Kudos and Marked Solutions