LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with data socket connection

I have two computers on a network both running labview. I would like to exchange the value of a variable in both directions. For example computer A sets the variable to a certain value, computer B reacts and changes this variable. Computer A now reads the new value.

So I tried this using (front panel) data sockets but I could not establish a connection the way I want it. Also I couldn't find answers here or in the labview help file, so I hope you can give me a short hint on how to do that (do I need to run socket server on both machines? What IP address do I need to enter in the front panel dialog?)

Thank you very much,
Michael

0 Kudos
Message 1 of 5
(3,948 Views)

If you would give us a little more detail it will help in resolving the problems. Specifically, what version LabVIEW, what operating systems on each machine, etc. If you are running XP sp2, for instance, you have to make sure that the firewall is either disabled, or allows the ports you choose for your data socket connection. What errors are you seeing or what is it that isn't working as you want?

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 5
(3,945 Views)
Sorry. Both computers run Win XP SP2 and LabView 7. Both using the Norton firewall and blocked ports may cause the problems. But how can I find out which ports are used by the data socket connection? I think I did not define any ports to use so I guess it uses its default ports.

I can not really say what is goint wrong - there are no error messages. Apart from the port issue, my main problem is that I don't know what to enter in the connect to field.

The help file only says:
Connect To—Specifies the location of the data and the protocol, such as dstp, ftp, or file, that the DataSocket connection uses to publish or subscribe to the data.

So what I entered now on *both* machines is:
"dstp://192.168.0.1/varname" where 192.168.0.1 is the IP of computer A.

Thank you very much,
Michael


0 Kudos
Message 3 of 5
(3,943 Views)
The DataSocket server uses port 3015; you could try opening that up. The URL that you have here looks OK. You can use either the IP address or the machine name of the machine that is running the DataSocket server -- both should work.
0 Kudos
Message 4 of 5
(3,928 Views)
Thanks for the Port number, I got it to work now.

I will summarise what was necessary to establish a connetion in case other people are interested:

If you need a bidirectional communication between computer A (IP:192.168.0.1)
and B (IP: 192.168.0.2) the following steps may be necessary:

- Run DataSocket Server on *both* computers before you start LabView

For communication A to B:

- Select a variable on computer A, and enter the following in the connect to field:
   "dstp://192.168.0.1/var1", click on "publish"
- Create a variable of the same type on machine B and enter in the connect to field:
   "dstp://192.168.0.1/var1", click on "subscribe"

For communication from B to A do the following:

- Select a variable on computer B, and enter the following in the connect to field:
   "dstp://192.168.0.2/var2", click on "publish"
- Create a variable of the same type on machine A and enter in the connect to field:
   "dstp://192.168.0.2/var2", click on "subscribe"

Maybe this is not the most elegant way because I don't know how to use the "Publish and subscribe" field
but at least it works this way.

Michael
0 Kudos
Message 5 of 5
(3,917 Views)