LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the file protocol to read a URL from a DataSocket Link (DSL) file

Hey people,

The text of the message subject is almost directly lifted from the LabVIEW help file. I'm currently a DataSocket server for communication between a laptop and a Compact FieldPoint unit. My application is currently functioning, but I'm searching for a way to easily change the IP of the server without having to recompile the VI into a startup.exe file.

The help file says it is possible to create a file (.dsl extension) which contains the URL of the server, with the following format:-

[InternetShortcut]

URL=dstp://servername.com/tag

I have created such a file, but the help file refers to reading the URL from the DSL file directly, which I'm not sure how to do. The examples use hard-coded strings as their reference URLs, so no help there, and as far as I can see the question has not been raised before on these boards.

I am aware that I could probably use the File Open vis and manually read the information contained within the file, but then it wouldn't make sense to rename it to .dsl or to have any other text other than the URL contained within.

Thanks for your replies.
0 Kudos
Message 1 of 3
(2,672 Views)

Hey Lost And Found,

There is actually a great example on using .dsl files with DataSocket.  You can append "file:" to the beginning of the path of your .dsl file, and wire it directly into the "connection in" pin of the DS Read.  Check out the example here: http://digital.ni.com/public.nsf/websearch/FCC19AF27EFED9A5862569A500709C58?OpenDocument.  I think that it will provide everything you need and if not, just ask.

Hope this helps!
Megan B.
National Instruments

0 Kudos
Message 2 of 3
(2,654 Views)
Thank you Megan B.

Actually, now that I read that article, I find that the .dsl file method only works for DataSocket Read, when my application needs both write and read VIs.

I've accomplished what I needed using the configution file Open and Read VIs anyway, so thanks again. It takes a bit more space, but I only have to do it once to get the IP so the resource usage is minimal, and most importantly, it works =).
0 Kudos
Message 3 of 3
(2,640 Views)