LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Receive LV data from another computer

Dear
 
I would like to write Labview program after receiving some data.
The data(temperature and humidity) are acquisiting in real time by LV from an independent computer(remote com.).
Are there some simple methods to share or extract the data like this situation?
(Hopefully, I don't want to modify much LV code in the remote computer.)
 
Thank you in advance. 
0 Kudos
Message 1 of 4
(2,845 Views)
If you're not looking for extreme performance, look at datasockets.

The recording computer can see controls and indicators on the remote computer, and can record that data however it needs to.

Better performance can be had by a TCP connection, it's more complicated than DS, but it's not that hard.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 4
(2,835 Views)

Dear CoastalMaineBird,

Thank you for the reply.

Would you please explain more detail (for realization) about datasocket or TCP?

How to declare for sharing a specific variable, which updated in real time in a monitoring(data acquisition server) computer.

The specific variable is updating all the time and the client had better bring the variable value one time when I need to check the temperature or humidity.

Therefore, the speed is not problem to me except just reliability in connection.

Should the monitoring computer have the fixed IP number or some restricted condition? 

 

Would you please help me one more time?

0 Kudos
Message 3 of 4
(2,820 Views)
For DataSockets, you have to be running Windows, the DS server doesn't run on other platforms.

You have to already have TCP network access between the two machines.

For this little exercise, the data you want must be in a front panel indicator (or control). If you do more coding, you can send DS data programmatically, but for now, let's assume it's on the panel.

  1. On the client side (the one you will monitor with), run the DS Server. {Start - Programs - National Instruments - DataSocket - DataSocket Server.
  2. On the Server side (the one where the data is already there), pop up on the item(s) you want to monitor.
  3. Choose DATA OPERATIONS - DATASOCKET CONNECTION.
  4. In the CONNECT TO box, enter "dstp://192.168.0.101/Value1" (without the quotes). Substitute the client IP # for the IP # shown. Substitute a sensible name for the "Value1" part.
  5. Choose PUBLISH as the connection type, an click ATTACH (or CHANGE if this is not the first time thru).
  6. You should see a small LED next to the item. You can hide it if you want (VISIBLE ITEMS), but for now leave it there.
  7. Run the program. The LED should be GREEN, and on the client side, the DS SERVER should show changing numbers, as packets come in.
  8. On the CLIENT side, you want a similar indicator (same data type) as the one on the server that you are monitoring. You want a WHILE loop with a STOP button and a WAIT function, at least.
  9. On the front panel, pop up on the indicator, and choose DATA OPERATIONS - DATASOCKET CONNECTION.
  10. in the CONNECT TO box, enter "dstp://localhost/Value1". You could enter the IP number, but "localhost" covers it, since the DS server is running on this same machine. The "Value1" part must match the name you gave it on the other (server) end.
  11. Click SUBSCRIBE, and close the dialog.
  12. Run your client program, and the client's indicator should match the server's.

Things to be aware of:

  • You don't know when the data is updated. When your client program uses the values, it gets the latest values. Maybe they're a mSec old, maybe they're a month old. You don't know.
  • If you monitor TWO (or more) indicators, they are not necessarily updated at the same time. If you read them on the client, maybe they correspond, and maybe they don't. It's possible that you read them AFTER it updated #1, and BEFORE it updated #2. You just don't know. If that's a problem, put everything into a cluster, and just update the one value.
  • The server will consume system resources (CPU - network time) and net traffic, whether you are listening or not. If your server updates the display 100 times a second, but you only want a value once a second, that's wasteful because the value gets sent over the net 100 times.
  • I'm not 100% sure, but I think there's no security with this. Any process with access to the DS server, can ask to be updated and it will be.


You had asked for a minimum-code-change idea. I believe the above meets that challenge (no code change at all, only DS settings).

However, it has drawbacks, and if they outweigh the no-code-changes, then you need to consider either programmatic DataSockets or plain TCP. With those you can control every aspect of communication. Consult the examples for those.

Message Edited by CoastalMaineBird on 04-01-200704:51 PM

Message Edited by CoastalMaineBird on 04-01-2007 04:53 PM

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 4
(2,814 Views)