iorewsoft.blogg.se

Inductive automation ignition scripting
Inductive automation ignition scripting




  1. #Inductive automation ignition scripting code#
  2. #Inductive automation ignition scripting windows#

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.

inductive automation ignition scripting

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.

  • In the Script Editor, you will see a large editable Text Area.
  • Additionally, if the wrong event is selected, then our script will not trigger when we expect it to. If an event is not selected, all of the remaining features in this window will be disabled, so we will not be able to write a script. Make sure the actionPerformed event is highlighted.
  • Under Event Handlers, select the action > actionPerformed option, and click the Script Editor tab.
  • Alternatively, you can double-click the Button to open the scripting window. With the Button component selected, right click on Scripting to open the Component Scripting window.
  • Let's add a script that triggers when the Button is pressed.
  • inductive automation ignition scripting inductive automation ignition scripting

  • Drag a standard Button component to your window.
  • (We won't need to reference the name of the window in any of these examples).
  • In the Designer, create a new Main Window.
  • In this example, let's add a script on a Button component, and print out "Hello World" when the Button is pressed. Scripts are commonly located on components in a window. Example - "Hello World" on a Button Component






    Inductive automation ignition scripting