Jump to content
OMRON Forums

Gate1[x].PartData in C-code


shansen
 Share

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

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

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...