LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program not discarding data from previous run

Solved!
Go to solution

Hi all,

 

I am having some problems with my program. The problem is that the program runs perfectly on the first run, creating an array of data that is received from the serial port and writes it to a spreadsheet. However when the program is run again without closing the window or changing anything in the block diagram, the new array is written to the spreadsheet along with the unwanted old one, this time in two columns.

 

If something in the block diagram is moved the program runs perfectly on the next run. Does anyone know why this data is getting stuck in mwemory somewhere and how to get rid of it without having to reopen the program each time??

 

Any help is welcome

 

0 Kudos
Message 1 of 10
(3,490 Views)

I assume that you are using uninitialized shiftregisters to collect your data in combination with "build array".

Solution: If you don't want to have old data in the shiftregister, you have to init it.

 

Note: this is desired behavior

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 10
(3,489 Views)

Or if you are using a waveform chart, you will need to clear the history.  Do this with a property node.

 clearing old data.png


Paul
0 Kudos
Message 3 of 10
(3,484 Views)
Here is the vi that i made. The data is read as a string
0 Kudos
Message 4 of 10
(3,481 Views)
Can you please post it in LV8.5 or earlier format, or as picture?
0 Kudos
Message 5 of 10
(3,477 Views)

In your case, you are using a feedback node which is similar to the shiftregister:

feedbacknode.PNG

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 10
(3,476 Views)
Solution
Accepted by topic author Jagwa

Wire the initialize input on the node.

initialize on first call.png


Paul
Message 7 of 10
(3,473 Views)

Can i Init a feedback node somehow?

0 Kudos
Message 8 of 10
(3,468 Views)

?  It is shown in the picture in my last post

Never Mind 😉

Message Edited by PJS on 11-18-2009 08:16 AM

Paul
Message 9 of 10
(3,463 Views)
thanks for all the help guys. works like a dream
0 Kudos
Message 10 of 10
(3,462 Views)