New Community Ranking System
Our Community ranking system has recently been updated. You may notice changes in user rankings and receive system messages or notifications. If you have questions about how the new ranking works, please refer to the announcement post for more details (click here).
Script Window
Digital Twin
This knowledge base is addressing usage of software Experior, Machine Expert Twin and future Automation Expert Twin. These softwares are used to create smaller instances of digital twins for use in industrial automation, warehouse management, design & engineering with more..
Search in
Improve your search experience:
Exact phrase→Use quotes " "(e.g., "error 404")
Wildcard→Use * for partial words(e.g., build*, *tion)
AND / OR→Combine keywords(e.g., login AND error, login OR sign‑in)
Keep it short→Use 2–3 relevant words, not full sentences
Filters→Narrow results by section(Knowledge Base, Users, Products)
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send InviteCancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
The script window in Experior allows you to call the Experior API, within an instance of Experior.
It allows you to interact with Experior and e.g. stimulate the active model. An example usecase could be running a model without being connected to a physical PLC.
The shown model below has been set up through scripting, so that the first motor starts when a load activates the first sensor and a new load will be created when the load activates the second sensor. Gif is also attached as mp4 in this article.
The script window could contain following code:
using System;
using System.Numerics;
using System.Windows.Media;
using System.Linq;
using Experior;
using Experior.Core;
using Experior.Interfaces;
using Experior.Core.Loads;
using Experior.Core.Routes;
using Experior.Core.Communication.PLC;
public partial class Main
{
public void On(object trigger, string symbol)
{
if (symbol == "SENSOR1")
{
Experior.Core.Motors.Motor.Get("MOTOR1").Start();
}
if (symbol == "SENSOR2")
{
Experior.Core.Assemblies.Assembly.Get("FEEDER1").Activate();
}
}
public void Off(object trigger, string symbol)
{
}
}
For pre-defined script helper methods, you can right-click within the script window to insert the following methods:
Initialize
On (default inserted)
Off (default inserted)
Motor Started
Motor Stopped
Input Changed
Output Changed
Message Received
Telegram Received
Step
Activation
Arrived
Enter (Action Point/Sensor)
Leave (Action Point/Sensor)
Elapsed
Reset
Pause
Continue
Dispose
Dispose:
When you press the “Compile” button in the top left of the script window the Dispose() method is called. You can use this method to unsubscribe from events and perform other clean-up actions.
Note: Since the Dispose() method is called before the compilation happens, it will not be the current version of the Dispose method as that one has not been compiled yet. It will be the Dispose method from the last time you compiled.
To make sure the Dispose method that is called matches the most recent implementation, it is best to compile every time you make changes to your Dispose method.
Initialize:
The Initialize method, runs as soon as compiling the script finishes.
On:
This method is called when:
Receiving input through a connection and the incoming data is of the type bool and its value is “True”.
When a button is pressed in the “Control Panel” window.
When a sensor is activated by a load.
Off:
Same as On, but the value is “False”.
Motor Started:
Is called when a motor is started.
Motor Stopped:
Is called when a motor is stopped.
Input Changed:
This is called when the input changes.
Output Changed:
This is called when the output changes.
Message Received:
Called when a message is received.
Telegram Received:
Called when a telegram is received.
Step:
Called at every frame update.
Activation:
Called when an SRM is created.
Arrived:
Called when a load arrives at a node.
Enter:
Called when a load enters a sensor or actionpoint.
Leave:
Called when a load leaves a sensor or actionpoint.