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 | ||
---|---|---|
|
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:
- Access Scripts > Tasks.
- Click on the plus icon.
- Input a task Name, Description and select the desired Language.
- Choose to create new code or import a code from an existing library.
- 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.
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.
- 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. |
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:
| ||
InitialStateInitial State | Select the The task's initial state, theoiptions are as follows:
| ||
Build Status | The | BuildStatus | Read-only. Status of the task code from the continuous compiling process.
|
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] | For definitions of other columns that are available in this table, see Common Column Definitionsthe task. |
In this section...
Page Tree | ||||
---|---|---|---|---|
|