LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I discart the firsts sample readings of my NI and plot the rest in a graph

I have a NI and I get a N number of samples. But my first samples always start on 0 even thought they are not, I think it`s because of the lowpass filter. So I don`t want to use the first samples but I want to match the rest with a function (cosine for example). How do I discard these first samples?

0 Kudos
Message 1 of 22
(3,151 Views)

First samples, as in first time when you run the VI... If so, you may want to use 'First Call?' (it in 'Synchronization' palette).


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 22
(3,150 Views)

It is hard to figure out exactly what you mean.  Can you post what code you have so far?

 

If you just want to throw away your first read, I would use the i of the while/for loop and compare it to 0.  If it is 0, ignore it and go to the next iteration.  Otherwise you process it however you like.


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
0 Kudos
Message 3 of 22
(3,143 Views)

I tried to use first call? but it didn't work maybe I wrote the wrong code, and I  also  tried a case structure...
I need that the samples start matching the function at the 13th sample

0 Kudos
Message 4 of 22
(3,135 Views)

That code makes no sense. Why are you using a loop generating an array with 50 identical elements? I assume the "samples" are the pressure data. What is "the function" you mentioned?

What do you mean by "match"? Creating an xy graph does not match anything, but that's all you seem to do.

0 Kudos
Message 5 of 22
(3,128 Views)

Sorry, I just saw that I rewrote the code in the wrong way, here is the correct one.

Well, my loop is to generate 50 values for de cosine function.
And my samples come from the DAC ASSIST.

I want to match those values of the cosine function to the samples.

0 Kudos
Message 6 of 22
(3,124 Views)

You still have not explained what "match" means. Are you talking about fitting?

 

Since we don't have your hardware, we do not know what kind of data comes out of the DAQ assistant. You need to provide more detail. Can you replace it with a suitably configured "simulate signal express VI" , for example?

0 Kudos
Message 7 of 22
(3,121 Views)

Yes, I mean fitting.
My DAC is a NI USB-6218.

The data that is comming out is pressure in voltage (from a pressure transducer)


I understand that is hard to help, but thanks anyway, I`ll keep trying

0 Kudos
Message 8 of 22
(3,117 Views)

Does the data look anything like a cosine function?

 

We don't really care about the hardware. More important is how the data looks like. In order to fit it, you need adjustable parameters (e.g. In the case of a general cosine, you need e.g. amplitude, frequency, phase) to be adjusted iteratively until it best matches the data.

0 Kudos
Message 9 of 22
(3,108 Views)
The data looks sinusoidal, but because of the filter it stars from 0 and goes up and then after 0.1s the siusoidal behavior starts
0 Kudos
Message 10 of 22
(3,100 Views)