How to graph status fields in megalog viewer?

Questions specific to Megalogviewer

Moderator: LT401Vette

Post Reply
MalcolmV8
Experienced MS/Extra'er
Posts: 162
Joined: Tue Feb 07, 2017 4:05 pm

How to graph status fields in megalog viewer?

Post by MalcolmV8 »

Hey Guys,

Using [Engine] as an example. In the manual I found these definitions of the bit fields:

128 = MAP decel enrichment
64 = MAP accel enrichment
32 = TPS decel enleanment
16 = TPS accel enrichment
8 = WUE active
4 = ASE active
2 = Cranking
1 = Ready (active tach signal and pump running)

Looking around I found statements such as these:

MapAE = ([Engine] & 64) > 0 ? .7: .1
TpsAE = ([Engine] & 16) > 0 ? .8: .1

I used those and they work but I don't entirely understand why and I'm trying to figure that out.

So for example if my Engine value is 17 TpsAE shows enrichment because of 1 & 16 = 17. How do I read that statement above? Looks to me like it's saying if Engine is 16 or greater than 0? Not sure how to read that syntax.

When Engine was 65 it showed MapAE which of course is 64 + 1. When I had Engine of 81 is showed both MapAE and TpsAE. That's where I get confused. How does that TpsAE statement above differentiate between 81 and 65? both are greater than 16?

I'm trying to write my own custom ones but not fully grasping what's happening here?

Thanks
Malcolm
jsmcortina
Site Admin
Posts: 39620
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: How to graph status fields in megalog viewer?

Post by jsmcortina »

& means a bitwise AND operation. It picks out the binary bit equal to 16 in this case.

Those formulae give you easy to graph numbers between 0 and 1.
For a quicker to type formula you can just say
[Engine] & 16

Then you have to mess about with the min/max limits so the lines don't get stuck at the top and bottom.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
MalcolmV8
Experienced MS/Extra'er
Posts: 162
Joined: Tue Feb 07, 2017 4:05 pm

Re: How to graph status fields in megalog viewer?

Post by MalcolmV8 »

Ahhhh OK that's very cool. That fills the gap, makes sense now. Thanks.

I quite like doing the .7 or .8 etc. and then manually setting scale to 0 & 1. All are close together but not overlaying etc. Just personal preference but I played around without the if statement as you showed just to compare. Thanks again.

Malcolm
Post Reply