Simulation Script Introduction

The simulation script API is used to add functionalities when simulation is running (For Designer and Integrator) and when the Operator server is running (Operator). Some examples of usage:

  • Calculate variables like energy or other KPIs based on some simulation events.
  • Create custom divert rules
  • Customize the behaviour of equipments
  • Create, move, delete products
  • Schedule events

Scripting Language

The language used is Javascript. Sym3 is using Google V8 scripting engine so it supports ECMAScript

Legend

The simulation script documentation is using the following icons:

  • 🧩: Object
  • 🔧: Properties
  • 🔁: Function
  • ⚡: Event
  • ⚙️: Parameters of a function
  • ↩️: Return Value
  • 📝: Example
  • 💡: Remark or Info

Errors

Using Sym3 Designer or Integrator

The compile errors or execution errors can be displayed in Message Viewer.

Using Sym3 Operator

When using Sym3 Operator, the simulation script is executed on Sym3 Operator Server side.

The errors and logs (by using logs functions) are accessible in the server log files:

"C:\ProgramData\Sym3\Sym3 Operator\Logs\Server\Sym3.Operator.Server.JavaScript.log"
"C:\ProgramData\Sym3\Sym3 Operator\Logs\Server\Sym3.Operator.Server.JavaScriptEngine.log"