From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ethernet emulation

Solved!
Go to solution

Dear LabVIEW forum,

Does anyone know if it is possible, or if there are any example vi's, showing examples of using ethernet network connections that are emulated i.e. without the actual physical connection but showing how data can be transmitted/received?.

Ideally I am looking for an example whereby a remote PC is equipped with a DAQ card for receiving field signal measurements and then this PC is networked using ethernet connection to a remote host.  The remote host will have a LabVIEW front panel that can display the field measurements.  I want to set this up within a single LabVIEW vi showing the DAQ PC and remote host with interconnected ethernet network connection.

Any assistance or help will be gratefully received.

 

Regards,

0 Kudos
Message 1 of 8
(3,905 Views)

All of the shipping examples are set with a default of 'localhost' so I don't quite understand what else you might be looking for.

0 Kudos
Message 2 of 8
(3,898 Views)

Hi Dennis,

 

Please excuse me but my experience and knowledge of LabVIEW is very limited.  I can see that the examples are set with URL as dstp://localhost even though many do not run properly when tried.

My aim is to try and show a block diagram & front panel with two parts (i) a PC with DAQ card that has associated field measurement sensors connected and (ii) a remote PC that is connected to the field PC via network connection.  The remote PC should be able to call and read the measurement data from the field PC.

I have looked through some examples using Datasocket vi's but do not fully understand how they work and how I can apply these to my application example, for instance do I need to use Datasocket Open first then use DataSocket Read then use DataSocket Close ? I am also unable to understand how the data from the DAQ card will pass through or be addressed by these various DataSocket vi's.

Some more guidance would be appreciated.

 

Regards,

0 Kudos
Message 3 of 8
(3,884 Views)

Simply saying that the examples do not run properly is not sufficient. They will all run if you follow the instructions on which should be started first and if you do have windows firewall turned on. If you get an error, then provide the error code.

 

There are examples that use a simulated signal (i.e. Data Server/Data Client - Generator VI/Display VI). It is a simple matter to replace the simulated signal with a real DAQ function.

 

Personally, I would not use Datasocket or a network shared variable. I would look at the Network Streams or TCP options. You also have the option of publishing any VI as a web page and viewing it in a browser. This requires the installation of the LabVIEW run-time. Creating a web service is another option. Lastly, there is the LabVIEW Web UI Builder. Lots of different options. Experiment and see which best fits your needs.

0 Kudos
Message 4 of 8
(3,878 Views)

Unfortunately the instructions (if they are given) are not always clear and complete.  I have spent a considerable amount of time searching through the LabVIEW examples as well as reading the DataSocket Help files however I still cannot understand how to apply the DataSocket tools in practice to my very simple application.

I have attached two vi's one for the local PC whereby a signal is simulated and displayed on a graph with a local variable for the data.  The other vi is for the Remote PC which is connected via network (in this case localhost).  My understanding is that both vi's have to run at the same time, the Remote PC.vi is to read the data from Local PC.vi using the DataSocket Read function.  Unfortunately my vi's do not work properly and I cannot understand how to set up the Variant type for the DataSocket Read function (error message comes back about this but provides no clue how to resolve).

If anyone can assist it would be appreciated.

 

Regards,

Download All
0 Kudos
Message 5 of 8
(3,868 Views)

bunnykins wrote:

I have attached two vi's one for the local PC whereby a signal is simulated and displayed on a graph with a local variable for the data. 



That local variable has no function here. It just mirrors the graph. Your diagram comment makes no sense. You read from "Data", not from a local variable of "data".

 

Try the following: Right-click the graph...properties...databinding, and press the [help] button.

0 Kudos
Message 6 of 8
(3,860 Views)

Thanks however I'm no further forward with my solution.

I have now selected DataSocket as the Data Binding Selection (with Filepath dstp://localhost) within the Graph vi in the attached Local PC.vi.  When I run both of the attached vi's at the same time, the Remote PC.vi returns the following error message:

Error 63 occurred at DataSocket Read in Remote PC.vi

Possible reason(s):

LabVIEW: Serial port receive buffer overflow

LabVIEW: The network connection was refused by the server

 

I have no clue where I am going wrong and I'm just floundering around in the dark becoming ever more confused with the reams of "un-helpful" Help files.

If anyone can assist with some detailed instructions or advice it would be gratefully received.

 

Regards,

Download All
0 Kudos
Message 7 of 8
(3,850 Views)
Solution
Accepted by topic author bunnykins

I had a feeling that either your firewall was blocking something, or you didn't have something configured properly.

 

I saw in some examples that it said make sure data socket server is launched.  I searched and found this thread.  http://forums.ni.com/t5/LabVIEW/Datasocket-Startup-Error/m-p/145719#M87402

 

After incorporating that and fixing some other things in your VIs, (put some comments in) I was able to get it working for me.

 

One of the bigger errors was that in your data binding string, you gave it the protocol and the server, but forgot to put in what variable the graph is to be bound to.  Another is that you set the binding to read only, but that is the VI that needs to write to the datasocket server, so set it for read/write or write only.

 

Also, look at the little LED to the upper right of the graph on your front panel.  It will be either green or red.  If it is red and you hover over it, you will see an error message.  This will help show whether things are connecting properly on the writing side of the communication.

Download All
Message 8 of 8
(3,845 Views)