From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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
0 Kudos
Message 1 of 2
(2,471 Views)
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
0 Kudos
Message 2 of 2
(2,471 Views)