LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to slow down my program using DRV ?

Solved!
Go to solution

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 ?

0 Kudos
Message 1 of 32
(3,309 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 32
(3,240 Views)

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.

0 Kudos
Message 3 of 32
(3,200 Views)

Capture.PNG

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!

 

Spoiler
Capture.PNG

 

 

Try running the performance and memory profile tool on your code (Tools> Profile > Performance and memory) then try this   vvvv


"Should be" isn't "Is" -Jay
Message 4 of 32
(3,182 Views)

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..

0 Kudos
Message 5 of 32
(3,167 Views)

I JUST WANT TO KNOW HOW, WHERE AND WHY- WE USE DVR...!!

0 Kudos
Message 6 of 32
(3,158 Views)
Solution
Accepted by topic author Ramprakash0111

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." 


"Should be" isn't "Is" -Jay
Message 7 of 32
(3,148 Views)
Solution
Accepted by topic author Ramprakash0111

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 32
(3,146 Views)

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 !!

0 Kudos
Message 9 of 32
(3,135 Views)

Install G# from VIPM and you'll have an excellent usage of DVRs. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 32
(3,122 Views)