m1Gps
Posts: 67
Joined: Sat Dec 28, 2013 7:25 pm

Device mapper script for fuel level

Mon Mar 31, 2014 5:31 am

Hello,

I test this script, but no test output received, anyone could assist?

var formula =“5:4.6#400:355,4.6:0.4#355:44,0.4:0#44:0”;
var fuelRaw = fields.get(“CustomAnalog1”,null);
return nonLinear(formula,fuelRaw);

Already Mapped: analog input 1 to customAnalog1 and script output as Fuel level.

Thanks

Juan
Posts: 35
Joined: Fri Sep 20, 2013 7:19 pm

RE: Device mapper script for fuel level

Mon Mar 31, 2014 11:47 am

Hi,

Do you mean that you click the Test Script button and you don´t get a result? Make sure you are enabling the variable feeding the script (in your case CustomAnalog1) on the right menu. You should check the box next to it so the warning message "(no signal)" is not displayed anymore. Then write a test value for that variable so you should get an output when clicking the Test Script button.

Regards,
Juan

GpsGate Support

m1Gps
Posts: 67
Joined: Sat Dec 28, 2013 7:25 pm

RE: Device mapper script for fuel level

Mon Mar 31, 2014 5:51 pm

Hi Juan

Yes, the test Script did not show results. I had mapped analog1 to CustomAnalog1 in Device Mapper.

May I know where is the warning signal comes from because I did see any.

What value should I put on the test value box for non linear formula in the Script section (Is it refer to the right side of the Script section?)

Regards

grigor
Posts: 90
Joined: Mon May 14, 2012 6:41 pm
Location: Albania
Contact: Facebook Twitter Skype

RE: Device mapper script for fuel level

Mon Mar 31, 2014 6:00 pm

hello dear m1Gps,

you have some mistake at your mapping....

this will be right "5:4.6#400:355,4.5:0.4#355:44,0.3:0#44:0"

I also advise you to avoid the values #8203;#8203;because we have problems at reports

regards,
Grigor

grigor
Posts: 90
Joined: Mon May 14, 2012 6:41 pm
Location: Albania
Contact: Facebook Twitter Skype

RE: Device mapper script for fuel level

Mon Mar 31, 2014 6:04 pm

this is right

5:4.6#400:355,4.5:0.4#354:44,0.3:0#43:0

Juan
Posts: 35
Joined: Fri Sep 20, 2013 7:19 pm

RE: Device mapper script for fuel level

Mon Mar 31, 2014 6:25 pm

Hi,

Just wait for the test values to be loaded, and write any value you are using in your formula to check the output is in the right section

Regards,
Juan

GpsGate Support

m1Gps
Posts: 67
Joined: Sat Dec 28, 2013 7:25 pm

RE: Device mapper script for fuel level

Mon Mar 31, 2014 8:40 pm

Hi,

I had re-phased the script to the correct one and the waiting time for script testing remain very long. I wonder the device mapper has some kinds of error as mentioned by Support. Checking thru now.

Thanks

Juan
Posts: 35
Joined: Fri Sep 20, 2013 7:19 pm

RE: Device mapper script for fuel level

Tue Apr 01, 2014 12:06 pm

Hi,

It was a known bug fixed updating the plugin patch.v4 from the beta repository.

Regards,
Juan

GpsGate Support

grigor
Posts: 90
Joined: Mon May 14, 2012 6:41 pm
Location: Albania
Contact: Facebook Twitter Skype

RE: Device mapper script for fuel level

Wed May 28, 2014 2:20 am

hello dear Juan,

i had patch v4 versio 4.0.0.822 and i hade again the same problem when i go to analog and put a value it gives me back o liters fuel level
this is my mapping:

var formula = "0.46:1.01#1:30,1.02:1.55#31:60,1.56:2.09#61:90,2.1:2.6#91:120,2.61:3.14#121:150,3.15:3.68#151:180,3.69:4.02#181:203";
var fuelRaw = fields.get("CustomAnalog1",null);
return nonLinear(formula,fuelRaw);

regards,
Grigor

Originally posted by Juan

Hi,

It was a known bug fixed updating the plugin patch.v4 from the beta repository.

Regards,
Juan

GpsGate Support


Thanks and regards,
Grigor

User avatar
Henrik
GpsGate
Posts: 229
Joined: Thu Jul 26, 2007 8:41 pm
Location: Sweden
Contact: Website

RE: Device mapper script for fuel level

Wed May 28, 2014 11:48 am

Hi Grigor, your script works when I test it.

Please verify these steps:
1. Map the actual input signal to CustomAnalog1 (e.g. Analog1 -> CustomAnalog1)
2. Make sure that "Fuel Level" is NOT mapped to anything in the "3. Mappings" section in the Device mapper
3. Select "Fuel Level" as output for your script
4. Add the script in your post above

Regards,
Henrik

grigor
Posts: 90
Joined: Mon May 14, 2012 6:41 pm
Location: Albania
Contact: Facebook Twitter Skype

RE: Device mapper script for fuel level

Wed May 28, 2014 11:51 am

Hello dear,

thanks a lot for support, my problem was that i test it with "." not with "," that was the reason that script give me 0 value.

regards,
Grigor

Originally posted by Henrik

Hi Grigor, your script works when I test it.

Please verify these steps:
1. Map the actual input signal to CustomAnalog1 (e.g. Analog1 -> CustomAnalog1)
2. Make sure that "Fuel Level" is NOT mapped to anything in the "3. Mappings" section in the Device mapper
3. Select "Fuel Level" as output for your script
4. Add the script in your post above

Regards,
Henrik



Thanks and regards,
Grigor

agimex
Posts: 48
Joined: Sat Feb 23, 2013 7:44 am

RE: Device mapper script for fuel level

Sat Jun 07, 2014 8:21 am

Hi Grigor,

By observing you mapping variables I have the conclusions:
1. you have seven step accuracy( presume we're mapping
value:volume)
step 1 to 6 the volume increment each step are 30
step 6 to 7 the volume decrement last step is 23 with deviation 7 from 30
meanwhile the increment value mapper each step start from 0.46
step 1 => 0.55
step 2 ~ 3 => 0.53
step 4 => 0.5
step 5 ~ 6 => 0.53
step 7 => 0,33 ( my calculation result '0.406' for last step or
4.13=203 if value=4.02 then volume=197 in my computation)
by using the comparison with the volume or value decrement method)
2. my guess you have the gauges ouput voltage 0.46~4.02 ranges
3. my guess you have the object volume to be measured arround 1 to
203 liter ranges.

Please let me know how accurate the result you can achieved for above formula ??

Regards,

Gee

m1Gps
Posts: 67
Joined: Sat Dec 28, 2013 7:25 pm

RE: Device mapper script for fuel level

Sat Jun 07, 2014 2:35 pm

Hello,

I am so interested to find out the accuracy of the fuel measurement as posted by Gee.

In terms of accuracy, I always feel the best way is to measure the tank refill and discharge volume in comparison to the actual bill.

I had a customer use to discharge fuel from a track with fulled tank into a 100 liter drum, then drive the truck to a station 2km away and refill it back to full tank again. If the refill volume is near to 100+- 3 liter or 97%. Then It will be considered good and accepted by the customers.

Looking to know from all on other means of fuel accuracy measurement.

Regards

Return to “GpsGate for Developers”