LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Array Retaining Memory Between Executions

Solved!
Go to solution

Hey everyone,

 

I'm fairly new to LabVIEW and attempting to design an executable to read measurements from an digital multimeter that takes measurements and builds them into an array that then transfers to an Excel document.

 

I've gotten the DMM up and running, I've gotten it to write to the file, but if I execute multiple times it tries to build the file using past results and the current test results.

 

How can I empty the system memory so that it starts fresh every time?

 

Right now I am using a loop which refreshes the digital measurements and uses buildarrays in order to compile all the results (shift registers to pull the arrays through). At the end of the code (stop button) they transfer to be compiled into tables.

0 Kudos
Message 1 of 7
(3,384 Views)

Do you have an uninitialized shift register?  If so, that is where your data is being retained.  You could just initialize it with an empty array.


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 7
(3,377 Views)

I think they are currently being initialized by the build array function. How would I go about initializing it on each execution with an empty array instead?

 

Hopefully I've attached the instrument to this post (so if I'm stating something wrong in the post it'll be in there). Thank you for the help!

0 Kudos
Message 3 of 7
(3,347 Views)
Solution
Accepted by topic author AnthonyMN

Hi anthony,

 

I attached the VI to fix the shift register issue.  When you run a vi with shift registers the register will stay in memory until you close it.  So when you run your first iteration it will start from default, then stop.  When you restart this without closing it the shift register will mantain the values from the previous run.  So simply at a constant outside the loop so you reinitialize the register every run.



-Matt
Message 4 of 7
(3,332 Views)
Solution
Accepted by topic author AnthonyMN
-In the left side of your shift register if you don't initialize then it will use data from previous runs.
-To avoid that you can simply right click on the left side shift register and create constant.
-Get started with LabVIEW basics http://www.ni.com/getting-started/labview-basics/shift-registers
Thanks
uday
Message 5 of 7
(3,324 Views)

I marked the wrong one as a solution first but wow thank you for helping! Works perfectly and it's great to see that for the future! (Also it looks so much nicer now thank you)

0 Kudos
Message 6 of 7
(3,322 Views)
Click on Options and you can mark Not the solution.
-To clean up diagram you can use Ctrl+U
Thanks
uday
Message 7 of 7
(3,313 Views)