Debug NetLogic by logging to output
Debug design time and runtime NetLogics by logging messages to the
FactoryTalk Optix Studio
Output
pane. The messages display information about objects and variables or check whether a certain line of code is reached.
TIP:
To extensively debug a NetLogic, follow one of these procedures instead:
Prerequisites
Set the default external code editor. See Set the default code editor.
- Debug NetLogic by logging to output
- InProject view, double-click the NetLogic to troubleshoot.The NetLogic opens in the external code editor.
- AddLogmethods to the NetLogic code.For more information, see Write log messages.For example:
- Log.Info(LogicObject.BrowseName,"Information message");
- Log.Warning(LogicObject.BrowseName,"Warning message");
- Log.Error(LogicObject.BrowseName,"Error message");
- To display log messages inFactoryTalk Optix Studio, either:
- Debug a runtime NetLogic. SelectRunOutputpane.TIP: You can run the project on the Emulator target for debugging.
- Debug a design-time NetLogic. Execute the NetLogic and investigate theOutputpane.
TIP:In theOutputpane:- The design time NetLogic errors display in theStudio Outputtab.
- The runtime NetLogic errors display in thetab. For example,ApplicationNameEmulator Output.
For more information, see Output pane. - Edit the code and repeat the procedure.
Provide Feedback