Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Schneider Electric
Community
Community
Notifications
close
  • Categories
  • Forums
  • Knowledge Center
  • Blogs
  • Ideas
  • Events & Webinars
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register

Contact Support

Close

Ask our Experts

Have a question related to our products, solutions or services? Get quick support on community Forums

Email Us

For Community platform-related support, please email us

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).

Custom connection

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)
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select a Country

Please select a country to continue with beta search.

  • Home
  • Schneider Electric Community
  • Knowledge Center
  • Digital Twin
  • Custom connection
Options
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
Invite a Co-worker
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 Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close

Related Forums

  • Intelligent Devices Forum

Previous Next
Contributors
  • Kasper.Vestrup
    Kasper.Vestrup

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to Digital Twin
Start a Topic
Options
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
0 Likes
266 Views

Link copied. Please paste this link to share this article on your social media post.

Trying to translate this page to your language?
Select your language from the translate dropdown in the upper right. arrow
Translate to: English
  • (Français) French
  • (Deutsche) German
  • (Italiano) Italian
  • (Português) Portuguese
  • (Русский) Russian
  • (Español) Spanish

Custom connection

Kasper.Vestrup Explorer
‎2026-01-15 05:57 AM

It is possible to extend the functionality of Experior with custom communication protocols. This is done by creating your own plugin and extending Experior.Core.Communication.PLC.Connection.

 

In case your connection is TCP/IP based you can extend from Experior.Core.Communication.PLC.TCPIP.Connection.

 

Experior.Core.Communication.PLC.Connection

In attached memcom communication plugin a custom connection is made that doesn’t use the network to communicate but instead uses a memory stream. This plugin can be used to quickly test your Input/Output driven components. You do this by connecting an input and an output through the same address of the memcom connection.

 

For example link the Pushed PLC Input symbol of a button to Byte 1 Bit 0 of the memcom connection and also connect the Lighting PLC output to Byte 1 Bit 0 of the memcom connection. When pressing the button the lamp will light up:

memcom_button.png
memcom_lamp.png

 

The custom connection uses a memory stream to achieve this because a memory stream has similar behavior as a regular network stream.

 

The source code contains some notes explaining how to achieve the same functionality without the memory stream (and just share the data buffer).

 

Whenever the user assigns an input/output from a component to a PLC connection then this input/output is assigned to a PLC Buffer (Experior.Core.Communication.PLC.Buffers.Input/Experior.Core.Communication.PLC.Buffers.Output). These buffers maintain an array of bytes and grows/shrinks whenever new inputs/outputs are added/removed.

 

So in the constructor of the connection we create the buffers and subscribe to the events that are triggered when their size should change or when new inputs/outputs are assigned to them.

 

It is possible to have multiple buffers in a connection. Therefore we distinguish between them in a connection using a unique key (string) the Source.

 

In the example plugin only 1 Input buffer and 1 Output buffer is used, each with a default Source name equal to “0”.

 

In the constructor we also restore the saved buffer in case it exists.

public MemConnection(MemConnectionInfo info)
: base(info)
{
    input = new Core.Communication.PLC.Buffers.Input();

    // first restore the saved outputbuffer if it exists
    if (info.outputs != null && info.outputs.Count > 0)
    {
        output = info.outputs[outslot];
    }
    else output = new Core.Communication.PLC.Buffers.Output();

    //give the input and output buffer a unique slot name
    input.Source = inpslot;
    output.Source = outslot;

    // subscribe to the different events to react upon data changes or to properly allocate the buffers
    output.BufferChanged += new Core.Communication.PLC.Buffers.Output.BufferChangedEvent(OutputDataUpdated);
    input.BufferChanged += new Core.Communication.PLC.Buffers.Input.BufferChangedEvent(InputDataUpdated);
    Experior.Core.Communication.PLC.Connection.Inputs.LengthChanged += new Inputs.LengthChangedEvent(Inputs_LengthChanged);
    Experior.Core.Communication.PLC.Connection.Outputs.LengthChanged += new Outputs.LengthChangedEvent(Outputs_LengthChanged);
    Experior.Core.Communication.PLC.Connection.Outputs.ConnectionedAssigned += new Outputs.OutputEvent(Outputs_ConnectionedAssigned);
    Experior.Core.Communication.PLC.Connection.Outputs.ConnectionedUnAssigned += new Outputs.OutputEvent(Outputs_ConnectionedUnAssigned);
    Experior.Core.Communication.PLC.Connection.Inputs.ConnectionedAssigned += new Inputs.InputEvent(Inputs_ConnectionedAssigned);
    Experior.Core.Communication.PLC.Connection.Inputs.ConnectionedUnAssigned += new Inputs.InputEvent(Inputs_ConnectionedUnAssigned);

    // add sources to the connection
    AddSource(input);
    AddSource(output);

    Experior.Core.Environment.Scene.Loaded += new Core.Environment.Scene.Event(Scene_Loaded);
}

 

When the user assigns an Input/Output to the connection it triggers the Experior.Core.Communication.PLC.Connection.Inputs.ConnectionedAssigned
and  Experior.Core.Communication.PLC.Connection.Outputs.ConnectionedAssigned events.

 

In the example we only use this to set the Source property of the Input/Output

private void Inputs_ConnectionedAssigned(Input sender, Core.Communication.PLC.Connection connection)
{
    if (this != connection)
        return;
        
    // here you can react upon the sender being added to this connection
    // in our case we just want to ensure the proper Source is set
    sender.Source = inpslot;
}

 

Due to the nature of the example connection it is crucial that the Input and Output buffer have the same size so a big part of the source code is related to this.

 

When assigning Inputs/Outputs to a connection Experior verifies whether the buffer size should change and in those cases triggers the Experior.Core.Communication.PLC.Connection.Inputs.LengthChanged
or Experior.Core.Communication.PLC.Connection.Outputs.LengthChanged events.

 

At all times you ask the minimum and maximum used byte of a input/output buffer by providing the connection and the Source of the buffer:

int max = Experior.Core.Communication.PLC.Connection.Inputs.MaxSize(this, inpslot);
int offset = Experior.Core.Communication.PLC.Connection.Inputs.MinSize(this, inpslot);

 

If the buffer is not large enough anymore you can allocate sufficient bytes:

// allocate (max-offset) bytes for the input buffer starting from offset
input.Allocate(max - offset, offset, Experior.Core.Communication.PLC.Buffers.Buffer.Units.SINT);

 

Note: Experior.Core.Communication.PLC.Buffers.Buffer.Units.INT is used to indicate that the given size should be measured in bytes.
In case Experior.Core.Communication.PLC.Buffers.Buffer.Units.SINT is used the size will be measured in words of 16 bits.

 

After the allocation the input.Data property will be an array of bytes with the proper size.
When the user tries to connect the connection the EstablishConnection() method is called.
When he tries to disconnect the Disconnect() method is called.
In our example we override both methods and set the proper state of the connection (Core.Communication.State).
When establishing the connection we make sure that the Input/Output buffers are allocated with the same size.
In case we use a memorystream we also start listening on the stream (similar as we would be on a networkstream).

 

When the states of the Input/Outputs are changed this is immediately reflected in changes of the corresponding Input/Output buffers of the associated connection and the BufferChanged events are triggered.


In our example we write the changed buffer to the memorystream. A different thread reads the memory stream and when the byte array is received it calls the byte[] DataReceived(string source, byte[] data) method of the connection to indicate that the given source has received the given data.

int l = memStream.Read(incoming, 0, incoming.Length);

if (l > 0)
{
    DataReceived(inpslot, incoming);
}

 

This triggers the proper events on the changed Inputs/Outputs.
In the example without the memorystream we simply share the Data of the buffer and directly call the DataReceived method.

 

Experior.Core.Communication.PLC.TCPIP.Connection

This connection class inherits from Experior.Core.Communication.PLC.Connection and mainly adds some TCPIP specific properties like Port, IP address and distinction between server and client connection:
string IP: This getter property is used to get / or set the IPv4 address used by this connection. For a server connection this is 127.0.0.1 (localhost).

 

int Port: This property is used to get or set the port number for the TCPIP connection.

 

bool Server: Getter property to indicate whether this connection is used as server or client.

Labels (2)
Labels:
  • Exp-6 Developer Guide
  • Experior 6
Attachments
MemCom.zip

Link copied. Please paste this link to share this article on your social media post.

You’ve reached the end of your document

WHAT’S NEXT?

Ask our Experts

Didn't find what you are looking for? Ask our experts!

My Dashboard

Check out the new Feeds and activities that are relevant to you.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support

    Ask our Experts

    Have a question related to our products, solutions or services? Get quick support on community Forums

    Email Us

    For Community platform-related support, please email us

Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2026 Schneider Electric

Welcome!

Welcome to your new personalized space.

of

Explore