Hello,
CallServiceRoutine is a bit tricky to use, and this piece of functionality has been improved for FP SDK 5.11, which will soon be released.
In 5.11 CallServiceRoutine is marked as obsolete and you are instead recommended to use the new method CallRoutine/CancelRoutine, which returns a StartResult, which will help you take action depending on how the start went:
5.10 public void CallServiceRoutine ([string](http://msdn2.microsoft.com/en-us/s1wwdcbf) routine)
5.11 public StartResult CallRoutine ([string](http://msdn2.microsoft.com/en-us/s1wwdcbf) routine) & public StartResult CallRoutine ([string](http://msdn2.microsoft.com/en-us/s1wwdcbf) routine, RegainMode regainMode)
Valid routines for CallRoutine are service routines and ordinary routines that do not take any parameters.
Any previous execution stack will be kept and after the routine is executed the program pointer will be restored to its previous location.
Using the method requires special attention due to the fact that the routine might be stopped before it is finished.
To enable normal execution again CancelRoutine() must be called. See the FlexPendant Program Editor for an idea about how this can be implemented.
This is the same as for CallServiceRoutine in 5.10, where the possible need for CancelServiceRoutine must be handled somehow. (This is poorly
documented in 5.10)
If the start does not suceed, one reason may be that the mechanical unit is not on path. If so start must be ordered with a Regain parameter.
Or else it can be motors off, or that mastership is held by another client (in auto mode). The error code 0xC004900A indicates wrong execution level
(pp may already be inside a service routine, which was stopped before it was ready.)
If this is the case CancelServiceRoutine must be called before it is possible to continue.
In the FP SDK 5.11 Reference the description on how to use CallRoutine/CancelRoutine is better.
I suggest you take a look at it, even if you will still be using 5.10 CallServiceRoutine.
It will be available next week at the latest.
It will (hopefully) help you understand how this works.
By the way, the error codes that you can get from the controller are listed in User's Guide.
You get a hint as to what may have gone wrong by the error descriptions :
0xC0048407 Operation rejected by the controller safety access restriction mechanism.
0xC004900A Operation is illegal at current execution level.