Rigglejl

File Search, Values in file above 0 move to fifo and do average

1 post in this topic

Hello, I am having a time with the following task. I have a scanner that is scanning 120" range. For the values I have setup an array of 200. I have divided the 200 into sections of 10 ( 20 sections of 10 data points). My goal is to take the data from the array sections 0 - 9, 10-19, 20-29, etc. In each of the array sections, I only want to average the values that are greater than 0. I am having trouble figuring out the best solution. I have some pictures of what I have done. I want to keep this as clean as I can so I know that I will have to rename and redo this program, but for now I am only testing.

 

The end goal will be once I trigger :

-Section avg

-SectionAvgValue

-TimeStamp

-PartNumber

 

The next task will be exporting this information to an excel spread sheet with a nice format, so if you guys can help me with the programming I am sure you can help me with this task as well. Thank you in advance for any help!!

Surely someone has done something simpler and cleaner than this. Please advise me!! I would like to learn how to set this up and how to be able to use this data with excel in the future.

The picture with scanner2_Math is how I would prefer the program to look if possible.. The others are capable of making this happen but it is extremely long and hard to keep up with.

 

The last picture is an example of the sections I am referring to, it is only showing about 6 sections, the one with the value 55 has 10 arrays in it (ex Head1_mom_Array[0]-[9])
 

Scanner2_Current Averages setup1.PNG

Scanner2_Current Averages setup2.PNG

Scanner2_Current Averages setup3.PNG

Scanner2_Current Averages setup4.PNG

Scanner2_Math.PNG

Scanner2_Real_Values.PNG

Scanner2_UDT and Timestamp Tag.PNG

 

Scanner2_Measurements_on_HMI_SE_AND_ME.PNG

Edited by Rigglejl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now