Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edits/style


The Output Console is the script-writer's best friend. It is a dockable panel, and can be opened via the Tools > Console menu or the Ctrl-Shift-C keyboard shortcut.

Image Removed

The Console is

The Output Console is a dockable panel that you can open via Tools > Script

Console menu

Console menu or

the Ctrl

the Ctrl-Shift-

C keyboard

C keyboard shortcut. The Output Console prints system messages that are coming from the Designer. This can vary from simple info messages that show when things are loaded, to error messages when something goes wrong. The Console is also frequently used to test and debug Python scripts, as print statements on components that are run in the

designer

Designer are printed here.

Image Added

For example, by using the print function in your script, you can observe the inner workings of your script as it executes. If you executed the following script:


Code Block
languagepy
# A
python
 Python script that demonstrates the print
statement
  
print 
 statement.
  
print "Print me first"


x=10


z=2

print x,

print x, y, x/y

  
#Result looks like this:
#Print me first
#10 2

  
#Result looks like this:
#Print me first
#10 2 5
Note_friendly

Gateway-scoped information will not appear in either the Output Console or Script Console. Instead, the output will be sent to the wrapper.log file. Alternatively, system.util.getLogger() will send messages to the Gateway Console, and is a preferred method of troubleshooting Gateway scoped scripts.



The Output Console is most frequently used to test and debug Python scripts on components in Ignition. By using the print keyword in your script, you can observe the inner workings of your script as it executes. For example, if you executed the following script:


Code Block
languagepy
titlePython - Using the Output Console to Test and Debug Python Scripts
# A function that intercepts tag writes, printing out the previous value first.
def writeToTag(path, value):
   prevValue = system.tag.getTagValue(path)
   print "Writing value '%s' to %s, was previously '%s'" % (value, path, prevValue)
   system.tag.writeToTag(path, value)
 
writeToTag("Compressor/HOA", 2)

It would print the following to the console:

Writing value '2' to Compressor/HOA, was previously '0'


Note_friendly

The Output Console is also available in the Vision Client from Help > Diagnostics and selecting the Console tab.