LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Bleeding Over From Previous Runs

Solved!
Go to solution

Hello all.

 

I have built a program with the purpose of measuring the Seebeck coefficient of materials through thermocouples. I have made two different data files that i store information in. One is calculations based of of the acquired measurements, and the other is simply the raw data. Unfortunately, every couple of runs information from the previous run will "bleed over" into the data being written to the file. I have gone through and looked at my state machine and state registers, and I haven't been able to identify the problem. I was hoping somebody had an experience like this or is more astute than I am at finding faulty code. Thank you for your help!

 

I have attached the VI and an example of a data file with information "bleeding over." The information from the previous run is easily identifiable as it sticks out. It does not do this every run, but it is frequent enough that it is an annoyance. IN the attached file, bleeding happens in the 2nd, 3rd, and 4th run, but then the fifth comes out perfectly fine.

Download All
0 Kudos
Message 1 of 3
(2,234 Views)
Solution
Accepted by topic author gbaby

I can't open your code due to my older version of LabVIEW (2009), but make sure you initialize all shift registers with empty arrays or zeros.  That's the most common thing that I tend to mess up when I see behavior that you describe.

 

Shift registers maintain data information as long as the VI is in memory, so you could accidentally be adding to old information if it is not being overwritten or cleared.

 

Make sure you initialize all shift registers.  (Aka.  Wire a zero or other default value to the left hand side of the left most shift register).

 

For example, after each run of this VI, it will increase from 5, 10, 15, 20, ... etc:

 

uninitalized.png

It remembers the last output and increments it each time.

 

To fix this, wire a constant to it (such as zero):

 

initalized.png

 

This would properly print 5 each time.

 

A fast way to fix these is to right click on the left most shift register and click the option "create constant".  This will create a constant for the datatype in the shift register and automatically wire them together.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 2 of 3
(2,231 Views)

I checked your code and you has several uninitialized shift registers. Everytime you run the program, these shift registers are using the last value they held when you last ran your code. When you first run your code everything is fine because they are initialized for you. Your next runs will use values that are not inialized and that is why your data is "bleeding over". Wire constant values to initialize these shift registers (most likely zeros). 

Message 3 of 3
(2,222 Views)