Sign up for our newsletter! 
Home News Products Downloads Forum Distributors Store Contact Us
PPE User Forum
December 12, 2017, 04:46:28 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Range or Distance Remaining Script  (Read 73878 times)
0 Members and 1 Guest are viewing this topic.
djkinney
Newbie
*
Offline Offline

Posts: 26


View Profile
« on: May 23, 2010, 10:08:42 pm »

I'm looking for a way of calculating...based on the scripts that are available, I think...the "range". I feel like I have all the data needed in scripts I already have. These include distance traveled, fuel consumption, and MPG. But how do I create a script that is "miles left before terminal failure" AKA "run out of gas"?

Thanks,

DJ
Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 2234


View Profile
« Reply #1 on: May 24, 2010, 02:39:20 pm »

I responded to your other thread.
http://www.palmerperformance.com/forum/index.php?topic=1827.msg7106;topicseen#msg7106

There is a way to do this, but the SAE.FLI PID would need to be supported.

The script would be something like this:
var FuelRemaining = Obdii.GetPidValueEnglish("SAE.FLI");
var MaxFuel = 18.5; // Size of Tank (Gallons)

var GallonsRemaining = (FuelRemaining / 100) * MaxFuel;

Obdii.PidValue.English = GallonsRemaining * Obdii.GetPidValueEnglish("SCRIPT.FUEL_ACTUAL");
Obdii.PidValue.Metric = GallonsRemaining * Obdii.GetPidValueEnglish("SCRIPT.FUEL_ACTUAL");
Logged
djkinney
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #2 on: May 25, 2010, 10:25:59 pm »

I assume I cannot just cut-n'-paste this into the script editor. What needs to be changed? I don't know the script syntax!
Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 2234


View Profile
« Reply #3 on: May 26, 2010, 04:14:50 pm »

The entire script would be:


function GetRequiredPids()
{
    Obdii.AddRequiredPid("SAE.FLI");
    Obdii.AddRequiredPid("SCRIPT.FUEL_ACTUAL");
}

var FuelRemaining = Obdii.GetPidValueEnglish("SAE.FLI");
var MaxFuel = 18.5; // Size of Tank (Gallons)

var GallonsRemaining = (FuelRemaining / 100) * MaxFuel;

Obdii.PidValue.English = GallonsRemaining * Obdii.GetPidValueEnglish("SCRIPT.FUEL_ACTUAL");
Obdii.PidValue.Metric = GallonsRemaining * Obdii.GetPidValueEnglish("SCRIPT.FUEL_ACTUAL");


You would need to change the 18.5 to be the size of your tank (That's the size for my Explorer Sport). After that, it should work. Let me know if it doesn't, since I haven't tested it.
Logged
djkinney
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #4 on: May 29, 2010, 04:00:52 pm »

Well, bad news. None of the scripts that you've given me work. Now... there could be many reasons for this.

1) I used the mpg script which comes with scanxl and it worked. So I know how to code in the scripts. But when I have tried to use any of the scripts I've gotten through these threads, the effort results in no data whatsoever.

2) I made my own dashboard, and could blame it on that, but half of the dashboard works. Speed, RPM, and even the old MPG script which doesn't average...they work. But on the right side it's all of the other scripts and they don't.

3) I think it may have to do with data logging.

Clueless on this one.

Frankly, I just wish the community was producing more material so that I wouldn't have to program all of this myself and learn a whole new set of skills!

Doesn't anyone want to create a fuel/range/efficiency-based dashboard?

DJ



Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 2234


View Profile
« Reply #5 on: May 29, 2010, 04:18:34 pm »

My scripts would require that you are data logging, you can't just be monitoring. We are going to release a new version of DashCommand very soon, that will include a large number of scripts that do things just like this. It will also come with a very nice default skin set. I'm not sure if you are using DashCommand or ScanXL, but from your post it sounded like DashCommand.

If I have some free time I could work on a skin set for fuel economy. You can also look on DashXL.net for some other skins.
Logged
djkinney
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #6 on: May 29, 2010, 05:52:46 pm »

I think I've turned on data logging for the pids required, but still nothing. maybe I am not logging the right ones. Do I need to be logging the scripts, too?
Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 2234


View Profile
« Reply #7 on: May 29, 2010, 06:10:02 pm »

In PCMSCAN/ScanXL you need to have them selected in the PID Config, and be recording (not monitoring). In DashCommand you should be able to just start datalogging and they should work.
Logged
djkinney
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #8 on: May 29, 2010, 06:52:00 pm »

I data log the scripts and they return zeros in the data logging screen and in the dashboard.
Logged
djkinney
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #9 on: May 29, 2010, 10:45:57 pm »

UPDATE:   O.K. So it's working now. Range, gas mileage, and consumption. BUT it is definitely not smooth. It was data logging. I went in and made sure that the correct pids were being logged. They were. I went back and suddenly it was working. Great!

I exited, continued to drive, started up DashCommand again and it was all zeros. Went into Data Logging, exit, back to the dashboard, and it worked. It was as if they only recognize logged data if I go into data logging first.

And I can't just hit "Start Logging"...I have to exit, go to the data logging option with the page of data points, then out, then back to dashboards.

It's not how it's supposed to be, but I don't know why it's being difficult.

DJ
Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 2234


View Profile
« Reply #10 on: June 01, 2010, 12:18:38 pm »

That's strange, I haven't heard of this problem before. What version of DashCommand are you running?

If we can't get it to work out, I can write the scripts so that they don't need data logging.

We are also going to release a new version of DashCommand that includes a large number of scripts that do things just like this.
« Last Edit: June 01, 2010, 01:15:30 pm by Weston@PPE » Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 2234


View Profile
« Reply #11 on: June 01, 2010, 02:59:32 pm »

We just released a new version of our software that includes a large number of calculated PIDs (CALC.*). I would update and try using those.
Logged
maddmaxx
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #12 on: September 06, 2012, 08:12:38 pm »

Here's another way of calculating distance to empty using Script file.


* SCRIPT.DTE.psf (0.71 KB - downloaded 477 times.)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.08 seconds with 20 queries.
Home | News | Products | Downloads | Forum | Distributors | Store | Contact Us
Copyright © 2013 Palmer Performance Engineering, Inc. All Rights Reserved.