
Print statements are very useful when troubleshooting a problematic script, or even when testing a new script. We can now see where print statements go when called from a component, but this isn't too useful, as we don't want our users to open the console to see messages. As a quick tip, you can also click the eraser icon to clear out the console, and then press your Button again to generate a new entry like we did in this example. However, the most recent events should be towards the bottom.
#Inductive automation ignition scripting windows#
The Designer logs many different types of activities and events here, including polling events from components on other windows that are currently open in the Designer. There may be a large amount of text in the Output Console.This means we need to open the Designer's Console to see the results of our script. At the Designer's menu bar, select Tools > Console. This is because we used printin our script, which always outputs to a console, as opposed to popping up at the user. If everything is working as intended, then it should appear as if nothing happened. Now we can test the script. Place the Designer into Preview Mode, and press the Button.If a new tab is selected and configured, it will wipe out the work on the prior tab, for example, writing a script on Script Editor and then configuring the Navigation tab will erase the script on the Script Editor tab. An event will only ever have a script located on a single tab at any time. The Script Editor tab also has a blue color, denoting where the script is. If you see this, then it means you may want to save any changes you made. The asterisk will disappear when you press either OK or Apply, and reappear whenever you make a change to the script. This means you have not applied/saved the changes to the script. This is useful to know in situations where a component has scripts on multiple events.Īdditionally, an asterisk character ( * ) is next to the event.

This means there is a script on this event. Notice the actionPerformed event is blue and bold.
#Inductive automation ignition scripting code#
Indention in Python means something, so we need to avoid starting our lines with a space or tab unless we're denoting a block of code under something like an if-statement or function definition. Click OK to close the Component Scriptingwindow. Make sure the word "print" lines up exactly to the left edge. Let's generate a message that shows "Hello World!" Use the following code to get started.


