We are using an ACC-14E interface to a PPMAC to provide absolute position for two axes via synchro to digital (S/D) converters. When the PPMAC is first powered on, PLC1 is executed which performs a homez on both motor axes using the following code:
Motor[AZ_MOTOR_NUMBER].pAbsPos=ACC14E[0].DataReg[0].a
Motor[EL_MOTOR_NUMBER].pAbsPos=ACC14E[0].DataReg[3].a
Motor[AZ_MOTOR_NUMBER].AbsPosFormat=$00200F08;
Motor[EL_MOTOR_NUMBER].AbsPosFormat=$00200F08;
Motor[AZ_MOTOR_NUMBER].AbsPosSF=1.0;
Motor[EL_MOTOR_NUMBER].AbsPosSF=1.0;
Coord[1].PosRollOver[0]=360.0;
Coord[1].PosRollOver[0]=360.0;
homez AZ_MOTOR_NUMBER;
homez EL_MOTOR_NUMBER;
This routine correctly initializes the absolute position about 20% of the time. At other times, the position is exactly twice what it should be. When this occurs, acc14r0, acc14r1, acc14r3 and acc14r4 all contain the correct 16 bit angles; however #1p and #2p contain twice the angle, respectively. Re-running PLC1 from the IDE command line fixes the problem. I have attached before and after IDE screenshots of this.