Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.
This feature is new in Ignition version 8.0.3
Click here to check out the other new features

Description

Takes the name of a task as an argument as a string (must be configured on the Controller before hand), attempts to execute the task. 

To run in the client, the user needs a role-based permission. This permission is disabled by default.

Client Permission Restrictions

Permission Type: EAM Task Execution

This scripting function has Client Permission restrictions.

Syntax

system.eam.runTask(taskname)

  • Parameters

string taskname - Name of the task to run. If more than one task has this name, an error will be returned.

  • Returns

A UIResponse with a list of infos, errors, and warnings. The UIResponse object is functionally a list of runTask objects.

  • Scope

All

UI Response

The "UIResponse" is an object containing three lists, each containing different logging information about the task that was run. The contents of the lists are accessible from the getter methods.

  • getWarns() - Returns a list of warning messages that were encountered during the task

  • getErrors() - Returns a list of error messages that were encountered during the task

  • getInfos() - Returns a list of "info" messages that were encountered during the tasks.

These messages represent normal logging events that occurred during the task, and can be useful when to visualize the events that lead up to a task failure.

Examples
Code Snippet - Running an Agent Task
# Simply execute a task called 'Collect Backup'
taskName = "Collect Backup"
response = system.eam.runTask(taskName)
Code Snippet - Running an Agent Task and Seeing Its Response
# Execute a task and display the responses from it. 


# create a function to print out the responses in a nice format
def printResponse(responseList):
    if len(responseList) > 0:
        for response in responseList:
            print "", response
    else:
        print " None"

# Run the task
taskName = "Collect Backup"
response = system.eam.runTask(taskName)

# Print out the returned Warnings (if any)
warnings = response.getWarns()
print "Warnings are:"
printResponse(warnings)

# Print out the returned Errors (if any) 
errors = response.getErrors()
print "Errors are:"
printResponse(errors)

# Print out the returned Info (if any)
infos = response.getInfos()
print "Infos are:"
printResponse(infos)
Keywords

system eam runTask, eam.runTask  

  • No labels