View source for HANtune/Scripting
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
Template used on this page:
Return to HANtune/Scripting.
You do not have permission to edit this page, for the following reason:
The action you have requested is limited to users in one of the groups: Administrators, Bureaucrats.
You can view and copy the source of this page.
Template used on this page:
Return to HANtune/Scripting.
HANtune offers the ability to run your own scripts by integrating a Jython interpreter. Jython is a Java implementation of a Python interpreter, which means that it runs inside the Java Virtual Machine (JVM). This makes it very easy to interface with HANtune and allows us to automate its functionality.
To add a script to your project right click the 'Scripts folder' in the 'Project Data' side panel and click 'Add Script'. Browse to the right directory, select your script and click 'Add Script'.
To start a script right click on it in the 'Project Data' side panel and click 'Start'
Alternatively, you can start a script by first dragging it from the 'Project Data' side panel to the layout and clicking the newly created button.
To indicate that a script is running, its icon in the 'Project Data' side panel will change its appears.
Creating a new signal:
mySignal = createSignal('MySignal')
Setting its attributes:
mySignal.minimum = 0 mySignal.maximm = 255
scriptedSignal = createSignal('MyScriptedSignal') realSignal = getSignal('DemoSignal1') def myTriggerFunction(): scriptedSignal.value = realSignal.value * 2 logSignal(scriptedSignal.name, scriptedSignal.value) createTrigger(realSignal, myTriggerFunction)