Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/Tc.Prober/tests/TcProber/PlcTcProberTests/POUs/MAIN.TcPOU
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="MAIN" Id="{6d3b2b34-3b7b-4f9d-b63d-92fd87dfc156}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM MAIN
VAR
InheritanceRw : fbInheritanceLevel_5;
InheritanceRw : fbInheritanceLevel_5;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
<LineIds Name="MAIN">
<LineId Id="2" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbInheritanceLevel_1" Id="{4e2e9ab9-ceb4-435b-b38d-e15082393af6}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbInheritanceLevel_1 EXTENDS fbRootLevelStruct
VAR
{attribute addProperty Name "LEVEL 1"}
level_1 : stAllTypes;
level_1 : stAllTypes;
END_VAR
]]></Declaration>
<Implementation>
Expand Down Expand Up @@ -43,13 +43,5 @@ level_1.DT_val := DT#2106-02-07-6:28:15;
level_1.LTIME_val := LTIME#213503D23H34M33S709MS551US615NS;]]></ST>
</Implementation>
</Method>
<LineIds Name="fbInheritanceLevel_1">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbInheritanceLevel_1.Init">
<LineId Id="5" Count="0" />
<LineId Id="10" Count="21" />
<LineId Id="9" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbInheritanceLevel_2" Id="{59454bff-4d66-4402-b31c-ed00b6954983}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbInheritanceLevel_2 EXTENDS fbInheritanceLevel_1
VAR
{attribute addProperty Name "LEVEL 2"}
level_2 : stAllTypes;
level_2 : stAllTypes;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -19,11 +19,5 @@ END_VAR
<ST><![CDATA[SUPER^.Init();]]></ST>
</Implementation>
</Method>
<LineIds Name="fbInheritanceLevel_2">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbInheritanceLevel_2.Init">
<LineId Id="5" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbInheritanceLevel_3" Id="{0cf8711d-2409-47a3-aeff-3b639be91487}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbInheritanceLevel_3 EXTENDS fbInheritanceLevel_2
VAR
{attribute addProperty Name "LEVEL 3"}
level_3 : stAllTypes;
level_3 : stAllTypes;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -19,11 +19,5 @@ END_VAR
<ST><![CDATA[SUPER^.Init();]]></ST>
</Implementation>
</Method>
<LineIds Name="fbInheritanceLevel_3">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbInheritanceLevel_3.Init">
<LineId Id="5" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbInheritanceLevel_4" Id="{ba63cbe9-92bb-4b9b-8666-6c548873f4d8}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbInheritanceLevel_4 EXTENDS fbInheritanceLevel_3
VAR
{attribute addProperty Name "LEVEL 4"}
level_4 : stAllTypes;
level_4 : stAllTypes;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -19,11 +19,5 @@ END_VAR
<ST><![CDATA[SUPER^.Init();]]></ST>
</Implementation>
</Method>
<LineIds Name="fbInheritanceLevel_4">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbInheritanceLevel_4.Init">
<LineId Id="5" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbInheritanceLevel_5" Id="{74807b99-3731-41e6-9f64-0e44d94b184c}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbInheritanceLevel_5 EXTENDS fbInheritanceLevel_4
VAR
{attribute addProperty Name "LEVEL 5"}
level_5 : stAllTypes;
level_5 : stAllTypes;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -19,11 +19,5 @@ END_VAR
<ST><![CDATA[SUPER^.Init();]]></ST>
</Implementation>
</Method>
<LineIds Name="fbInheritanceLevel_5">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbInheritanceLevel_5.Init">
<LineId Id="5" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbRootLevelStruct" Id="{99be50ca-7041-4b7d-adb9-e2b1fd3c10ba}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbRootLevelStruct
VAR
{attribute addProperty Name "LEVEL 0"}
level_0 : stAllTypes;
level_0 : stAllTypes;
END_VAR

VAR CONSTANT
Expand Down Expand Up @@ -44,12 +44,5 @@ level_0.DT_val := DT#1970-01-01-00:00;
level_0.LTIME_val := LTIME#0S;]]></ST>
</Implementation>
</Method>
<LineIds Name="fbRootLevelStruct">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbRootLevelStruct.Init">
<LineId Id="33" Count="21" />
<LineId Id="31" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbBasicRunnerTests" Id="{fd9c95ca-8e53-463c-8da7-85668c18933c}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbBasicRunnerTests
VAR
Expand Down Expand Up @@ -38,18 +38,5 @@ END_VAR
<ST><![CDATA[RunUntilReturnsTrue := _m; ]]></ST>
</Implementation>
</Method>
<LineIds Name="fbBasicRunnerTests">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbBasicRunnerTests.ResetCounter">
<LineId Id="34" Count="0" />
</LineIds>
<LineIds Name="fbBasicRunnerTests.RunCount">
<LineId Id="5" Count="0" />
<LineId Id="11" Count="0" />
</LineIds>
<LineIds Name="fbBasicRunnerTests.RunUntilReturnsTrue">
<LineId Id="11" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.4">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="fbRecorderRunnerTests" Id="{00761f1f-400a-4359-962b-f4cbcfef3f3d}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK fbRecorderRunnerTests
VAR
_recorder : stRecorder;
_recorder : stRecorder;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -27,14 +27,5 @@ METHOD RunWithRecorder : INT
<ST><![CDATA[RunWithRecorder := _recorder.counter;]]></ST>
</Implementation>
</Method>
<LineIds Name="fbRecorderRunnerTests">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="fbRecorderRunnerTests.ResetCounter">
<LineId Id="34" Count="0" />
</LineIds>
<LineIds Name="fbRecorderRunnerTests.RunWithRecorder">
<LineId Id="34" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ public partial class App : Application
public App() : base()
{
TcoCore.Threading.Dispatcher.SetDispatcher(TcoCore.Wpf.Threading.Dispatcher.Get);
PlcAppExamples.Connector.BuildAndStart().ReadWriteCycleDelay = 100;


PlcAppExamples.Connector.ReadWriteCycleDelay = 100;
PlcAppExamples.Connector.BuildAndStart();
}

public static PlcAppExamplesTwinController PlcAppExamples { get { return Entry.PlcAppExamples; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:plcappexamples="clr-namespace:PlcAppExamples"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:vortex="http://vortex.mts/xaml"
xmlns:vortex="http://vortex.mts/xaml" xmlns:nonframeworkcomponentuse="clr-namespace:TcoApplicationExamples.Wpf.NonFrameworkComponentUse"
Title="MainWindow"
DataContext="{x:Static local:App.PlcAppExamples}"
WindowStartupLocation="CenterOwner"
Expand Down Expand Up @@ -101,7 +101,9 @@
</TabItem>
</TabControl>
</TabItem>

<TabItem Header="Non framework use of components">
<nonframeworkcomponentuse:NFComponentUse></nonframeworkcomponentuse:NFComponentUse>
</TabItem>
</TabControl>
</Grid>
</Window>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<UserControl
x:Class="TcoApplicationExamples.Wpf.NonFrameworkComponentUse.NFComponentUse"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:inxton="http://inxton.mts/xaml"
xmlns:local="clr-namespace:TcoApplicationExamples.Wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml"
xmlns:vortex="http://vortex.mts/xaml"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignWidth="800"
DataContext="{x:Static local:App.PlcAppExamples}">
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="50*" />
<RowDefinition Height="50*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<mdxam:MarkdownScrollViewer
Grid.ColumnSpan="2"
MarkdownStyleName="Sasabune"
xml:space="preserve">
# Use of component without TcOpen framework
This example demostrates the use of TcOpen component outside TcOpen Framework.
The single requirement is to have a [Context](https://docs.tcopengroup.org/api/TcoCore/TcoCore.TcoContext.PlcTcoContext.html) defined, as demostrated in `NF_MAIN` PRG block.
The instance of this context is then passed into FB_init of a TcOpen component (in the example piston).
Context must be opened at the beginning of the PLC cycle and closed at the end in our example `_context.VolatileOpen()`
and `_context.VolatileClose()`. Between the these two methods must be places all application logic.

</mdxam:MarkdownScrollViewer>
<vortex:RenderableContentControl
Grid.Row="1"
Margin="10"
DataContext="{Binding NF_MAIN._logic, Mode=OneWay}"
PresentationType="Service-Manual" />
<inxton:DynamicTreeView
Grid.Row="1"
Grid.Column="1"
DataContext="{Binding NF_MAIN}" />
<Image
Grid.Row="2"
Grid.ColumnSpan="2"
Margin="10"
Source="pack://siteoforigin:,,,/assets/nfuse.PNG" />
</Grid>
</ScrollViewer>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TcoApplicationExamples.Wpf.NonFrameworkComponentUse
{
/// <summary>
/// Interaction logic for NFComponentUse.xaml
/// </summary>
public partial class NFComponentUse : UserControl
{
public NFComponentUse()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<None Remove="assets\nfuse.PNG" />
<None Remove="Tutorial\401_ConnectingDots\Images\100-800.PNG" />
</ItemGroup>
<ItemGroup>
Expand All @@ -15,6 +16,9 @@
<PackageReference Include="MdXaml" Version="1.10.0" />
</ItemGroup>
<ItemGroup>
<Content Include="assets\nfuse.PNG">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Tutorial\401_ConnectingDots\Images\100-800.PNG">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion src/TcoApplicationExamples/TcoApplicationExamples.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@
"solution": {
"path": "..\\..\\TcOpen.sln",
"projects": [
"src\\TcoCore\\src\\TcoCore.Wpf\\TcoCore.Wpf.csproj",
"src\\TcoCore\\src\\TcoCoreConnector\\TcoCoreConnector.csproj",
"src\\TcoCore\\src\\XaeTcoCore\\XaeTcoCore.tsproj",
"src\\TcoCore\\tests\\TcoCore.Sandbox.Wpf\\TcoCore.Sandbox.Wpf.csproj",
"src\\TcoCore\\tests\\TcoCoreExamplesConnector\\TcoCoreExamplesConnector.csproj",
"src\\TcoCore\\tests\\TcoCoreTestsConnector\\TcoCoreTestsConnector.csproj",
"src\\TcoCore\\tests\\TcoCoreUnitTests\\TcoCoreUnitTests.csproj",
"src\\TcoCore\\tests\\TcoTestRunners\\TcoTestRunners.csproj",
"src\\TcoPneumatics\\src\\TcoPneumatics.Wpf\\TcoPneumatics.Wpf.csproj",
"src\\TcoPneumatics\\src\\TcoPneumaticsConnector\\TcoPneumaticsConnector.csproj",
"src\\TcoPneumatics\\src\\XaeTcoPneumatics\\XaeTcoPneumatics.tsproj",
"src\\TcoPneumatics\\tests\\Sandbox\\PlcOpen.Wpf.Sandbox\\TcoPneumatics.Wpf.Sandbox.csproj",
"src\\TcoPneumatics\\tests\\TcoPneumaticsTestsConnector\\TcoPneumaticsTestsConnector.csproj",
"src\\TcoPneumatics\\tests\\TcoPneumaticsTests_nUnit\\TcoPneumaticsTests_nUnit.csproj",
"src\\TcoApplicationExamples\\PlcAppExamplesConnector\\PlcAppExamplesConnector.csproj",
"src\\TcoApplicationExamples\\TcoApplicationExamples.Wpf\\TcoApplicationExamples.Wpf.csproj",
"src\\TcoApplicationExamples\\XaeAppExamples\\XaeAppExamples.tsproj"
"src\\TcoApplicationExamples\\XaeAppExamples\\XaeAppExamples.tsproj"
]
}
}
Loading