LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

datasockets - only partial success !

Solved!
Go to solution

Hi,

 

Tried to run examples (Reader and Writer) from C:\....\National Instruments\CVI2010\samples\datasocket folder in two scenarios:

 

Scenario_1: Both Reader and Writer ran on different PCs but in the same LAN.

Result: Ran es expected.

 

Scenario_2: Same as Scenario_1 with the only change: Reader was ran outside Writer's LAN. It was in Wi-Fi wireless area (surfing internet was normal).

Result: PROBLEM. The reader could not connect to the server and a message was produced: Error: Not Connected: Connection timed out.

 

Any idea what is causing that problem ?

 

 

Andrzej

0 Kudos
Message 1 of 11
(4,340 Views)

Andrzejp,

 

This is expected behavior. Datasockets are designed to be used primarily over a LAN. If you want to use something like that remotely, you can either remote into the network or host a website or similar like any other web based application. 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 11
(4,317 Views)

Kyle M wrote:

 

This is expected behavior. Datasockets are designed to be used primarily over a LAN. If you want to use something like that remotely, you can either remote into the network or host a website or similar like any other web based application.

 

The NI web site: http://www.ni.com/datasocket/ says:

 

Whether you are passing data between applications or passing data over the Internet, National Instruments software makes moving measurement data easy. Native to National Instruments LabVIEW, LabWindows/CVI, and Measurement Studio, as well as having tools for Visual Basic, and DataSocket technology delivers plug and play connectivity throughout your company's enterprise by providing an easy interface for sharing live measurement data between applications separated by a network or the Internet.

 

To me the above paragraph gives impression that datasockets can communication over internet. You are saying about LAN as primary (as opposed to exclusive) environment for reader/writer communication. So still I'm not sure if it is possible to make these sample programs (reader & writer) communicate over internet. If it is then could someone give me some more details (other than what you've said already) on what steps should be done to accomplish that ?

 

Regards, Andrzej 

 

0 Kudos
Message 3 of 11
(4,311 Views)

Andrzejp, 

 

My mistake, it seems you are correct on this. I havent used datasockets a huge amount on CVI, so Ill have to look into how to accomplish this. It could just be that the examples arent out-of-the-box designed to host over the internet.

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 11
(4,308 Views)

Ok, Kyle.

 

Waiting anxiously for your findings .....

 

Regards, Andrzej

0 Kudos
Message 5 of 11
(4,306 Views)

Andrzej,

 

To do this with Datasockets, you will need to change how you are referring to the computer. Youll need to refer to it in the same form as before I believe (dstp://external Ip address/etc), but youll also need to forward the ports on the router to make sure it allows communication to get through. For datasockets you will need port 3015 forwarded as seen in this KB here: http://zone.ni.com/devzone/cda/tut/p/id/12402

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 11
(4,283 Views)

Kyle,

 

I followed exactly your most recent instructions (using 3015 port reference) and .... failure, no connection from my reader.exe (placed in wireless Wi-Fi area) to the writer.exe ( in remote LAN).

 

Then to make things simpler I changed the reader's location and hooked-up the reader PC to the internet via ethernet cable. Result: same: no connection the server/writer PC. So the problem lies somewhwere else ... but where ?? Any other ideas ??

 

I have now a little remark: the writer program itself launches the datasockets server by executing a function:

 

DS_ControlLocalServer(DSConst_ServerLaunch);

 

The part: LocalServer of this function'a name is not a suggestion that the server is only for local usage, i.e inside a LAN but not internet ?? (just my small speculation).

 

 

Regards, Andrzej

0 Kudos
Message 7 of 11
(4,261 Views)

Andrzejp,

 

Can you ping through that port to the other computer? If not, its likely a firewall up somewhere along the way which you will need to forward a port through. 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 8 of 11
(4,243 Views)

Hi

 

On my Writer machine 2 servers were running: Datasockets server and GlassFish server (from Microsoft) for web access activities. From the Reader PC (client) and using same IP address I sent a request to each server:  to GlassFish: http://IP_Server_address (from within Internet Explorer) and to Datasockets ping: IP_Server_address from command line. The GlassFish server responded fine and the ping command failed.

 

Do you think that the server's firewall allowed http request but blocked ping ?? 

 

 

Regards, Andrzej

0 Kudos
Message 9 of 11
(4,226 Views)

Andrzej, 

 

The two servers are probably running on different ports, which would explain why one works and one doesnt. The routers and such are probably blocking the desired ports. You will need to forward them to get through, for information on how to forward ports, http://portforward.com/ is a great resource. 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 10 of 11
(4,210 Views)