Pages: [1]
Author Topic: IF-THEN  (Read 6961 times)
masterj
Hero Member
*****

Karma: +62/-5
Offline Offline

Posts: 1049



WWW
« on: June 29, 2012, 06:16:12 AM »

Hello Smiley
Quick question here: What happens if before "if-else" condition comes FALSE (0) (please look at the attached image)? If it were TRUE then mslcorr_w variable would get value of 1, but if there's FALSE condition what happens then with this variable?
Logged

RaraK
Hero Member
*****

Karma: +58/-2
Offline Offline

Posts: 539


« Reply #1 on: June 29, 2012, 06:39:01 AM »

Hello Smiley
Quick question here: What happens if before "if-else" condition comes FALSE (0) (please look at the attached image)? If it were TRUE then mslcorr_w variable would get value of 1, but if there's FALSE condition what happens then with this variable?

is would get a zero since its a boolean operation
Logged
masterj
Hero Member
*****

Karma: +62/-5
Offline Offline

Posts: 1049



WWW
« Reply #2 on: June 29, 2012, 06:47:29 AM »

is would get a zero since its a boolean operation

So mslcorr_w would get just 0 value?
Logged

RaraK
Hero Member
*****

Karma: +58/-2
Offline Offline

Posts: 539


« Reply #3 on: June 29, 2012, 07:50:44 AM »

Yea, since it appears to be a boolean operation, the value can only be a 0 or 1 to the variable. 

You can check this by searching for that variable and see how its used in other function, if its output is to a switch than this will verify its a boolean variable Smiley

Logged
nyet
Administrator
Hero Member
*****

Karma: +607/-168
Offline Offline

Posts: 12256


WWW
« Reply #4 on: June 29, 2012, 07:55:23 AM »

I still dont understand the /X/Y notation...


eg

/ 10/100ms

etc
Logged

ME7.1 tuning guide
ECUx Plot
ME7Sum checksum
Trim heatmap tool

Please do not ask me for tunes. I'm here to help people make their own.

Do not PM me technical questions! Please, ask all questions on the forums! Doing so will ensure the next person with the same issue gets the opportunity to learn from your ex
masterj
Hero Member
*****

Karma: +62/-5
Offline Offline

Posts: 1049



WWW
« Reply #5 on: June 29, 2012, 08:25:52 AM »

Yea, since it appears to be a boolean operation, the value can only be a 0 or 1 to the variable.  

You can check this by searching for that variable and see how its used in other function, if its output is to a switch than this will verify its a boolean variable Smiley



That value is just some random value I've chosen for this question. Let's say we get 1000 through that line. Now if...then condition is false. What value mslcorr_w will get?

Or this may be more understandable: What happens if if...then condition isn't fulfilled? If there was if...then...else condition we would easily choose else, but if there's only if...then?
Logged

masterj
Hero Member
*****

Karma: +62/-5
Offline Offline

Posts: 1049



WWW
« Reply #6 on: June 29, 2012, 08:26:24 AM »

I still dont understand the /X/Y notation...


eg

/ 10/100ms

etc

I think this is the time that ecu takes to test condition
Logged

RaraK
Hero Member
*****

Karma: +58/-2
Offline Offline

Posts: 539


« Reply #7 on: June 29, 2012, 08:28:33 AM »

^^yes


its a computing sequence, /sequence/process

10/100ms is 10th sequence in the 100ms computing time frame

/1/ the first operation i guess for the frame?
Logged
RaraK
Hero Member
*****

Karma: +58/-2
Offline Offline

Posts: 539


« Reply #8 on: June 29, 2012, 08:35:25 AM »

That value is just some random value I've chosen for this question. Let's say we get 1000 through that line. Now if...then condition is false. What value mslcorr_w will get?

Or this may be more understandable: What happens if if...then condition isn't fulfilled? If there was if...then...else condition we would easily choose else, but if there's only if...then?

i guess it means if true do this operation before something else
Logged
masterj
Hero Member
*****

Karma: +62/-5
Offline Offline

Posts: 1049



WWW
« Reply #9 on: June 29, 2012, 08:47:38 AM »

i guess it means if true do this operation before something else

and if false? what happens with variable below?
Logged

RaraK
Hero Member
*****

Karma: +58/-2
Offline Offline

Posts: 539


« Reply #10 on: June 29, 2012, 10:17:53 AM »

i think id have to break down the whole function to understand this specific block better!

we know it means do this operation NOW if true, but is it only re setting the variable when the if block is true? and relies on last stored value if false?

I am not so sure on this unfortunately, if you look at other blocks, its more clearcut how it works, this is goofy this specific example, maybe typo?


Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.018 seconds with 17 queries. (Pretty URLs adds 0s, 0q)