Hello everyone, and welcome to this video tutorial.
My name is Tomas, and I am a member of the Inxton developer team.
In the previous video chapter, we dealt with the Core package.
This package offers basics as the Inxton builder and the rest has to be made manually.
In this chapter, we move on to the Essentials package
with its feature such as autogenerated visualization.
From this package up to the highest, we will use only WPF technology 
as it has a very strong data-binding mechanism.
collaborating with a simple C# console application using Inxton.
Before we could start please check if you meet the prerequisites,
which are:
1.) Visual Studio installed,
2.) Twincat 3 Engineering installed,
3.) .NET Framework developer pack installed,
4.) Inxton Vortex Builder extension installed and
5.) Valid developer licence, which is free of charge.
To check minimal versions supported, please have a look at
www.inxton.com
or
www.github.com/inxton.
You could also find there video tutorials for
installation and activation of the developer licence.
So assuming meeting the requirements,
run the visual studio,  
Create new Twincat project called InxtonEssentials
in the folder C:\WORK\INXTON_ESSENTIALS\201_EssentialsAutoGeneratedUI.
Create a new Standard PLC project and name it MainPlc.
Add a new function block called fbPneumaticActuator.
Add two input boolean variables inRetracted and inExtended.
These variables will be fed by the values of end position sensors of the pneumatic actuator.
Add two output boolean variables outRetract and outExtend.
These variables will feed the coils of the valve of the pneumatic actuator.
Add two internal boolean variables _manualRetract and _manualExtend.
These variables will trigger the movements in the manual mode.
To be able to test it without hardware add another internal variable _simulatedPosition.
Add the method Extend that sets the outputs accordingly
and returns the value of the inExtended variable.
Add the method Retract that sets the outputs accordingly 
and returns the value of the inRetracted variable.
Add the method Manual that will call individual movements.
Add the method SimulateInputs and rewrite the code
 to be able to run this example without the real hardware.
Close and save it.
In the main program, create an instance of the fbPneumaticActuator
and add the calls of its methods Manual() and SimulateInputs().
Close and save it.
Add a new project of the type WPF App for .NET framework and name it MainPlcHMI.
Add a new project of the type class library for .NET framework
and name it MainPlcConnector.
In the project MainPlcHMI, add the reference to the project MainPlcConnector.
From the feed: nuget.org,
Install the Inxton.Package.Vortex.Essentials into both projects,
MainPlcHMI and MainPlcConnector.
Install also the Inxton.Package.Vortex.Essentials.Wpf
into the project MainPlcHMI.
After successful installation, run the Inxton builder.
Set localization resources to internal.
In the MainPlcConnector project, rename Class1 to Entry.
Add define #LOCAL directive in the class Entry to change AmsId from remote to local.
Add the namespace Vortex.Adapters.Conector.Tc3.Adapter.
Rename the namespace to match the PLC project name, in our case MainPlc.
Change class declaration to static.
Create constants AmsId, and Port and initiate them with the values of your target hardware.
Create an instance of the .Net twin and pass the connection constants into.
Close and save it.
Open the file App.xaml.cs and add namespace MainPlc.
Add a call of the method BuildAndStart().
Close and save it.
Open the file MainWindow.xaml.
Add the namespace MainPlc from the assembly MainPlcConnector.
Add the vortex XAML namespace.
Set the data context of the window to the MainPlc object.
Add the item RenderableContentControl and bind it to the MAIN._fbPneumaticActuator.
Set the presentation type to control.
Build and save the complete solution.
Now you can see the result of the autogenerated UI.
 
Activate configuration and start the PLC.
Run the application.
You can test now the behaviour by clicking manualRetract and manualExtend buttons.
OK, so that was all for this video tutorial.
The complete project is downloadable at www.github.com/inxton, in the tutorial section.
Just to be sure here is the link:
Thank you for your attention, and I look forward to the next tutorials. 
If you have some troubles,
please feel free to write an email to 
hello@inxton.com.
