LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DataSocket Problem

I want to use Datasocket to send string messages back and forth, between 2 computers connected to the Internet. One computer (call it computer 1) is running the DataSocket Server Manager. The other computer (computer 2) uses the IP address of computer 1 in conjunction with datasocket reads and writes to communicate. So far I've been able to get computer 2 to read information sent by computer 1. But, no matter what I try, I cannot get computer 1 (the computer running the server) to read a message from computer 2. My guess is some sort of setup or firewall problem on the computer that runs the server. I've tried turning off the firewall of the server computer but that doesn't work. Any suggestions would be appreciated!
0 Kudos
Message 1 of 7
(4,054 Views)
Well, I just made something similar yesterday. And I also ran into some funny issues. One issue seems to be that the "write to datasocket" function doesn't work well with a connection id (created by the open datasocket function), but works fine with a regular URL string (i.e. dstp://ip/data item).
For your computer 1 to be able to read the string from computer 2, computer 2 must first make a successful DS write. Make sure the DS write is successful: you should see in the DS server window that there is at least one connection and see the number of packets increase. Connect the error terminals to make sure it works. Next you should check whether computer 1 is doing a successful DS read. The same issue with the connection id may be the culprit here. Lastly make sure that you correctly set the "mode" in the open DS function.
Hope it helps. If not, I can give you the application I built.

Aart-Jan van Zadelhoff
0 Kudos
Message 2 of 7
(4,049 Views)
I'm still having problems and would love to see the application you built if it's not to much trouble. Thanks
0 Kudos
Message 3 of 7
(4,045 Views)
I have submitted it to the code sharing library. Not sure whether NI will accept it. You should be able to find it soon by browsing for author name Aart-Jan van Zadelhoff.

aartjan
0 Kudos
Message 4 of 7
(4,010 Views)
Since I don't know whether NI will add it to the library, I attached it to this message.

aartjan
Message 5 of 7
(4,000 Views)
The code above requires Labview 7.1
0 Kudos
Message 6 of 7
(3,979 Views)
Hi,

I'm not sure if my comment applies to Items in the Data Socket Server created by Vis. For Items predefined in the Data Socket Manager, the default behavior is that the local host has privilege to write and every host has privilege to read, unless you change that settings. If the same default applies to Items not predefined in the Server but created by running Vis, then the remote Vi will never be able to write. In that case, you have to predefine the Item in the DS Manager and change the settings so, when the remote Vi tries to write the Item it has the right privilege.

If my assumption about the privileges is right, another simple option is to run the DS Server in both computers and each Vi will write in his local item, turning each DS into a one-way communication way.

Marce
0 Kudos
Message 7 of 7
(3,972 Views)