|
djkinney
|
 |
« on: May 23, 2010, 09: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
|
 |
« Reply #1 on: May 24, 2010, 01:39:20 PM » |
|
I responded to your other thread. http://www.palmerperformance.com/forum/index.php?topic=1827.msg7106;topicseen#msg7106There 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
|
 |
« Reply #2 on: May 25, 2010, 09: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
|
 |
« Reply #3 on: May 26, 2010, 03: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
|
 |
« Reply #4 on: May 29, 2010, 03: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
|
 |
« Reply #5 on: May 29, 2010, 03: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
|
 |
« Reply #6 on: May 29, 2010, 04: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
|
 |
« Reply #7 on: May 29, 2010, 05: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
|
 |
« Reply #8 on: May 29, 2010, 05:52:00 PM » |
|
I data log the scripts and they return zeros in the data logging screen and in the dashboard.
|
|
|
|
|
Logged
|
|
|
|
|
djkinney
|
 |
« Reply #9 on: May 29, 2010, 09: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
|
 |
« Reply #10 on: June 01, 2010, 11:18:38 AM » |
|
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, 12:15:30 PM by Weston@PPE »
|
Logged
|
|
|
|
|
Weston@PPE
|
 |
« Reply #11 on: June 01, 2010, 01: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
|
|
|
|
|