0
$\begingroup$

I recently made significant progress in my understanding on the ARINC429 thanks to a user on this site, but I after reading more into it, I may have confused myself a little bit. Any help on any of the following questions is greatly appreciated.

  • I found a specification pdf online, but it contradicts (i think) some of the other information I have gotten. The link to the pdf is here. Is it safe to assume that information is accurate enough to rely on? Assuming this book is a proper document on the ARINC429 specification
  • If the above is correct, is it correct that BNR data fields are represented in positive two's complement with bit 29 indicating its sign (positive/negative)? Wouldn't that just be regular binary with bit 29 indicating the values sign?
  • The scale factor applies starting from the MSB (bit 28) and continues halving with each bit between 27 and 11. The actual value translation would be applying the scale factor to each sig bit and adding the values of all the sig bits together to get the final value and using bit 29 to identify if its +/-. Is any of that correct at all?
  • How does the resolution work? I got confused a lot by that. What is it? How does it affect the data field?
  • Can somebody explain BNR format of the data field and how to translate it? I feel like I may have read too many different sources and got confused by the variance in explanations....haha
$\endgroup$
  • 2
    $\begingroup$ You should consider splitting this into multiple questions. You are asking five questions at once here. $\endgroup$ – Jimy Jun 28 '17 at 15:42
  • $\begingroup$ Alright, I'll do that then, I just didn't want to annoy the other forum members with so many questions $\endgroup$ – woudie Jun 28 '17 at 15:51
  • $\begingroup$ On the first question, that is a link to A429 Part 1 supplement 17. The current version is supplement 18. The differences are mostly some new labels for the MMR and Fuel controls. Other than that it should be good for you. BTW, Part 2 covers Discrete words and Part 3 Block data transfer (Williamsburg protocol). $\endgroup$ – Gerry Jun 28 '17 at 16:16
3
$\begingroup$

Resolutions in the A429 spec are approximate, so calculate them yourself.

Resolution = Range / (2^significant bits)

Here is one way to do it: Load your 32 bits into a signed 32-bit integer. Shift left 3 so the sign bit is now in bit 32. Shift right (32-significant bits)-1 to form a 2's complement "fixed-point" number. Convert to float and multiply by the resolution. Done.

Note that when a signed integer is used the high bit is sign extended on the shift right.

"Fixed-point" is also known as "scaled" in some circles. It's a method of storing and performing math on a real number using an integer rather than using a float. The resolution is the weight of one lsb bit. The resolution is documented somewhere and multiplied by the integer to get the float when debugging and such, but machine code does not "know" that you think of it as a float.

The range is key to fixed -point numbers because it bounds the value. The number of significant bits affects the accuracy. You could use the wrong number of significant bits and still get a "usable" number but with a possible loss of accuracy if you choose one that is too small. Beware that unused low bits are sometimes repurposed for status flags, etc., so don't expect these to alway be zero. Also, the specs describes an ideal standard but in the real world liberties are taken with labels repurposed as needed.

Because of the way 2's complement integers work, the max positive value possible will be the range minus the resolution. For instance, you can get exactly -180 degrees but not quite +180 degrees.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Sorry, I think I may have gotten a little confused. When you say shift the bits left by 3 then right by -1 (basically saying shift left by 4), then convert that (I'm assuming it's still two's complement) into a float number, then multiply the float by the resolution, would that give me the translated version of the data field? $\endgroup$ – woudie Jun 29 '17 at 15:41
  • $\begingroup$ In A429 BNR there is a 2's complement integer (an ordinary integer) in the data field with the sign bit in bit 28. But this is not a 32-bit integer, its size is "sig bits" from the label's spec, plus one for the sign. You have to turn that into a 32-bit integer. The shift left will always be 3 to move bit 28 into but 32. This will anchor the sign bit (sign extend) so negative numbers stay negative. The you have to then shift the whole thing right so the LSB is in bit 1. The number of bits to shift right varies by the number of significant bits and must be calculated,. $\endgroup$ – SteveScottAz Jun 29 '17 at 15:56
  • $\begingroup$ Alright, so then once I have the sign bit anchored and I shift the sig bit right until the lsb of the datafield is bit 1. Would I pad the area between the sign bit and the msb of the data field with 0's? If so, would I just translate it to base10 or do I need to apply the scale factor from the msb to lsb as they talk about in the specification doc? $\endgroup$ – woudie Jun 29 '17 at 16:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.