FabyaVisionUser Manual
/

Scripts overview

6 min readScripts

In FabyaVision, scripts are written in four languages (VBScript, JavaScript, C, Python). This topic explains which language is suitable when, where scripts can be run from, and how a script written in Studio reaches Live.

What a script is for

If tasks such as writing a tag, opening a screen, calculating or asking the operator a question cannot be done with event functions, a script is written. A script is a small program that accesses tags and the objects of the open screens while Live is running. Scripts are written in the Scripts section; in Live, only the Live program runs them.

All four languages do the same job. The choice of language depends on the habits of the team and the nature of the task.

Four languages

LanguageScript typesTag accessWhen it is suitable
VBScript (VBS)Module, ActionHMIRuntime.Tags("Ad").Read, SmartTags("Ad")Teams used to WinCC VBS; text, date and dictionary tasks; database access through ODBC.
JavaScriptFunction, Global moduleTag.oku('Ad'), Tag.yaz('Ad', değer)Short tag operations and calculations. The product provides only four ready-made objects (Tag, Sayfa, Bildir, Kullanici); there are no database, file or program execution functions.
CProject functions, Action, Header fileGetTagFloat("Ad"), SetTagBit("Ad", 1)Teams used to WinCC C scripts; calculations that use structures, arrays and pointers.
PythonModule, Actionscada.read("Ad"), scada.write("Ad", değer)Readable code, list and dictionary handling, JSON, regular expressions, a wide standard library.

Details of the languages: VBScript, JavaScript, C, Python. The list of objects and functions for all languages is in the topic Script object model reference.

Script types

The name of the type varies by language, but there are two basic patterns.

Reused functions
In VBS and Python it is called Module, in C Project functions, in JavaScript Global module. Functions are called from other scripts by name. Module-level code (the lines outside functions) runs once when the project is opened.
Directly executed code
In VBS, C and Python it is the Action; in JavaScript it is the Function. It runs from the beginning on every call. A JavaScript function can take parameters (Parameters column).
Header file
Only in C. Included at the top of the script with #include "Ad.h"; it cannot be run on its own.

The usage rules of the types are described in the language topics: when a value is selected in the Type column of the table, the code template also changes (if the code is still in its template state).

Where scripts run from

CallerHow to connect it
Object or screen eventRun script function on the Events tab: the script and (for a VBS module, C project function or Python module) the procedure / function to be called are selected. If none is selected, the procedure with the same name as the script runs. See Events and functions.
Code written in the eventThe Run VBS code, Run C code and Run Python code functions: the code is written directly into the event; the object of the event is available as Item and its screen as Parent. There is no such function for JavaScript.
Scheduled taskThe Scheduled tasks and Script to run columns in the Procedure / function table. In a task triggered by On tag change, the new value of the tag is passed to the script as the first parameter. See Scheduled tasks.
Recipe transferThe Before script and After script in the recipe's PLC transfer settings. If the before script fails, the transfer does not start. See Recipe design.
Another scriptPython modules are imported with import Betik_Adi; the procedures of VBS modules and the C project functions are in the common namespace of all scripts.

From writing to running

  1. Write the script

    In the Scripts section, add a row, select the language and the type, and write the code in the code area on the right. Details: Script editor.

  2. Compile

    F9 checks the script, Ctrl+Shift+B checks all scripts. Syntax errors and project-related warnings (nonexistent tag, disabled permission) are listed below the code.

  3. Connect

    Bind the script to an event, a task or a recipe.

  4. Test and upload

    Start Live saves the project and opens it in Live. If there are compile errors in scripts, Studio offers the options Show errors, Start anyway and Cancel; a faulty script does not run in Live. For a permanent installation, load the project into Live.

Rules for how scripts run in Live

  • The interface does not freeze. VBS, C and Python scripts run in the background; tag writes, waits, window and file operations are awaited automatically.
  • 30-second limit. A VBS, C or Python call can compute for at most 30 seconds. A longer loop is interrupted with the message Betik süre sınırını aştı (30 sn); sonsuz döngü olabilir. The limit measures only the time the code itself runs: the waiting time of tag writes, database, window and wait operations (Sleep in C, scada.sleep in Python, MsgBox) is not counted. No such limit applies to JavaScript.
  • Overlapping calls are skipped. In VBS, C and Python, a new call that arrives for the same trigger (the same task or the same event row) while the previous call is still running is skipped; a note is written once to the event log. JavaScript has no such check.
  • Errors are written to the log. A script error does not stop the program; it is written to the event log with the type betik. See Log files.
  • Scripts do not run in monitoring from a browser or TV. Scripts run only in the Live program.
  • If the service is off, tasks do not run. If Live settings is turned off in Startup sequence › Scheduled tasks, no task is triggered.

Limitations and points to note

  • The script engines are the product's own engines; Windows Script Host, a real C compiler or a CPython installation is not required. The languages are not complete but a subset; the differences are listed in the language topics.
  • Some WinCC objects, such as alarm generation and acknowledgement and archive logs, do not exist in scripts. If they are called, the script raises a clear error or a diagnostics line is written (Known limits).
  • In the first field trial, test the database, file and program execution functions in the real environment with the permission turned on.

Related topics

FabyaVision 0.1.0 User Manual · 18 October 2026© Fabyatek Yazılım Bilişim Teknolojileri Ltd. Şti.