Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract the first 100 measuring points?

Hello
I have a DMS signal. Unfortunatelly, the signal don't starts allways at zero. So I need to have an automaticlly zero setting function.
I tried it with a mean-function. I took 100points and then the average of them. Now, that works good. But I only want the first 100points of the measurement and not the average of every 100 points. Does anybody have an idea to create a function like this. I heard that a state machine is a possibility, but I've never handled with a state machine.
 
Thankful for inputs
 
Regards
schleuni
0 Kudos
Message 1 of 8
(3,885 Views)
Hi Schleuni,

What you receive in your programm is an array of the acquired values, right?

You can extract the 100 first values with an Array Subset vi that you can find in the array palette...

Let me know if I can help you more.

I will be good to post a picture or the VI that you use, this way I can really see what you are doing.

Regards..

Matthieu
0 Kudos
Message 2 of 8
(3,869 Views)
Thanks for the answer
I tried it with an Array Subset yes. But it don't works. Do I have a problem with my while-loop, perhaps?  Delets my loop the points in the array subset after every 100 points?
With my programm (attached), I recieve the mean not only for the first 100 points. I get the mean for the whole points.
Somewhere is a Bug I think or is it not possible to get the first 100 points of a measurement? I don't think so.
 
Furthermore there is a problem with my mathscript. I read some advises in the forum and in the knowledge base. I saw that polyfit can't handle with a while loop. But I need a loop to get my points. So is  that really an unsolved mathscript-problem?
 
Regards
 
0 Kudos
Message 3 of 8
(3,866 Views)
 Hi Schleuni,

Before your mean function you have an 100 Values array, isn't it?

You cannot make a meaning and receive an 100 values array...!!! it does not make sense...

Let me know what I can do to help you and please explain with more details what you want to do...perhaps it will be a good idea to post an example VI.

Regards...

Matthieu

0 Kudos
Message 4 of 8
(3,860 Views)
I have a 100 values array before my mean function because I want to get the mean of the first 100 points of my measurement. So, I wanna take the first 100 points because of the zerodrift. If I can take the first points, I can subtract the mean ot the first points from the followed points. That's the idea. At the moment I can't post the VI. I try to do that later.
0 Kudos
Message 5 of 8
(3,857 Views)
Now here is the VI. In the Front Panel you can see, that the mean allways changes. How do I change that? Deleting the while loop didn't worked good.
0 Kudos
Message 6 of 8
(3,855 Views)
Hi Schleuni,

Now I see what you wanted to do.

In the attached VI I put only one acquisition and deleted the others.

With the function you "First Call" you will  take only the meaning of the 100 first sample.

I hope this help.

Regards..

Matthieu
0 Kudos
Message 7 of 8
(3,850 Views)

Great, thank you.

Your Input helped a lot. I searched so long and it's such a simple solution. Better late than not 😉

Thanks

Best regards

Schleuni

0 Kudos
Message 8 of 8
(3,845 Views)