Hi,
Does anyone have any ideas on how to convert Fuel Level Percentage into a level, where the tank is shaped (boat tanks), that is a true capacity? It is given that there would be data available on the capacity at differant levels up the stick, in the form of a table i.e.
0% up stick = 0 liters
10% = 100 liters etc
Thanks
Simon
Shaped Fuel Tanks
- simonchurchill
- Posts: 18
- Joined: Sat Jul 30, 2011 8:10 am
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: Shaped Fuel Tanks
Hi simon,
The configuration in the topic below has a script that calculates fuel level percent from the raw analog value.
viewtopic.php?f=7&t=434
You can modify the script with your table to calculate fuel quantity from fuel level percent.
Regards,
ksaenz
The configuration in the topic below has a script that calculates fuel level percent from the raw analog value.
viewtopic.php?f=7&t=434
You can modify the script with your table to calculate fuel quantity from fuel level percent.
Code: Select all
// Fuel tank table
uint[][] fuel_tank = {
{ 0, 0},
{ 10, 100},
{ 20, 200},
{ 30, 300},
{ 40, 400},
{ 50, 500},
{ 60, 600},
{ 70, 700},
{ 80, 800},
{ 90, 900},
{ 100, 1000},
}; // percent, quantity
uint fuel_tank_points = 11;
ksaenz
- simonchurchill
- Posts: 18
- Joined: Sat Jul 30, 2011 8:10 am
Re: Shaped Fuel Tanks
Thanks for that Ksaenz,
Just like to fill in a bit more detail here.
The tank level data is coming from NMEA2000 senders.
I see in the previous question you gave a link to, that it was for an analoge sender, not sure if that makes any differance?
Once a script is writen how do you apply it to an input? I have 4 tank levels in total, all NMEA2000. I have four tank level incidences in the database and all brought into the enviroment setup. So I need to apply differant tables to each of these four tanks which are unfortunatly differant shapes.
Thanks again, new to this.
Simon
Just like to fill in a bit more detail here.
The tank level data is coming from NMEA2000 senders.
I see in the previous question you gave a link to, that it was for an analoge sender, not sure if that makes any differance?
Once a script is writen how do you apply it to an input? I have 4 tank levels in total, all NMEA2000. I have four tank level incidences in the database and all brought into the enviroment setup. So I need to apply differant tables to each of these four tanks which are unfortunatly differant shapes.
Thanks again, new to this.
Simon
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: Shaped Fuel Tanks
Look for the lines:
before the funcion calls:
You will replace the variable names inside the smGetHandle(); with the names of the variables you want to use as source and destination.
Regards,
ksaenz
Code: Select all
currentHandle = smGetHandle("variable name");
Code: Select all
smRead(currentHandle, localvariable_raw);
smWrite(currentHandle, localvariable_calculated);
Regards,
ksaenz
- simonchurchill
- Posts: 18
- Joined: Sat Jul 30, 2011 8:10 am
Re: Shaped Fuel Tanks
Thanks again Ksaenz,
I will try it out soon.
Thanks
Simon
I will try it out soon.
Thanks
Simon