shansen Posted February 20, 2012 Share Posted February 20, 2012 Is there a way to access Gate1[x].PartData in C-code through the GateArray1 structure? I know I can hardcode a pointer to that address, but I'd prefer to use a tagname if possible. Thanks! Link to comment Share on other sites More sharing options...
Omron Forums Support Posted February 20, 2012 Share Posted February 20, 2012 Accessing all gate structures in C is explained in detail in the User's Manual chapter on writing C programs, starting on page 483 of the manual: http://forums.deltatau.com/filedepot/download.php?f=Power%20PMAC/Manuals/Power%20PMAC%20User [FILE REMOVED] If you still have questions after reading that, please post them. Link to comment Share on other sites More sharing options...
shansen Posted February 20, 2012 Author Share Posted February 20, 2012 Charles, I have looked at the manual, but it doesn't really answer my question. In the terminal, I can type Gate1[4].PartData[0] to access this variable. In my C-code, I am currently doing this: unsigned int *pPartData0 = (unsigned int *)(0xD00040 + piom); I am asking if I there is a way to do this: GateArray1 *pGA1 = GetGate1MemPtr(x); unsigned int *pPartData0 = &pGA1->PartData[0]; Link to comment Share on other sites More sharing options...
curtwilson Posted February 20, 2012 Share Posted February 20, 2012 The information you find through Script in Gate1.PartData[k] does not have a comparable structure in C. These elements are hardware registers in the ID chips associated with the DSPGATE1 IC; they are not part of the gate array IC itself. On power-on/reset, Power PMAC automatically reads these hardware registers and puts processed information from them into software elements. In Script, these are accessed as: Gate1.PartNum Gate1.PartOpt Gate1.PartRev Gate1.PartType In C, these are accessed through separate software data structures: pshm->Gate1PartData.Num pshm->Gate1PartData.Opt pshm->Gate1PartData.Rev pshm->Gate1PartData.Type If you want to read the actual hardware registers in your application, as to check the encoder-loss status bits, you will need to use the pointer technique you have already figured out. Link to comment Share on other sites More sharing options...
Recommended Posts