LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

put a file to webdav windows server with LabVIEW

Hello there,

 

I have a project where some sbRIO's will go in the field. The data the systems are collecting needs to be transferred to a data server. We want to use a server without LabVIEW, the sbRIO's have to connect to the server and push their data files to the server. I am planning to use WebDav for this purpose.

The examples I could find are all based on a file put or get action by a windows PC: the webdav URI you need to specify is pretty simple (already used it) http://<IP address>/files/<directory on your RT target> .

Now I created a set up (as a first step) where I connect a WebDAV server )other PC) directly to my PC (firewall disabled on both ends). First step is to connect by a webbrowser to my webdav server http://<IP address>/zoutwachter . This is no problem at all. As a test I made the server available without any log in.

Now I'm struggling to approach the server with LabVIEW. For example get the file / directory list. So I have the webdav: Open Session.vi , Directory Listing.vi and of course the Close Session.vi .

The Open Session.vi isn't giving any error (no matter what URI I specify). But I believe the correct host URI prefix is the same as in my webbrowser so http://<IP address/zoutwachter . Now the relative URI on Directory Listing.vi. The folder I made available is d:\ZoutWachterData, should this be specified as /d/ZoutwachterData/ as relative URI? Or do we need to specify the with /dav/ (for RT you use files).

I always get the errors 124100 resource not found or the not supported error 124103. Does anyone have any experience with URI's to a windows webdav server? I'm really struggling over here.

 

Thank you in advance,

 

best regards,

 

Martijn

0 Kudos
Message 1 of 19
(5,883 Views)

Hi Martijn,

 

I would recommend trying to use the WebDAV shipping example in LabVIEW. This can be found by going to Help - Find Examples... and searching for WebDAV. This will rule out whether there is anything wrong with your LabVIEW code.

 

Kind regards,

 

Tom-S

Applications Engineer

National Instruments

0 Kudos
Message 2 of 19
(5,805 Views)

Hello Tom,

 

I did use this example. But I'm struggling with the URI over here. Only the URI's for WEBDAV functions on a UI to a RT systems are given with the examples. In the current set up I am trying to put a file on a WEBDAV site on a WIndows PC. I used this tutorial to set up my Windows WEBDAV server: http://www.serverwatch.com/server-tutorials/how-to-set-up-a-webdav-server-in-windows-7-8.html And I'm able to go to the webdav site from another PC. If I then use LabVIEW (examples, or just the webdav simple put vi) I got the errors I mentioned earlier. The only thing I can think of is a faulty URI, is there something known within NI how URI's to a windows webdav site should be specified?

 

Best regards,

 

Martijn

0 Kudos
Message 3 of 19
(5,780 Views)

Hi Martijn,

 

In your URI are you specifying a port number? I.e. http://<ipaddress>:<portnumber> 

 

Thanks,

 

TomS

0 Kudos
Message 4 of 19
(5,719 Views)

Hello Tom,

 

normally it should pick port 80 (http), at one of the last attempts I specifically specified this port. My PC is directly connected to the server, on both sides the firewall was turned off. Again: browsing with the web browser to the server goes well. So I don't believe there is some safety issue or something.

I noticed on the web they specify a webdav server address with /dav/ , but this was on a NAS kind of thing. But this triggered me if there is also something like this for windows webdav servers. We specify a rt target with http://<ip address>/files/<directory> , so is there also something you need to put after the host name / address when browsing to a windows server?

In the webbrowser you don't. But with this in mind I'm curious if others can browse to a webdav windows server using LabVIEW.  

0 Kudos
Message 5 of 19
(5,711 Views)

Hi Martijn,

 

You may have already come across this KnowledgeBase article but its describes how to setup a WebDAV server to transfer data to and from a RT target.

 

http://digital.ni.com/public.nsf/allkb/4EBE45E8A816B19386257B6C0071D025

 

I recommend ensuring that you have followed this to setup the file transfers.

 

Regards,

 

Tom S

0 Kudos
Message 6 of 19
(5,688 Views)

Hello Tom,

 

I'm already able to get data files from my cRIO target, no problem.

 

I followed the steps, still no result, to get or to put files on a Windows webdav machine, but can you please clarify (just to be sure) how a URI to a Windows webdav machine should be constructed? If we get the URI right, then we can try further to see what the problem is. Now I'm not sure.

 

Regards,

0 Kudos
Message 7 of 19
(5,660 Views)

Hi,

 

The URI format is as follows:

 

http[s]://hostname[:port]/directory/subdirectory/filename

 

The port is 80 for non SSL and 443 for SSL connections

 

I hope this helps,

 

TomS

0 Kudos
Message 8 of 19
(5,650 Views)

hello Tom,

 

I managed to download a file from my webdav server, the URI http://<computername>/<virtual folder>/<document> works. However writing a file to it is still a challange. I used the same URI and different others. Attached you can see my attempt in LabVIEW, the simple webdave get file.vi is working fine. I did 4 attempts in a for loop for the simple put file.vi: all attempts are generating error -124100 or -12403. If I put in a new file name in the URI I get always -124100, if I enter an, on the file server, exsisting name http://ML00681:80/zoutwachter/doc2.txt generates error -12403. I also used the WebDAv Data Acquisition.lvproj example: this generates the same errors when requesting the directories and files.

I gave everyone and specific IIS_IUSRS reading and writing rights (full control) to the folder I'm sharing.

Going through the file explorer and creating or changing a file goes without any problem. Do you have any further ideas what step I can undertake?

 

Best regards,

0 Kudos
Message 9 of 19
(5,625 Views)

Hi,

 

Can you confirm that the files you are trying to write to the server do actually exist on the device under D:\ path.

 

It might seem obvious but its worth checking.

 

Kind Regards,

 

TomS

0 Kudos
Message 10 of 19
(5,598 Views)