"IF" formula, what is wrong ?

Xavier
Posts: 60
Joined: Sat Nov 07, 2009 8:14 pm

"IF" formula, what is wrong ?

Postby Xavier » Sun Feb 06, 2011 8:54 pm

I'm trying to define some user custom value using this conditional formula:

IF(VAR_0203=0,VAR_0202,(VAR_0202+VAR_0203)/2)

but I'm getting an 'syntax error expression' alert. I've tried too to define some simple IF formula, like IF(VAR_0001=0,VAR_0002,VAR_003) but I always receive the same alert.

What am I writting wrong ?

Xavier
Posts: 60
Joined: Sat Nov 07, 2009 8:14 pm

Postby Xavier » Sun Feb 06, 2011 9:06 pm

I reply myself: I should have used semi-colons, not commas...

Regards.

osborni
Posts: 497
Joined: Fri Dec 07, 2007 9:08 pm
Location: USA, Michigan

Postby osborni » Mon Feb 07, 2011 2:56 pm

Yours:

IF(VAR_0203=0,VAR_0202,(VAR_0202+VAR_0203)/2)

What I think is missing:

IF(VAR_0203=0,VAR_0202,((VAR_0202+VAR_0203)/2))

Double check that the variables have data in them, but I'm not sure if no data will give you that error, or an error at all.
BMW 2000 M Coupe

Xavier
Posts: 60
Joined: Sat Nov 07, 2009 8:14 pm

Postby Xavier » Mon Feb 07, 2011 6:50 pm

osborni wrote:Yours:

IF(VAR_0203=0,VAR_0202,(VAR_0202+VAR_0203)/2)

What I think is missing:

IF(VAR_0203=0,VAR_0202,((VAR_0202+VAR_0203)/2))

Double check that the variables have data in them, but I'm not sure if no data will give you that error, or an error at all.


Thanks for the help, osborni, but same error alert using yours, I'm sure that this is related with the use of commas, don't ask me why...but if I place semi-colons there, I get the correct result.

I explain a little more about this: I've two DL1 installed on two different cars, one of them with two brake pressure sensors, the other one with only one. In order to get some similar brake data between both systems, I've configured a custom variable called "GlobalPressure" that uses this formula, so I can see the average pressure for the car that has two sensors, and only the front pressure for the other.

Best regards.

osborni
Posts: 497
Joined: Fri Dec 07, 2007 9:08 pm
Location: USA, Michigan

Postby osborni » Wed Feb 09, 2011 6:02 pm

hmmmm. I just looked at an if>then formula that I use.

if(VAR_0010>2000,VAR_0216,0)

It just cuts off oil pressure when rpm is below 2,000 rpm.

In your case, assuming that the cars are in the same class and are layed out the same (motor location, drive wheels, etc.) then the brake pressure that really matters is the front. If you are looking at driver inputs, then I'd just look at the front. IMHO, the only reason to look at the rear brakes is if there is an issue with sticking pedals or problems trail braking. Brake balance is better addressed with temperature paint on the rotors or threshold gee levels and driver feedback.
BMW 2000 M Coupe

Xavier
Posts: 60
Joined: Sat Nov 07, 2009 8:14 pm

Postby Xavier » Wed Feb 09, 2011 10:13 pm

Is not the case, these two cars are very different animals: my GT3 RS with a lot of electronic stuff and my two sons' Porsche 944 S2 without a mere ABS.

And about the commas or semmi-colons question, I've taken a look at regional settings of my comptuter and I've discovered that list separator character is "," in english, but ";" in spanish. This explains what happened.

Thanks, anyway :wink:


osborni wrote:hmmmm. I just looked at an if>then formula that I use.

if(VAR_0010>2000,VAR_0216,0)

It just cuts off oil pressure when rpm is below 2,000 rpm.

In your case, assuming that the cars are in the same class and are layed out the same (motor location, drive wheels, etc.) then the brake pressure that really matters is the front. If you are looking at driver inputs, then I'd just look at the front. IMHO, the only reason to look at the rear brakes is if there is an issue with sticking pedals or problems trail braking. Brake balance is better addressed with temperature paint on the rotors or threshold gee levels and driver feedback.

osborni
Posts: 497
Joined: Fri Dec 07, 2007 9:08 pm
Location: USA, Michigan

Postby osborni » Thu Feb 10, 2011 1:33 am

Lol yeah regional settings will do that to you.
BMW 2000 M Coupe

Support

Postby Support » Fri Feb 11, 2011 8:30 am

Regional settings can be a pain. With the European settings the , can't be used a list separator as it is used as the decimal point. Which would give huge confusion with a command like this in English:

if (VAR_0010>2.3,VAR_0216,0)

becomes:

if (VAR_0010>2,3,VAR_0216,0)

Hence the requirement to change the list separator.

Martin


Return to “General support questions”

Who is online

Users browsing this forum: No registered users and 276 guests