03-08-2012 01:23 PM
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
03-15-2012 09:55 AM
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
03-15-2012 10:21 AM
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.
03-15-2012 11:02 AM
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
03-15-2012 11:33 AM
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.
03-15-2012 12:06 PM
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
03-15-2012 12:47 PM - edited 03-15-2012 12:51 PM
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.
03-15-2012 01:17 PM
Cant seem to go to the link,say an unexpected error.Thanks though for the help.I will try to figure this out
03-15-2012 02:16 PM
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.
03-15-2012 02:20 PM
Okay thanks..i will take a look at it.Thanks again