Raw Encoder Value for Motion Scope-Type Use

Is there a generic, programmatic method for getting the firmware address of the raw encoder value for an axis? I’m looking for the position reported by the drive before the origin offset is applied. (I want to verify that the motor is or isn’t actually moving; Changing the origin causes a jump in actual/commanded position, but not in the raw encoder value).

Most drives have a PDO for this, but the names are not (even close to being) guaranteed to be the same. I frequently see names like “Position Actual Value” (with varying case).

Rather than sift through the list of PDO objects, is there a generic way to get the firmware address of an axis’s raw encoder value?

I assume that RMP inherently knows about this value, since it’s probably used internally to do all actual position calculations.
Is there some Good Way™ to get the host/firmware address of the data I want?

You’re on the right track.

If Axis::NetworkIndexGet(NetworkIndexTypePOSITION_ACTUAL_INDEX ) returns a valid value, you can use that index with MotionController::NetworkIndexAddressGet(). This would be the raw EtherCAT actual position data (a signed, 32-bit integer). All DS402 drives should support this.

RSIAxisAddressTypeENCODER_PRIMARY sounds more like what you are looking for, it’s the RMP’s 64-bit double encoder position that isn’t scaled, unless you are using Axis::EncoderRatioSet(…).

What do you have in NodeInfo.xml that’s preventing these from working?

So, when I monitor ENCODER_PRIMARY in the scope, the value is always 0, even when I change the motor position (manually rotate the spindle).

FWIW, here’s the NodeInfo data for the drive in question. (I didn’t test other drives yet.)

         <Product Code="0x1200">
             <ProductName>CS3E-D1008</ProductName>
             <ShortName>Leadshine Stepper</ShortName>
             <AxisCount>1</AxisCount>
             <ItemSubType>Drive</ItemSubType>
             <StatusWord>Transmit PDO 1.Status Word</StatusWord>
             <PositionActual>Transmit PDO 1.Position Actual Value</PositionActual>
             <ControlWord>Receive PDO 2.Control word</ControlWord>
             <PositionDemand>Receive PDO 2.Profile Target Position</PositionDemand>
             <IO>
                 <DigitalInputItems>
                     <DigitalInput SigBits="0x000007F0" Size="32" Home="2" PosLimit="1" NegLimit="0">Transmit PDO 1.Digital Inputs</DigitalInput>
                 </DigitalInputItems>
                 <DigitalOutputItems>
                     <DigitalOutput SigBits="0x003F0000" Size="32">Receive PDO 2.Digital Outputs</DigitalOutput>
                 </DigitalOutputItems>
             </IO>
             <VelocityActual>Transmit PDO 1.Velocity Actual Value</VelocityActual>
             <VelocityDemand>Receive PDO 2.Profile Velocity</VelocityDemand>
             <TorqueActual>Transmit PDO 1.Actual motor torque</TorqueActual>
             <PDOs>
                 <PDOAssignment Index="0x1a00" IsOutput="False" Include="True" RemoveContent="0x603F">
                     <AddEntry Name="Actual motor torque" Index="0x6077" SubIndex="0" BitLen="16" DataType="INT"/>
                     <AddEntry Name="Velocity Actual Value" Index="0x606A" SubIndex="0" BitLen="16" DataType="INT"/>
                 </PDOAssignment>
                 <PDOAssignment Index="0x1600" IsOutput="True" Include="False"/>
                 <PDOAssignment Index="0x1601" IsOutput="True" Include="True" RemoveContent="0x6060">
                     <AddEntry Name="Digital Outputs" Index="0x60FE" SubIndex="1" BitLen="32" DataType="UDINT"/>
                     <AddEntry Name="Touch Probe Function" Index="0x60B8" SubIndex="0" BitLen="16" DataType="UINT"/>
                 </PDOAssignment>
             </PDOs>
         </Product>

Is this the equivalent of ENCODER_PRIMARY?

I might have messed up because I was treating it like an INT32.

Yes, it’s a double. You can always verify with Axis::AddressDataTypeGet()