LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp/ip communication with LabVIEW

Thanks it worked..

 

Now i will like to creat a user interface of a tank system in Labview.I have modelled the system in simulink.communication would be through TCP/IP,do you have any idea about how to build a user interface for this tank system in Labview.Thanks

 

Osowoaji

0 Kudos
Message 11 of 20
(1,738 Views)

Hi guys,sorry i am back again with the same question.I have attached two VIs(a server and client) for you to run and please tell me what is wrong.I dont seem to be getting the same Frequency or period on the server and client side.Dont know what seem to be the problem.The amplitue is okay as i can vary it on the server and see it change on the client but not the frequency.Your help will be appreciated.Thanks

 

Osowoaji

Download All
0 Kudos
Message 12 of 20
(1,717 Views)

Why would you expect to see the same frequency? On the server, the graph is using the timing information from the dynamic data type. You discard all of that when you convert to a 1D DBL and transmit that. Either send the dt information or just plot the DBL array in the server.

0 Kudos
Message 13 of 20
(1,714 Views)

Thanks Dennis.I dont really get you.My aim is to receive on the client side what i send from the server.I have connected on the client side from the type cast to a convert to dt and then convert from dt and finally data out but its still not giving me what i want.Please can you make the correction of what you saying on the VIs and attach it for me to see?Thanks

 

Osowoaji

0 Kudos
Message 14 of 20
(1,710 Views)

You create a sine wave as dynamic data. That includes timing information. The critical part of that is the dt value or the time between samples. That is why your graph on the server will accurately display te frequency you have chosen. The graph automatically uses that information to set the x axis spacing between points. When you convert from dynamic data to a DBL, you discard all of the timing information since a DBL array is just an array of y values. You are NOT converting to dt on the client side. You are converting to DBL. The graph on the client has nothing to use to set the x axis spacing so it defaults to an interval of 1. So, in order to send the correct information to the client, you would also have to send a packet containing the current dt value. If you convert to a waveform data type, you can extract both the y array and dt with the get waveform components function.

0 Kudos
Message 15 of 20
(1,708 Views)

Thanks again Dennis,i understand what you are saying now but just find it difficult implementing it.The vi's i am using are not connecting.I was wondering if you could add on the VIs i sent what you have explained so i can see it.Please is that possible?

 

Osowoaji

0 Kudos
Message 16 of 20
(1,705 Views)

Quite frankly, in order to come up with something robust, I would implement something like the Simple TCP/IP Messaging (STM) as described here. It is a bit more complex but you can send a command/parameter so that when you change the frequency, just that information is sent and the receiver can parse it out. Give it a look and try the example that comes with it.

 

Another option is Network Streams. These are functions included in LabVIEW and there are also examples that you can look at. 

0 Kudos
Message 17 of 20
(1,701 Views)

Cant seem to go to the link,say an unexpected error.Thanks though for the help.I will try to figure this out

0 Kudos
Message 18 of 20
(1,693 Views)

Sorry. I don't know how I mangled it. Try http://zone.ni.com/devzone/cda/tut/p/id/3098. But also review the network streams. That should have been my first recomendation but I've recently been using an older version of LabVIEW where the feature did not exist and I used STM so it was sort of on my mind.

0 Kudos
Message 19 of 20
(1,685 Views)

Okay thanks..i will take a look at it.Thanks again

0 Kudos
Message 20 of 20
(1,681 Views)