Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assigning Motor[x].pMasterEnc in C
In the PowerPMAC IDE bgcplc environment, when assigning the master register address as follows:
pshm->Motor[6].pMasterEnc = pshm->EncTable[12].pEnc;

I get this warning during the build:
...warning : assignment from incompatible pointer type

How can I typecast this address assignment so the warning is avoided, or should I put this assignment in a Command(TS) call?


I'm not certain about that warning, but I think you might be issuing the wrong code. Typically, pMasterEnc is set as:

Motor[6].pMasterEnc = EncTable[12].a (not pEnc)

So can you try instead to issue:

pshm->Motor[6].pMasterEnc = &(pshm->EncTable[12]);

Forum Jump:

Users browsing this thread: 1 Guest(s)