LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not saving the right waveform data

I am using LabVIEW with USB 6216 with 16 inputs, 16 bits and 400ks/s. I am having problem while saving the data from the force sensor. I can see the right waveform graph where the value rises from 0 to 5 when force is applied. I also confirmed the graph with oscilloscope.When saving the data those right values as seen in waveform aren't saved. The saved values are somewhere around "0.00xxx" for 2500 data points collected. I cannot see any values between 0 to 5 even though force was applied within the time frame of 10 sec. I guess its only reading data from last moment. I am not sure about it though. The problem is only seen with waveform index 1,2 ,3 and 4   but not with waveform index 5.

 

File is attached below

0 Kudos
Message 1 of 3
(2,374 Views)

Your VI is way too large... I suggest you look into making it small enough to fit on one monitor without scrolling.  Try to make the error wire flat, too... it's insane the way it goes every which way.

 

Also, it's generally best if you can post a VI, instead of just a picture.

 

However, a quick look at your VI shows that in your big While loop charts 3 through 5 go through shift registers many times, but always with new values, never with old ones. So when it finally exits, you just get the last value and no more.

 

It's hard to tell but I think each loop is 1/40th of a second, so the values you see are just the last 1/40th of a second of data, which is random noise if all the real measurements happened earlier.

 

I think the problem is that you're seeing the data on the charts and assuming that means it's there.  A "chart" has internal memory, where every result is appended to earlier results, then displayed.  So you see all the historical data, but it's not actually there.  If you were to use a "graph" instead, you would see that the actual data set is quite small that's actually being saved.  

0 Kudos
Message 2 of 3
(2,365 Views)

You are duplicating a lot of code. The display of the waveforms could be handled in a for loop, or all on the same chart. The file writing could also be handled in a for loop or all in a single file. I would try to re-write it first with a single write file function, that way when you find the bug you only have to fix it once instead of 5 times. 

 

Also, it takes about 9 of my 1920 x 1080 pixel monitors to view your VI, you should wrap some code into subVIs to make it more compact and readable.

0 Kudos
Message 3 of 3
(2,354 Views)