Sign up for our newsletter! 
Home News Products Downloads Forum Distributors Store Contact Us
PPE User Forum
May 24, 2013, 07:58:38 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Syntax Error  (Read 5264 times)
0 Members and 1 Guest are viewing this topic.
346LSX
Newbie
*
Offline Offline

Posts: 16


View Profile
« on: November 29, 2010, 03:10:05 pm »

 I am trying to set up a couple of scripts  Commanded Lambda and Lambda error,  my goal is to
plot Lambda Error vs MAF hz in a data map. GM.ENGINE.AFR is the only pid i have to use I tried to
create a script that takes this commanded AFR /14.68  I ended up with a error message:

SCRIPT.COMMANDED_LAMBDA:EXCEPTION 71:Syntax Error:missing)after formal parameters

Here is the script:

function GetRequiredPids(GM.ENGINE.AFR)
{
Obdii.AddRequiredPid(GM.ENGINE.AFR);
}   
var EngineRPM = Obdii.GetPidValueEnglish(GM.ENGINE.AFR);
var CalculatedValue;

if (GM.ENGINE.AFR== null)
{
   CalculatedValue = 0;
}
else
{
   CalculatedValue = GM.ENGINE.AFR / 14.68;
}

Obdii.PidValue.English = CalculatedValue; LAMBDA;


All this java script is new to me anyone know where I went wrong?
Logged
Weston@PPE
Administrator
Hero Member
*****
Offline Offline

Posts: 1730


View Profile
« Reply #1 on: November 30, 2010, 02:32:45 pm »

Your script should look more like this:

function GetRequiredPids()
{
    Obdii.AddRequiredPid("GM.ENGINE.AFR");
}   
var AirFuelRatio = Obdii.GetPidValueEnglish("GM.ENGINE.AFR");
var CalculatedValue;

if (AirFuelRatio == null)
{
   CalculatedValue = 0;
}
else
{
   CalculatedValue = AirFuelRatio / 14.68;
}

Obdii.PidValue.English = CalculatedValue;
Obdii.PidValue.Metric = CalculatedValue;


When you reference a PID, like with the GetPidValueEnglish function, it should have quotes around it because its a string. You also can't put just a PID name in and treat it like a variable (you did if(GM.ENGINE.AFR == null)), you need to use GetPidValueEnglish to save that value to a variable (which I named AirFuelRatio). It also looks like you were trying to set the units to LAMBDA, which should be done using the input boxes at the top of the script editing window. If you have any other trouble we're always here to help.

Keep trying though, and let us know how it all works out. Wink
Logged
346LSX
Newbie
*
Offline Offline

Posts: 16


View Profile
« Reply #2 on: November 30, 2010, 05:31:55 pm »


  Thanks for the reply I have more to go on now.
 
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.093 seconds with 19 queries.
Home | News | Products | Downloads | Forum | Distributors | Store | Contact Us
Copyright © 2012 Palmer Performance Engineering, Inc. All Rights Reserved.