Shaped Fuel Tanks

Discuss issues and ideas you have to configuring displays with PowerVision
simonchurchill
Posts: 18
Joined: Sat Jul 30, 2011 8:10 am

Shaped Fuel Tanks

Post by simonchurchill » Mon Oct 10, 2011 12:44 pm

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
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: Shaped Fuel Tanks

Post by ksaenz » Mon Oct 10, 2011 3:09 pm

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.

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;
Regards,

ksaenz
simonchurchill
Posts: 18
Joined: Sat Jul 30, 2011 8:10 am

Re: Shaped Fuel Tanks

Post by simonchurchill » Mon Oct 10, 2011 4:15 pm

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
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: Shaped Fuel Tanks

Post by ksaenz » Tue Oct 11, 2011 8:13 am

Look for the lines:

Code: Select all

currentHandle = smGetHandle("variable name");
before the funcion calls:

Code: Select all

smRead(currentHandle, localvariable_raw);

smWrite(currentHandle, localvariable_calculated);
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
simonchurchill
Posts: 18
Joined: Sat Jul 30, 2011 8:10 am

Re: Shaped Fuel Tanks

Post by simonchurchill » Tue Oct 11, 2011 2:18 pm

Thanks again Ksaenz,

I will try it out soon.

Thanks

Simon