NefMoto

Technical => Tuning => Topic started by: masterj on June 29, 2012, 06:16:12 AM



Title: IF-THEN
Post by: masterj on June 29, 2012, 06:16:12 AM
Hello :)
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?


Title: Re: IF-THEN
Post by: RaraK on June 29, 2012, 06:39:01 AM
Hello :)
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


Title: Re: IF-THEN
Post by: masterj 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?


Title: Re: IF-THEN
Post by: RaraK 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 :)



Title: Re: IF-THEN
Post by: nyet on June 29, 2012, 07:55:23 AM
I still dont understand the /X/Y notation...


eg

/ 10/100ms

etc


Title: Re: IF-THEN
Post by: masterj 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 :)



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?


Title: Re: IF-THEN
Post by: masterj 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


Title: Re: IF-THEN
Post by: RaraK 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?


Title: Re: IF-THEN
Post by: RaraK 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


Title: Re: IF-THEN
Post by: masterj 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?


Title: Re: IF-THEN
Post by: RaraK 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?