NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Esben
Posts: 36
0 Kudos

FTP Problem

Can anybodt tell me why i can't use a already opend refnum on a FTP
connection.

I first make a open ftp and logon and a simple LIST and it goes ok.
But when i use the same refnum from a opened global i cant't just make the
list, i have to open a new ftp connection.

Whats wrong

E
Active Participant
Johnner
Posts: 394
0 Kudos

Re: FTP Problem

Esben Jensen wrote:

> Can anybodt tell me why i can't use a already opend refnum on a FTP
> connection.
>
> I first make a open ftp and logon and a simple LIST and it goes ok.
> But when i use the same refnum from a opened global i cant't just make the
> list, i have to open a new ftp connection.

I whipped up my own version of this setup and had no problem at all. However,
I was using the VIs that come with the Internet Developers Toolkit--is that
what you're doing?

I put together two VIs:

A. Opened an FTP session (to ftp.ni.com), logged on anonymously, wrote the
FTP session to a global, and then stayed in a while loop. There was also a
case in the loop that issued a LIST command if I clicked a front panel button.

B. A one-shot, no loop. This VI simply read
the FTP session from the
global and invoked the LIST (FTP Directory Listing.vi), then stopped.

I made sure to close the FTP session only from VI A, after the while loop
ended. I was able to do arbitrary LIST commands from either A or B without
any errors, as long as I ran B after A had already initiated the FTP session
and authenticated.

Note that the FTP session object is updated when you run it through things
like the logon VI. If you wrote the session variable before the FTP logon
occurred, there would be a problem. You'd get errors about not being
authenticated.

Hope it helps,
John Lum
National Instruments
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page