Arnaud
Hi,

Has anyone already made a function to record the minimum and maximum of a temperature for example and to be able to erase it with a button.
 
Thanks
Reply 0 0
RvMorrow1
Hi Arnaud,
I normally use something like the following.
 
REGISTER @A1;
REGISTER @A2;.
 
@A2 = (CHOOSE( ([Switch 1] & 1)> @A1 , 0, @A2));         // DETECT RESET SWITCH BUTTON PRESS AND SET TO 0
@A2 = (choose([COOLANT_TEMP]>@A2,[COOLANT_TEMP],@A2));     //IF COOLANT TEMP > CURRENT VALUE THEN SAVE COOLANT TEMP
 
@A1 = ([Switch 1] & 1);                     // RISING EDGE DETECTION OF SWITCH
 
@A2                 // OUTPUT VALUE OF REGISTER @A2
 
 
Hope this helps!
Rob
Reply 1 0
littleozfella
Hi Rob.
            converted to Toolset version (using my available channel names) for Arnaud..  I think this should work??
 
a2 (Choose(([Min_Max_Clear] & 1)> @a1 , 0, @a2));
a2 (Choose([tECT]>@a2,[tECT],@a2));
a1 ([Min_Max_Clear] & 1);

@a2
 
tECT is coolant temp, Min_Max_Clear is my button.  Rob, instead of writing 100 maths channels, one for each min or max can you show how to add another channel to this maths. I think I know how to do it but no time to figure it out.
 
cheers
Reply 0 0
Arnaud
Hi,
I have an error on line 2 but I don't understand why.
Thanks
[178729%2F9037150%2Fmceclip0]
Reply 0 0
littleozfella
you don't have ; a the end of line 1, 2 and 3.  Copy and paste my maths from the above message and just change the channels.
Reply 1 0
RvMorrow1
Thanks for converting! I was stuck in Toolbox mode!!
 
For finding the max across two channels would just add a second line as a reference of register a2 (Shown in bold)
 
a2 (Choose(([Min_Max_Clear] & 1)> @a1 , 0, @a2));
a2 (Choose([tECT]>@a2,[tECT],@a2));
a2 (Choose([tECT_2]>@a2,[tECT_2],@a2));
a1 ([Min_Max_Clear] & 1);

@a2
 
This will latch the max value of tECT and tECT_2.
Thanks,
Rob
Reply 0 0
Reply