LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network, security, ftp... How to approach writing file to network from LV?

Sorry, but I don't know if this is more a LabVIEW question or a networking or ftp quesiton - how do I approach this need?

 

We have a machine programmed in LabVIEW and we need it to write a text file of process run data to a folder on our network. I thought we were going to be able to see the folder as mapped to a drive on the PC that is running LV. That is, I thought we'd be able to have LV create a file called Q:\Data\ThursdayAM.txt and write into it.

 

But the IT folks are telling me we can't do this because of security issues, something about what account the LV computer is running under. They have set something up so that Internet Explorer (not Windows Explorer) can navigate to the folder (with dialog boxes that ask for username and password), and they think they may be able to set up something using ftp. So, while a person standing there at the PC would be able to gain access to the folder, it wouldn't feel like accessing a disk drive feels.

 

How can LabVIEW programmatically write a file under such circumstances? LV can't interact with Internet Explorer like a user, and type passwords into a dialog, can it? I see things in the help system about ftp but am not experienced with it and don't know whether to start down that path; for one thing I haven't found anything about authenticating to a network under program control with ftp.

 

If there is a LabVIEW-centric approach to things like this, please point me in the right direction! Or, if this is really more a question about networking and security, please give me some tips about what to ask the IT group, as I'm not very up on networking.

 

Thanks!!

0 Kudos
Message 1 of 8
(3,692 Views)

If you can use FTP, and you have access to LabVIEW's Internet Toolkit, you can use FTP Put File (which has user and password inputs) to copy your file onto the server.

0 Kudos
Message 2 of 8
(3,680 Views)

FTP is certainly an option, and you can get NI's toolkit, or you go with an open-source solution.

 

Can LabVIEW interact with IE? Well, yes, but it depends on what kind of interaction you want. You can have a browser control on a LabVIEW front panel, and access the properties and methods of the IE ActiveX control. I have no idea how much programming skill you have to tell you whether this is a viable option for you. 

 

Another possibility is to use a third-party automation tool so you can have LabVIEW control an Internet Explorer window as if you were doing it directly with a mouse and keyboard. My favorite tool for this is AutoIt, but there are others. 

 

I am curious as to exactly what the IT folks have set up, though.

0 Kudos
Message 3 of 8
(3,669 Views)
What are they having you enter into the IE address bar?  You can leave out specific info if it is sensitive, but the general format of the address would be useful.
0 Kudos
Message 4 of 8
(3,660 Views)

Thanks, all.

 

As far as things like browser controls on the Front Panel, I think that would be solving the wrong problem. I don't want users of the machine to be able to browse folders or in any other way feel like they are using Internet Explorer. From my user's point of view, the machine will say "Your data are now available at Q:\Data\ThursdayTest.txt", and they will leave, and return to their own desktop machine, and will go grab the file and use it with whatever tools they would use to grab and read any text file on the fileserver. I think I want to programmatically get the file written to the correct folder, and am trying to understand how to do that, but the way I do it will never be visible to users. So, maybe there is something to do here, but not exactly browser controls.

 

I will find out if I have the toolkits mentioned - thanks for pointing me at that.

 

What they have me do with Internet Explorer to gain access to network folders is as follows: I'm already logged into the PC as a Windows user with a general purpose Guest account, and no password, and from the point of view of our network without any security credentials. I start Internet Explorer, and type an IP address 123.123.123.123 into the address bar. I get a dialog asking me for my username and password, and I enter the username and password that I would use for my desktop w/ network access or any of the other PCs on which I am already configured as a user. Now Internet Explorer shows folders for the different network locations that the network thinks I personally have rights to, and I can read, write, copy, paste, open and so forth. When I quit Internet Explorer this PC goes back to looking to me like a PC without any network features.

 

The purpose of network access for this system has also been a bit confusing, but there are two main points. The big and, perhaps, only necessary thing is that my LV program can write files to a network folder, however it is that this works. It's one of the goals of this entire project to start giving users the ability to get their data without burning CDs or other sneakernet methods. As a secondary point, while I am programming and otherwise maintaining this system, I am backing up my VIs to the network, and passing things like manual docs from web sites in to the system computer for reference (its subnet does not allow internet access so I'm using my desktop machine to grab manuals and put them in the network folder), and miscellaneous other things like that. I'll probably copy this conversation into a text file when I think I have something to try, as another example. But these things are secondary conveniences - the only thing that is strictly necessary is the ability of my LV program to push data files into a network folder.

0 Kudos
Message 5 of 8
(3,643 Views)

>FTP is certainly an option, and you can get NI's toolkit, or you go with an open-source solution.

 

I don't have the Internet Toolkit. But I am considering getting the Development Suite, because I am considering getting the VI Analyzer, and there's a package deal underconsideration now; if using the Internet Toolkit makes this clean and neat and robust, more so than other methods, I think I'd go for that.

 

>You can have a browser control on a LabVIEW front panel, and access the properties and methods of the IE ActiveX control. I have no idea how much programming skill you have to tell you whether this is a viable option for you.

 

I haven't programmed with ActiveX and have only a vague idea what it is about. But I have certainly used property nodes and invoke nodes to manipulate things inside LV. I have set up a home hardwired network with fileservers and broadband, but have absolutely nothing to do with the care and feeding of my company's networks and have nothing near an IT type sklll set. Would I be right in guessing that I could probably find my way through this without making a whole new project out of it? Maybe it would take a half day or a day? Or am I opening Pandora's Box?

0 Kudos
Message 6 of 8
(3,641 Views)

There's another option we are considering - using the System Exec VI. I think this would depend on the IT people finding a way to copy an existing file on c: to a network folder from the command line. If they can tell me how to do that, then I can use System Exec to do it. I have used it to copy a file from one c: folder to another.

 

There is a product called netdrive.exe that IT uses in some places - in fact they may already be using it on the system PC for something - it may be what lets IE act in place of Windows Explorer as I described.

 

If this option works, the only LV question is how to use System Exec, and so far it seems very simple.

 

This is also appealing because supporting it requires very little on the LabVIEW end, and on the IT end, they own everything Windowslike and networklike and A+like.

0 Kudos
Message 7 of 8
(3,633 Views)
Note that FTP is notoriously insecure. The user name and password are
transmitted over a normal TCP/IP connection, and anyone sniffing can catch
this information.

I am at the moment dealing with a similar problem. I use "NET USE" command.
If you type NET USE from a command line, you'll see how it works. Or google
it for all of it's commands.

In short, you can make LV map a network drive, that needs a user name and
password. When LV is done, it can delete the mapped drive. Between creation
and deletion, LV can access the drive. Unfortunately, everyone can access
the drive, since the mapped drive is visible in Windows. If the storage of
the file is fast, this won't be a problem. It all depends on your needed
level of security. Like I said, FTP isn't very secure either.

"NET USE q: \\server\directory password /USER:domain\username" will map the
specified directory to q:. "NET USE q: /DELETE" will delete the mapped
drive.

Regards,

Wiebe.


0 Kudos
Message 8 of 8
(3,596 Views)