Compare commits
No commits in common. "81643249b9d00a37507cb0f9954b7a8c2672e8e2" and "2addea3c1750b8929a45fbd7b98797e5a03248a0" have entirely different histories.
81643249b9
...
2addea3c17
Binary file not shown.
Before Width: | Height: | Size: 8.4 KiB |
BIN
Icons/reset.png
BIN
Icons/reset.png
Binary file not shown.
Before Width: | Height: | Size: 43 KiB |
|
@ -7,14 +7,8 @@
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Icons\connect.png" />
|
|
||||||
<None Remove="Icons\reset.png" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.6.0" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -24,9 +18,4 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Resource Include="Icons\connect.png" />
|
|
||||||
<Resource Include="Icons\reset.png" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,50 +1,44 @@
|
||||||
<UserControl x:Class="LibS7Adv.PLCControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<UserControl x:Class="LibS7Adv.PLCControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:LibS7Adv"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:LibS7Adv">
|
||||||
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" >
|
|
||||||
|
|
||||||
<UserControl.DataContext>
|
<UserControl.DataContext>
|
||||||
<local:PLCViewModel />
|
<local:PLCViewModel />
|
||||||
</UserControl.DataContext>
|
</UserControl.DataContext>
|
||||||
|
|
||||||
<UserControl.Resources>
|
|
||||||
|
|
||||||
<!-- Style for Connect/Disconnect Button -->
|
|
||||||
<Style x:Key="ConnectDisconnectButtonStyle" TargetType="Button">
|
|
||||||
<Setter Property="Background" Value="Transparent" />
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
|
||||||
<Setter Property="Background" Value="LightGreen" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
</UserControl.Resources>
|
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel>
|
<Grid.RowDefinitions>
|
||||||
<xctk:PropertyGrid MinWidth="300" x:Name="PanelEdicion" AutoGenerateProperties="True"
|
<RowDefinition Height="*" />
|
||||||
SelectedObject="{Binding PlcData}" ShowDescriptionByTooltip="True" ShowSearchBox="False"
|
<RowDefinition Height="*" />
|
||||||
ShowSortOptions="False" ForceCursor="True" Margin="5,5,5,5" NameColumnWidth="100" />
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Label Content="IP:" Grid.Row="0" Grid.Column="0" Margin="1" VerticalAlignment="Center" />
|
||||||
|
<TextBox Text="{Binding IP}" Grid.Row="0" Grid.Column="1" Margin="1"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
|
||||||
|
<Label Content="Name:" Grid.Row="1" Grid.Column="0" Margin="1" VerticalAlignment="Center" />
|
||||||
|
<TextBox Text="{Binding Name}" Grid.Row="1" Grid.Column="1" Margin="1"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
|
||||||
|
<Button Content="Connect" Command="{Binding ConnectCommand}" Grid.Row="2" Grid.Column="0" Margin="1"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
<Button Content="Disconnect" Command="{Binding DisconnectCommand}" Grid.Row="2" Grid.Column="1" Margin="1"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
|
||||||
|
<Label Content="Status:" Grid.Row="3" Grid.Column="0" Margin="1" VerticalAlignment="Center" />
|
||||||
|
<Label Content="{Binding ConnectionStatus}" Grid.Row="3" Grid.Column="1" Margin="1" VerticalAlignment="Center" />
|
||||||
|
<Label Grid.Row="4" Grid.Column="0" Margin="1" VerticalAlignment="Center">
|
||||||
|
Last Error:
|
||||||
|
</Label>
|
||||||
|
<Label Grid.Row="4" Grid.Column="1" Margin="1" VerticalAlignment="Center" HorizontalAlignment="Stretch">
|
||||||
|
<TextBlock Text="{Binding LastError}" TextWrapping="Wrap" Padding="3" />
|
||||||
|
</Label>
|
||||||
|
|
||||||
<ToolBarTray>
|
|
||||||
<ToolBar>
|
|
||||||
<Button Command="{Binding ConnectButtonCommand}" ToolTip="Conectar PLC"
|
|
||||||
Style="{StaticResource ConnectDisconnectButtonStyle}">
|
|
||||||
<StackPanel>
|
|
||||||
<Image Source="Icons/connect.png" Width="24" Height="24" />
|
|
||||||
<TextBlock Text="Conectar" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
<Button Command="{Binding ResetAlarmButtonCommand}" ToolTip="Reset Alarm"
|
|
||||||
>
|
|
||||||
<StackPanel>
|
|
||||||
<Image Source="Icons/reset.png" Width="24" Height="24" />
|
|
||||||
<TextBlock Text="Reset" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
</ToolBar>
|
|
||||||
</ToolBarTray>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
172
PLCViewModel.cs
172
PLCViewModel.cs
|
@ -3,55 +3,18 @@ using CommunityToolkit.Mvvm.Input;
|
||||||
using Siemens.Simatic.Simulation.Runtime;
|
using Siemens.Simatic.Simulation.Runtime;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.ComponentModel;
|
using System.Text.RegularExpressions;
|
||||||
using Newtonsoft.Json.Linq;
|
using System.Threading.Tasks;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using Siemens.Simatic.Simulation.Runtime;
|
||||||
|
|
||||||
namespace LibS7Adv
|
namespace LibS7Adv
|
||||||
{
|
{
|
||||||
[DisplayName("PLC Advanced Setup:")]
|
|
||||||
public partial class PlcData : ObservableObject
|
|
||||||
{
|
|
||||||
[ObservableProperty]
|
|
||||||
[property: Description("IP of the PLC")]
|
|
||||||
[property: Category("Connection:")]
|
|
||||||
string iP = "10.1.30.11";
|
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
[property: Description("Name of the instance at the PLC Advanced")]
|
|
||||||
[property: Category("Connection:")]
|
|
||||||
string name = "PLC Name";
|
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
[property: Description("CPU Info")]
|
|
||||||
[property: Category("Status:")]
|
|
||||||
[property: ReadOnly(true)]
|
|
||||||
string cpuTime;
|
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
[property: Display(Name = "Status")]
|
|
||||||
[property: Description("CPU Status")]
|
|
||||||
[property: Category("Status:")]
|
|
||||||
[property: ReadOnly(true)]
|
|
||||||
string connectionStatus;
|
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
[property: Description("API Error")]
|
|
||||||
[property: Category("Status:")]
|
|
||||||
[property: ReadOnly(true)]
|
|
||||||
string lastError;
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class PLCViewModel : ObservableObject
|
public partial class PLCViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
private IInstance Instance { get; set; }
|
private IInstance Instance { get; set; }
|
||||||
|
|
||||||
private bool IsConfigured { get; set; }
|
private bool IsConfigured { get; set; }
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
PlcData plcData = new PlcData();
|
|
||||||
|
|
||||||
public PLCViewModel()
|
public PLCViewModel()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -60,69 +23,69 @@ namespace LibS7Adv
|
||||||
public void ucLoaded()
|
public void ucLoaded()
|
||||||
{
|
{
|
||||||
IsConnected = false;
|
IsConnected = false;
|
||||||
PlcData.LastError = "";
|
lastError = "";
|
||||||
PlcData.ConnectionStatus = "offline";
|
connectionStatus = "offline";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
string iP = "10.1.30.11";
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
string name = "PLC Name";
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
string cpuTime;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
string connectionStatus;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
string lastError;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
[property: JsonIgnore]
|
[property: JsonIgnore]
|
||||||
bool isConnected;
|
bool isConnected;
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
[property: JsonIgnore]
|
[property: JsonIgnore]
|
||||||
public void ResetAlarmButton()
|
|
||||||
{
|
|
||||||
PlcData.LastError = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
[RelayCommand]
|
|
||||||
[property: JsonIgnore]
|
|
||||||
public void ConnectButton()
|
|
||||||
{
|
|
||||||
if (isConnected)
|
|
||||||
Disconnect();
|
|
||||||
else
|
|
||||||
Connect();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Connect()
|
public void Connect()
|
||||||
{
|
{
|
||||||
if (IsConnected)
|
|
||||||
return;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Implementa la conexión utilizando PLCModel
|
// Implementa la conexión utilizando PLCModel
|
||||||
Instance = SimulationRuntimeManager.CreateInterface(PlcData.Name);
|
Instance = SimulationRuntimeManager.CreateInterface(Name);
|
||||||
Instance.OnSoftwareConfigurationChanged += Instance_OnSoftwareConfigurationChanged;
|
Instance.OnSoftwareConfigurationChanged += Instance_OnSoftwareConfigurationChanged;
|
||||||
//_plcModel.Instance.CommunicationInterface = ECommunicationInterface.Softbus;
|
//_plcModel.Instance.CommunicationInterface = ECommunicationInterface.Softbus;
|
||||||
|
|
||||||
if (Instance != null)
|
if (Instance != null)
|
||||||
{
|
{
|
||||||
UpdateTagList();
|
UpdateTagList();
|
||||||
PlcData.ConnectionStatus = Instance.OperatingState.ToString();
|
ConnectionStatus = Instance.OperatingState.ToString();
|
||||||
IsConnected = true;
|
IsConnected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = ex.Message;
|
LastError = ex.Message;
|
||||||
PlcData.ConnectionStatus = "offline";
|
ConnectionStatus = "offline";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disconnect()
|
|
||||||
{
|
|
||||||
IsConnected = false;
|
|
||||||
PlcData.ConnectionStatus = "offline";
|
|
||||||
Instance = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void Instance_OnSoftwareConfigurationChanged(IInstance instance, SOnSoftwareConfigChangedParameter event_param)
|
private void Instance_OnSoftwareConfigurationChanged(IInstance instance, SOnSoftwareConfigChangedParameter event_param)
|
||||||
{
|
{
|
||||||
UpdateTagList();
|
UpdateTagList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
[property: JsonIgnore]
|
||||||
|
public void Disconnect()
|
||||||
|
{
|
||||||
|
IsConnected = false;
|
||||||
|
ConnectionStatus = "offline";
|
||||||
|
Instance = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void UpdateTagList()
|
public void UpdateTagList()
|
||||||
{
|
{
|
||||||
IsConfigured = false;
|
IsConfigured = false;
|
||||||
|
@ -133,7 +96,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = ex.Message;
|
LastError = ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +106,7 @@ namespace LibS7Adv
|
||||||
{
|
{
|
||||||
if (!isConnected)
|
if (!isConnected)
|
||||||
{
|
{
|
||||||
PlcData.LastError = "Not Connected";
|
LastError = "Not Connected";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (sTag == null)
|
if (sTag == null)
|
||||||
|
@ -165,7 +128,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = sTag + ":" + ex.Message;
|
LastError = sTag + ":" + ex.Message;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,7 +139,7 @@ namespace LibS7Adv
|
||||||
{
|
{
|
||||||
if (!isConnected)
|
if (!isConnected)
|
||||||
{
|
{
|
||||||
PlcData.LastError = "Not Connected";
|
LastError = "Not Connected";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (sTag == null)
|
if (sTag == null)
|
||||||
|
@ -189,7 +152,7 @@ namespace LibS7Adv
|
||||||
else if (tag.tagType == EDataType.Bool)
|
else if (tag.tagType == EDataType.Bool)
|
||||||
{
|
{
|
||||||
if (tag.areaType == EArea.Input)
|
if (tag.areaType == EArea.Input)
|
||||||
Instance?.InputArea.WriteBit(tag.word_offset, tag.bit, Value);
|
Instance?.OutputArea.WriteBit(tag.word_offset, tag.bit, Value);
|
||||||
if (tag.areaType == EArea.Output)
|
if (tag.areaType == EArea.Output)
|
||||||
Instance?.OutputArea.WriteBit(tag.word_offset, tag.bit, Value);
|
Instance?.OutputArea.WriteBit(tag.word_offset, tag.bit, Value);
|
||||||
if (tag.areaType == EArea.Marker)
|
if (tag.areaType == EArea.Marker)
|
||||||
|
@ -199,19 +162,19 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = sTag + ":" + ex.Message;
|
LastError = sTag + ":" + ex.Message;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string? LeerNumber(string sTag, bool Signed = false)
|
public string? LeerNumber(string sTag)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!isConnected)
|
if (!isConnected)
|
||||||
{
|
{
|
||||||
PlcData.LastError = "Not Connected";
|
LastError = "Not Connected";
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (sTag == null)
|
if (sTag == null)
|
||||||
|
@ -227,51 +190,26 @@ namespace LibS7Adv
|
||||||
{
|
{
|
||||||
// Read not Work for ImputArea
|
// Read not Work for ImputArea
|
||||||
if (tag.areaType == EArea.Output)
|
if (tag.areaType == EArea.Output)
|
||||||
{
|
return Instance?.OutputArea.ReadByte(tag.word_offset).ToString();
|
||||||
var val = Instance?.OutputArea.ReadByte(tag.word_offset);
|
|
||||||
if (Signed)
|
|
||||||
return val > 127 ? (val - 256).ToString() : val.ToString();
|
|
||||||
return val.ToString();
|
|
||||||
}
|
|
||||||
if (tag.areaType == EArea.Marker)
|
if (tag.areaType == EArea.Marker)
|
||||||
{
|
return Instance?.MarkerArea.ReadByte(tag.word_offset).ToString();
|
||||||
var val = Instance?.MarkerArea.ReadByte(tag.word_offset);
|
|
||||||
if (Signed)
|
|
||||||
return val > 127 ? (val-256).ToString() : val.ToString();
|
|
||||||
return val.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (tag.tagType == EDataType.Word)
|
else if (tag.tagType == EDataType.Word)
|
||||||
{
|
{
|
||||||
// Read not Work for ImputArea
|
// Read not Work for ImputArea
|
||||||
if (tag.areaType == EArea.Output)
|
if (tag.areaType == EArea.Output)
|
||||||
{
|
return Instance?.OutputArea.ReadBytes(tag.word_offset,2).ToString();
|
||||||
int value;
|
|
||||||
byte[] bytes = Instance?.OutputArea.ReadBytes(tag.word_offset, 2);
|
|
||||||
Array.Reverse(bytes);
|
|
||||||
if (Signed)
|
|
||||||
value = BitConverter.ToInt16(bytes, 0);
|
|
||||||
else
|
|
||||||
value = BitConverter.ToUInt16(bytes, 0);
|
|
||||||
return value.ToString();
|
|
||||||
}
|
|
||||||
if (tag.areaType == EArea.Marker)
|
if (tag.areaType == EArea.Marker)
|
||||||
{
|
{
|
||||||
int value;
|
|
||||||
byte[] bytes = Instance?.MarkerArea.ReadBytes(tag.word_offset, 2);
|
byte[] bytes = Instance?.MarkerArea.ReadBytes(tag.word_offset, 2);
|
||||||
Array.Reverse(bytes);
|
return (bytes[0] + bytes[1]*256).ToString();
|
||||||
if (Signed)
|
|
||||||
value = BitConverter.ToInt16(bytes, 0);
|
|
||||||
else
|
|
||||||
value = BitConverter.ToUInt16(bytes, 0);
|
|
||||||
return value.ToString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = sTag + ":" + ex.Message;
|
LastError = sTag + ":" + ex.Message;
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,7 +224,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = ex.Message;
|
LastError = ex.Message;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,7 +237,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = ex.Message;
|
LastError = ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EscribirTag(string pTag, SDataValue Value)
|
public void EscribirTag(string pTag, SDataValue Value)
|
||||||
|
@ -310,7 +248,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = pTag + ":" + ex.Message;
|
LastError = pTag + ":" + ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public SDataValue LeerTag(string pTag)
|
public SDataValue LeerTag(string pTag)
|
||||||
|
@ -321,7 +259,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = pTag + ":" + ex.Message;
|
LastError = pTag + ":" + ex.Message;
|
||||||
return new SDataValue();
|
return new SDataValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,7 +271,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = pTag + ":" + ex.Message;
|
LastError = pTag + ":" + ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EscribirTagInt16(string pTag, int pValue)
|
public void EscribirTagInt16(string pTag, int pValue)
|
||||||
|
@ -344,7 +282,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = pTag + ":" + ex.Message;
|
LastError = pTag + ":" + ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +294,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = pTag + ":" + ex.Message;
|
LastError = pTag + ":" + ex.Message;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,7 +307,7 @@ namespace LibS7Adv
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
PlcData.LastError = pTag + ":" + ex.Message;
|
LastError = pTag + ":" + ex.Message;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue