gshort Posted June 20, 2012 Share Posted June 20, 2012 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. Thanks Link to comment Share on other sites More sharing options...
curtwilson Posted June 22, 2012 Share Posted June 22, 2012 When Gather.Type 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 occupies. That is, when Gather.Addr is set in the Script environment to the address of a partial-word element, Power PMAC automatically sets Gather.Type 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 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. Link to comment Share on other sites More sharing options...
gshort Posted June 27, 2012 Author Share Posted June 27, 2012 Many thanks, Curt. That works fine. Link to comment Share on other sites More sharing options...
Recommended Posts