02-29-2024 08:01 AM
Hello,
I would like to reset my Graph andnot everything is working properly. The problem is when resetting my Graph on button press the angle is not resetting correctly.
Before Reset
After Reset
When the Torque falls under 0 the Measurement is stoppping because i just want to print this part of the measurement. When starting the measurement manually again before resetting the Graph, the measurement makes a jump to a higher angle which is undertandable because i stopped the measurement but the counter got the newest value and gives it out as soon as the measurement starts again. When i then reset the Graph it is working and the Angle is resetted properly to 0. But when i just hit the reset button the measuremnt jumps from 0 to the difference of the last measured value and the reset Value.
Meausement
Jump of angle after MANUALLY pressing the Start meausurement button.
Reset is working because the measurement was activated before resetting.
This is my abord criterion which is perfect for my use. The measurement needs to be stopped because i dont want many data after the torque goes to 0.
So heres my question: Any idea how i can reset the graph such that the measurement is starting first again and after the jump of the angle the reset is done? I dont know if its understandable what i want to achieve.
Thanks in advance
02-29-2024 08:04 AM
My thought was, that the programm would need to do one iteration without resetting but measuring again so that the actual value of the angle is the rest value. After that reset the graph...
02-29-2024 08:04 AM - edited 02-29-2024 08:06 AM
I tried some things with sequences etc. but it didnt work. I attached the programm.
02-29-2024 08:40 AM
I tried it like this now and it seems to work. I owuld be interested to see any other solutions which would be better.
02-29-2024 10:35 AM
@Julsbng wrote:
Hello,
I would like to reset my Graph andnot everything is working properly. The problem is when resetting my Graph on button press the angle is not resetting correctly.
This seems to be a continuation of this old story and I am not sure why you are starting a new thread.
Why would you have a greedy secondary loop (bottom) that spins millions of times per second just burning the CPU. If something is not working correctly, you need to define exactly what "correctly" means in your specific case.
You are apparently bouncing the angle value around via a shift register as well as a local variable with a hidden indicator, That's like herding cats! Is it correct that some of your shift registers are not initialized?
You need exactly one loop and a simple state machine architecture!!!