restart values

Carlos Polvorinos

Posted on 28.11.2024 10:02

Hello,

Please see the attached images for better comprension. I am working with a Latch value math (DATOS) so that every time I press a button on the screen (MEDIDA), it captures the value of the variable ROTATIVO_PULSOS. The number of button presses is stored in a variable NUMprev MEASURES using the prev parameter, asynchronously to the LATCH.

Every 5 button presses, I want to calculate the average and standard deviation of the recorded values. I am currently doing this using Basic Statistics with the average and standard deviation functions.

My question is: is there a way to reset "the measurement" when pressing another button on the screen? Specifically, I would like the latch to reset, the button press counter to reset, and the calculation of the average and standard deviation to start over. Essentially, it would be like starting a new measurement from the beginning but without having to press start/stop.

Additionally, I want to plot the average for each point (I am doing this with a 2D graph), and I would like the graph to reset as well.


Thanks



.




Gregor Šmit

Posted on 28.11.2024 12:44

Dear Carlos,


in the attachment is a setup file where a time channel is reset when pressed on a button. If you have basic statistics set to calculate average on 5 samples than the last 5 samples is taken for the calculation and no reset is needed.


I do not quite understand the part about the average of one point and 2D graph. When plotting the data the values are displayed on the graphs. Would you please be so kind and explain the workflow in more detail or provide an image of what you would like to achieve.


Kind regards.


Attached files:
Carlos Polvorinos

Posted on 28.11.2024 17:25

Dear @Gregor Šmit,


The idea is, when I press the blue button MEDIDA, it takes the DATA M2/R value, and every 5 samples it does the mean and standard deviation, which is shown in the table on the right (with to the time) and also the graph. In the graph the white line is the mean and the red lines are mean +/- 3 standard deviation. When another 5 pulses are made, the same thing is done, calculate the mean and standard deviation of the last 5 values and show it in the table and in the graph, as "point 2 of measurement". This is done with LATCH and Basic Stadistics. This is already developed and is shown in the image below. 


What I would like to have is that when the green ‘BORRAR DATOS’ button is pressed, all the displayed values are deleted (table and graph get empty). And when the blue MEDIDA button is pressed 5 times again, the mean and variance are calculated and displayed as if the value was the "first point taken". This green button would be like a kind of restart but without stopping the program and restarting it (mainly because in other screens there are other calculated variables that cannot be deleted). 


I hope i have explain better.


Kind regards

Gregor Šmit

Posted on 03.12.2024 09:15

Dear Carlos,


the displays are always showing the last values and can not be reset i.e. clear the screen. What you could do is display the last value in the table and a counter of points, so that you know when you have pressed 5 times.


Kind regards.

Login to reply to this topic. If you don't have account yet, you can signup for free account .