Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Storing a variable

Pages: [1]
Author Topic: Storing a variable
rsfjr87
Member
Posts: 18
Post Storing a variable
on: September 1, 2017 (GMT)

Hello all,

I was searching through the forum and couldn’t find anything about an issue that I am having with setting a custom PID equation.

How do I store a value in a variable?

For example each trip the fuel used is 5 liters, but whenever I reset the trip counter, the value is reset to 0.

I have tried creating a custom PID, where the equation is
Val{customPID} = Val{customPID} + [FF1271]
And it returns a sintax error
I have tried several other ways, like creating an intermediate PID, etc. But nothing works.

Is there anything that can be done?

Thanks

F-150Torqued
Member
Posts: 437
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Check this thread out where @Capp777 helped me work out the identical situation

https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=6110.0

———–

54371019

Capp777
Member
Posts: 2993
Post Re: Storing a variable
on: September 1, 2017 (GMT)

This thread should help…

https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=6110.0

but you won’t be able to store values between Torque app
sessions.

You might consider creating your own totalizers.

F-150Torqued
Member
Posts: 437
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Hi Capp777

Your response wasn’t there when I pressed “REPLY”. Our timing is perfect!

Have a great day.
F-150Torqued

——————–

54371019

rsfjr87
Member
Posts: 18
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Thanks all.

The counter keeps reseting, after the trip counter has been reset.

So I assume that even not closing the app, whenever the trip counter is reset the app considers it a new session?

rsfjr87
Member
Posts: 18
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Quote from Capp777 on September 1, 2017
This thread should help…

https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=6110.0

but you won’t be able to store values between Torque app
sessions.

You might consider creating your own totalizers.

By my own totalizers you mean a pen and notebook?

Capp777
Member
Posts: 2993
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Totalized Fuel Rate

Equation: tot(3600:[5e])

Edited due to [5e] base units are
L/hr.

rsfjr87
Member
Posts: 18
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Ok.

As far I understand by reading the documentation, it is going to calculate the difference of [5a] each 60s.

But I didn’t get what it really does.

Thanks

Capp777
Member
Posts: 2993
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Try making a test pid using constants
and graph its results to get a feel for
how it works. tot(3600:600) should
totalize to 600 over an hour period or
10 over a minute. In your case it will
give fuel used.

Please note edits above due to [5e] base units
are L/hr (not per minute).

Note you will have to keep display on screen
or add to logging to keep value current. The
values are updated every loop and will try to
catch up when switching back to display.
The catch up would work okay for a constant
value like 600 but would miss readings for a
changing reading when off scteen without
active data logging of the pid.

Long press on the virtual pid display to
RESET (min/max) total as needed.

Sorry, its been awhile since I have worked
with these functions.

Pid1= tot(3600:[5e]) -> Liters
Pid2= tot(3600:[0d]) -> Km
Pid3= Val{Pid2}/Val{Pid1} -> Km/L
Pid4= tot(3600:[0d])/tot(3600:[5e]) ->Km/L

I’m curious if Pid4 would reset both totalizers
at the same time?

Edited.

rsfjr87
Member
Posts: 18
Post Re: Storing a variable
on: September 1, 2017 (GMT)

Got that! Thanks.

Gonna use fuel flow then.

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.036 seconds.

  Follow me on twitter