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.
Prerequisites
Set the default external code editor. See Set the default code editor.
  1. Debug NetLogic by logging to output
  2. In
    Project view
    , double-click the NetLogic to troubleshoot.
    The NetLogic opens in the external code editor.
  3. Add
    Log
    methods 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
      ");
  4. To display log messages in
    FactoryTalk Optix Studio
    , either:
    • Debug a runtime NetLogic. Select
      Run
      and investigate the
      Output
      pane.
      TIP: You can run the project on the Emulator target for debugging.
    • Debug a design-time NetLogic. Execute the NetLogic and investigate the
      Output
      pane.
    TIP:
    In the
    Output
    pane:
    • The design time NetLogic errors display in the
      Studio Output
      tab.
    • The runtime NetLogic errors display in the
      ApplicationName
      tab. For example,
      Emulator Output
      .
    For more information, see Output pane.
  5. Edit the code and repeat the procedure.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.