LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I connect to another computer using a datasocket server?

I'm attempting to demonstrate distance networking using datasocket and I'm unsure as to how I'm supposed to configure the data socket server to transfer the data correctly.  Also, I'm unsure as to what URL's are supposed to be entered into the open connection block.  I've attached the .vi's I was trying to build to test this out.  Please, in detail, explain to me how I can make this work with any two computers at any distance.  My end goal was to have the writer vi on my computer at home and the reader vi running on my brother's computer in Boston (about 4 states over).  If this is possible with this protocol let me know how.  Thanks.
Download All
0 Kudos
Message 1 of 10
(7,008 Views)

Datasocket can span either a network or the internet, to allow for communication within the same building or halfway around the world.  The general URL format for this protocol is dstp://ServerName/NumericServerName is the computer where the DataSocket Server is currently running and Numeric is an arbitrary name for the memory whereat the published data is located.  You can also find the URL by running the DataSocket Select URL.vi, found in the DataSocket pallette.  This will allow you to browse for your URL.

When using the DataSocket read and write VIs, make sure to pass the Connection ID (teal wire) from the DataSocket Open VI into the Connection In input, rather than the URL.  I would suggest looking at some of our basic DataSocket Examples, found in the NI Example Finder under Help.  Within the example finder, try doing a search for DS Reader and DS Writer.  I would also suggest taking a look at the article linked below on using DataSocket.  Hope this helps, thanks!

DataSocket Tutorial

0 Kudos
Message 2 of 10
(6,974 Views)

Thanks for your response!

I think I see where my problem lies and it brings me to my next question.  How do I put the datasocket server on the internet or somewhere that is equally accessible for both publishers and subscribers?  I think that is the root of my problem because originally when I would run the DataSocket server it would be on my machine which is inaccessible to those outside of my network.  How can I put the server on the internet so I can write information to it and the data be read by those outside of my network?

0 Kudos
Message 3 of 10
(6,964 Views)
You will first need to verify that both computers have an internet connection, since the DataSocket Transfer Protocol (DSTP) is based on a TCP network.  In the URL on your client machine, you will then change "localhost" to the name of the machine that the DataSocket server is running on.  You can also substitue the ip address for the name.  You can launch the DataSocket server by selecting Start»Programs»National Instruments»DataSocket»DataSocket Server.  There is also a help file in this same folder that explains how to configure and manage your DataSocket Server.  One thing to make sure of is that you have properly configured your firewall.
 
You might also want to consider building an interactive Web page to avoid the common problems of a client-server application.  Please view this article on how to set this up with Datasocket.  Please let me know if you have anymore questions, thanks!
 
0 Kudos
Message 4 of 10
(6,955 Views)

I originally tried something like that using my personal desktop and relaying information to a remote desktop on a distant network.  I first used the URL format

dstp://'server name'/'data tag'

And the error out on the client side was Error 42: General Error.  So if instead of using the 'server name' I provided my IP to the client, it should work?  Also, during testing I had gone into my OS services (services.msc) and manually turned off my firewall and instructed the client to do the same.  Is there something I'm missing that could be stopping the data transfer other than using the IP instead of the server name?  Thanks again!

0 Kudos
Message 5 of 10
(6,950 Views)
If the server name provides an error, the ip address should also give an error.  I would suggest pinging the ip address first to make sure that you have established communication.   Also, make sure that you are closing all of your DataSocket connections within your VIs.  As far as managing your firewalls, you can leave your firewalls enabled if you just make sure that port 3015 is open.  This is the port used by DataSocket.  Thanks!
0 Kudos
Message 6 of 10
(6,943 Views)
Does DataSocket or any of NI's networking protcols support tunneling?  We have distributed lab set ups across a LAN and would like to have a similar set up as mentioned above where the remote client is on one network and the server is on another network but must use a gateway to access the internet.   Is this still possible using NI because the IP address given out by the router (usually 192.168.x.x) can not be accessed by the client?
0 Kudos
Message 7 of 10
(6,898 Views)
Can you be more specific as to which type of tunneling you are referring to?  Thanks!
0 Kudos
Message 8 of 10
(6,834 Views)
I'm not entirely sure.  I've been trying to read up on articles describing this type of technique and have come up short but basically the situation is this:
 
We have multiple computers that connect to the same router that's connected to a wireless internet card (all assigned local IP addresses 192.168.x.x) for internet access.  From a remote location I've been able to ping the wireless card but, how can I get the packets to go to a specific computer on that network?  Using any of the computers on the LAN, I can send information out through the router to the remote location, but no information can be sent back since it's behind the router and the local IP address (192.168.x.x) is not recognized.  What information do I need to input so that the information I send from the remote location is received by the desired computer on the LAN I'm sending it to?
 
Thanks again for your response!
0 Kudos
Message 9 of 10
(6,811 Views)
If your are unable to communicate from your remote location to your computers through the router on the LAN, I do not know that DataSocket can overcome this communication barrior.  What I would suggest doing, is building an interactive Web page to avoid this problem.  There is a great article on how to set this up that I linked to earlier in this forum.  Please let me know if this is something you could try, thanks!
0 Kudos
Message 10 of 10
(6,753 Views)