Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undocumented Gather.Type
The documentation specifies values for Gather.Type as being in the range from 0..5 inclusive which specify various sizes of integer and floating point data. I observe however, that if you plot Motor[x].AmpEna a Gather.Type is set to 26566 and Coord[x].Ldata.Status sets Gather.Type to 50694. Since we want to control gathering programmatically and would like to have the option of adding any possible variable into the gather buffer it would be useful to know how to specify the correct gather type for these types of data. Is it possible therefore to have a more complete document on the values for Gather.Type.

When Gather.Type[i] is not in the range 0 to 5, it contains a code specifying what part of a 32-bit integer register the element specified by Gather.Addr[i] occupies. That is, when Gather.Addr[i] is set in the Script environment to the address of a partial-word element, Power PMAC automatically sets Gather.Type[i] to this code.

Note that this code does not affect the gathered value, which will always be the full 32-bit register. Rather, it can be used to isolate the desired portion of this 32-bit value.

Gather.Type[i] is a 16-bit value. The high 5 bits (11-15) specify the starting (low) bit number of the partial-word element in the 32-bit word. The low 11 bits (0-10) specify how many bits are used. The values of interest are:

1 bit: $7c6
2 bits: $786
3 bits: $746
4 bits: $706
8 bits: $606
12 bits: $506
16 bits: $407

So for Motor[x].AmpEna, Gather.Type is set to 26566 ($67c6). This means 1 bit ($7c6) starting at bit 12 (6*2 + 0).

A value of 50694 ($c606) means 8 bits ($606) starting at bit 24 (c*2 + 0).

More generally, the value in bits 6-10 is 32 minus the number of bits in the element.
Many thanks, Curt. That works fine.

Forum Jump:

Users browsing this thread: 1 Guest(s)