09-25-2019 02:05 AM - edited 09-25-2019 02:07 AM
I have attached a Vi .. In that iam trying to read 20 tdms files , each file containg 9 channels and each channel containing 96000 dbl datas. iam trying to read those in a vi and plot it in a xy graph. I got the desired output as i have a seperate control for changing the no. of channels to display.
But the problem is the vi gets too slow as i run it . iam unable to change any control. even after stopping the program i was unable to work anything. only after deleting the graph or clearing it iam able to do something. I heard that using Data value reference i can manage the memory.
Is there any ways to solve this using DRV ?
Solved! Go to Solution.
09-25-2019 06:20 AM
A DVR will not help any here. It is sounding like it is an issue with having all of the data on the XY graph. Maybe too many plots? Are the channels from the TDMS files the same? If so, you need to append data inside of the XY clusters, not on the array level. This would involve using a Shift Register and Build Array to add the channel data together and then building the XY bundle afterwards.
Give this a try and see what happens.
09-25-2019 11:14 PM
Thank you for the reply.. will surely give a try and get back to you.
So can you say me the exact use of DVRs ... if you have any program or docs which shows the exact usage of DVRs, kindly share it to me.I am much confused in this DVR concept.
09-26-2019 02:56 AM - edited 09-26-2019 03:10 AM
Clear the graph! As long as the vi stays in memory the graph will continue to have the old data (which is absolutely stale and taking up a LOT of memory) so when you create the a new set of X-Y arrays you need twice as much memory as the first run needed. The re-init to default method will release that old memory and keep the repeat runs working as well as the first run.
Duplicating the array of timestamps for each channel is also VERY expensive (128 bits per timestamp * 20 files * 9 Channels * 96000 readings) is at least 9 * 96000 -(9*(128 +64)) bits more than you need if the data points are evenly spaced (you are reading WAVEFORMS from the file) Try getting rid of the Time Logged data, you don't need it!
Try running the performance and memory profile tool on your code (Tools> Profile > Performance and memory) then try this vvvv
09-26-2019 05:08 AM
THANKS JAY !! WILL TRY IT OUT NOW , CAN YOU SAY ME THE EXACT USE OF DATA VALUE REFERENCES?, I AM PRETTY CONFUSED IN THAT.. WANT TO KNOW WHERE TO USE IT AND WHY !! HELP ME IN THIS PLS..
09-26-2019 05:26 AM
I JUST WANT TO KNOW HOW, WHERE AND WHY- WE USE DVR...!!
09-26-2019 06:32 AM
DVR's help manage memory by reducing the number of copys of a large set of data.
A DVR is used to store large sets of data that need to be accessed by multiple callers in a single application instance (Context) they are much like a Functional Global Variables or Single Element Queues with some additional options which can allow concurrent read only access or limiting the scope where the DVR may be created. DVRs ALLWAYS operate "In-Place" on the data (they reuse the same buffer for input and output) and make it somewhat more like a C type "pass-by ref."
09-26-2019 06:35 AM
First of all, no need to yell.
The general use of a DVR is when you need multiple parallel loops to access the same data/object by reference.
09-26-2019 06:43 AM
Hmm .. i am just looking for example ..a perfect one to demonstrate the usage if DVR.. i am even ready to develop the code myself , well , with the help of you people. Can u just give me synopsis or a situation where i will be forced to use the Data value reference. So that i can just go forward and do that code. Thank you in advnace .. Kudos !!
09-26-2019 08:00 AM
Install G# from VIPM and you'll have an excellent usage of DVRs. 🙂
/Y