Error messages
User-specific compensation errors
Besides the standard transformation errors, the user can issue user-defined errors for some methods (e.g. error ID 123) by using the function return value (0 = OK).
HRESULT CToolRadiusComp::CalculationTrcPath(PTcCncToolRadiusCompParam trc){
if (…)
return 123; // raise error
…
return S_OK;
}
Error messages in TcCncUsersEvents.xml
In the event of an error, the user-defined return value of the method can be transferred to the error message evaluation via the PLC or the TwinCAT Event Logger, see also FCT-M7: TwinCAT3 error output.
Error messages must be supplemented in the corresponding language in the XML error message file. (C:\TwinCAT\3.1\Target\Resource):
<Event>
<Id>123</Id>
<Message LcId="1033">Online tool radius compensation: error 123</Message>
<Message LcId="1031">Online tool radius compensation: Error 123</Message>
</Event>
The error is output by the Event Logger.