> 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.