Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Script Tasks in FrameworX The Scripts Module allows the automation of various tasks through scripting. They support code written in C#, VB.NET, and Python. These tasks can be configured You can configure these tasks to run in response to specific events or on a scheduled basis, enhancing the application's efficiency and functionality. 
Script tasks can be self-contained lines of code, call Script Classes or use external DLLs.

On this page:

Table of Contents
maxLevel3


Configuring Tasks

Tasks are program units, written in VB.Net, C# or Python, that execute either when a trigger event occurs or periodocally at specified intervals. FactoryStudio includes . To create and configure a Sctipt Task, follow the steps below:

  1. Access Scripts > Tasks.
  2. Click on the plus icon.
  3. Input a task Name, Description and select the desired Language.
  4. Choose to create new code or import a code from an existing library.
  5. Click Ok.
Info

To modify an existing Script task, double-click and modify the desired field column and make the changes. See a list of available properties in the next section.

The image below illustrates the process described above.

Image Added

Built-in Tasks

All soutions include the following built-in tasks:

  • ServerStartup—Executed Server Startup: Executed when the project solution starts running. Runs on the server (computer running TServer.exe).
  • ServerShutdown—Executed Server Shutdown: Executed when the project solution shuts down. Runs on the server.
  • ClientStartup—Executed Client Startup: Executed on each client when the Displays module (TVisualizer.exe) starts running.
  • ClientShutdown—Executed Client Shutdown: Executed on each client when the Displays module closes.
To configure tasks:
  • Go to Scripts > Tasks.
  • Select a task name, or select the insert row (first row) to create a new task.
  • Enter or select information, as needed.
  • Then you can double click in the row to go to Code Editor.

Script Tasks Properties

The following is a table describing each available property field for the Alarm Item:

Info

If a property column is not visible on the grid, enable it by right-clicking the grid header and selecting it from the list.

For definitions of other columns that are available in this table, see Common Column Definitions

PropertyColumn

Description

Name

Enter a The name for of the task. The system lets you know if the name is not valid.

Code

Read-only. This specifies Specifies the language used for the code for of this task. By default, this is the language you selected when you created the project. From the Code Editor tab, you You can change the code language. To change the project default , go to by accessing Info > Settings.

Trigger

Enter or select the event (tag or other object) that should trigger The event that triggers the task execution, if any. The task executes when the value of the object changes.

Period

Enter the The time interval that should occur between executions of the task, if there is no trigger.

Domain

Select The location where the script executes, there are two options:

  • Client—Task Client: Task executes on each client system. These are tasks that apply locally (on the user's computer). For example, report generation.
  • Server: Task Server—Task executes on the server system. These are tasks that apply across the application, that is, globally.

InitialStateInitial State

Select the The task's initial state, theoiptions are as follows:

  • Enabled—Task Enabled: The task is ready to run.
  • Disabled—Task Disabled: The task is not ready to run. You may enable the task under specific conditions.

Build Status

The

BuildStatus

Read-only. Status of the task code from the continuous compiling process.

  • Green check mark—Task mark: The task runs without errors.
  • Red X—Task X:Thetask has warnings or errors. Double, double-click to go to access the warning or error.
    • Warnings are information only.
    • Errors will prevent the code from running for that specific task. The rest of the
    application
    • solution will run.

Build Errors

BuildErrors

Read-only. Displays any errors encountered during the last build.

EditSecurityEdit Security

Set the The security to enable who can edit the tasks. 

Description

Enter a description Description of this task.

[Other columns]

the task.



In this section...

Page Tree
root@parent
spacesV10