This example works for the PC SDK. In the FP SDK, however, there is no MechanicalUnits property, but a GetMechanicalUnits method, so this is obviously an error in the User’s Guide, which will be corrected.
If you take a look in the FP SDK Reference Help you will see a correct example:
Controller c = new Controller();
MotionSystem motion = c.MotionSystem;
MechanicalUnitCollection mecUnits = motion.GetMechanicalUnits();
foreach (MechanicalUnit m in mecUnits)
{
if (m.Name == "ROB_1")
// Do Something
}