change-烘干机设备监控修改

dev
liuwf 3 months ago
parent 9104c85db1
commit e15e293055

@ -13,10 +13,10 @@
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="White" BorderThickness="0.4" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid >
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal" >
<Ellipse x:Name="StatusLight" Width="50" Height="50" Fill="Green"/>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" >
<!--<Ellipse x:Name="StatusLight" Width="50" Height="50" Fill="Green"/>
<Label Content="系统运行状态:" Foreground="White" FontSize="40" Margin="0 0 10 0"/>
<TextBox Text="正在进料" Width="200" Foreground="White" FontSize="40"/>
<TextBox Text="正在进料" Width="200" Foreground="White" FontSize="40"/>-->
<Button x:Name="StartButton" Content="一键启动" FontSize="30" Background="LimeGreen" Width="180" Height="60" Margin="100 0 20 0" Click="StartButton_Click"/>
<Button x:Name="StopButton" Content="一键停止" FontSize="30" Background="OrangeRed" Width="180" Height="60" Margin="0,0,20,0" Click="StopButton_Click"/>
<Button x:Name="StopUrgentButton" Content="急停" FontSize="30" Background="Yellow" Width="150" Height="60" Margin="0,0,0,0" Click="StopUrgentButton_Click"/>
@ -68,18 +68,90 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="烘干机设备监控" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<DataGrid Grid.Row="1" ItemsSource="{Binding HotDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="监听点位" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Value}" Header="监听值" Width="2*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal1_1" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机螺旋状态:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal1_1_Value" Text="停止" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal1_2" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机传动启动" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal2_1" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机风机状态:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal2_1_Value" Text="停止" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal2_2" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机风机启动" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal3_1" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机燃烧机状态:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal3_1_Value" Text="停止" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal3_2" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机燃烧启动" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal4_1" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="烘干机燃烧机运行" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal4_2" VerticalAlignment="Center" Width="30" Height="30" Fill="Green"/>
<TextBlock Text="烘干机存在报警" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="6" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse Width="30" Height="30" Visibility="Hidden"/>
<TextBlock Text="烘干机烘干温度:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal5_1_Value" Text="0.00" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse Width="30" Height="30" Visibility="Hidden"/>
<TextBlock Text="烘干机加热温度:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal5_2_Value" Text="0.00" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="5" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse Width="30" Height="30" Visibility="Hidden"/>
<TextBlock Text="烘干机出气温度:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal6_1_Value" Text="0.00" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse Width="30" Height="30" Visibility="Hidden"/>
<TextBlock Text="烘干机输出百分百:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal6_2_Value" Text="0.00" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal7_1" VerticalAlignment="Center" Width="30" Height="30" Fill="Green"/>
<TextBlock Text="烘干机堵料报警" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="HotSignal7_2" VerticalAlignment="Center" Width="30" Height="30" Fill="Green"/>
<TextBlock Text="烘干机报警:" FontSize="20" VerticalAlignment="Center" Width="170" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="HotSignal7_2_Value" Text="无" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
</Grid>
<StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal" >
<Button x:Name="StartDryerSpiralButton" Content="螺旋启动" FontSize="25" Background="LimeGreen" Width="120" Height="40" Margin="0 0 20 0" Click="StartDryerSpiralButton_Click"/>
@ -133,18 +205,6 @@
</StackPanel>
</Grid>
<!--<DataGrid ItemsSource="{Binding MagNetDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Left"
Foreground="#FFFFFF" Margin="150,41,0,0" Grid.RowSpan="2" >
--><!--resourceStyle 399行修改选中字体颜色--><!--
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="监听点位" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Value}" Header="监听值" Width="2*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>-->
<StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal" >
<Button x:Name="StartMagNetButton" Content="磁选启动" FontSize="25" Background="LimeGreen" Width="150" Height="40" Margin="0 0 20 0" Click="StartMagNetButton_Click"/>
@ -192,13 +252,13 @@
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="SpiralSignal6" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="螺旋1速度反馈" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="SpiralSignal6_Value" Text="0" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
<TextBlock Text="螺旋1速度反馈:" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="SpiralSignal6_Value" Text="0.00" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="SpiralSignal7" VerticalAlignment="Center" Width="30" Height="30" Fill="Red"/>
<TextBlock Text="螺旋2速度反馈" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="SpiralSignal7_Value" Text="0" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
<TextBlock Text="螺旋2速度反馈:" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
<TextBlock x:Name="SpiralSignal7_Value" Text="0.00" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 0">
<Ellipse x:Name="SpiralSignal4" VerticalAlignment="Center" Width="30" Height="30" Fill="Green"/>
@ -209,19 +269,6 @@
<TextBlock Text="螺旋2变频器报警" FontSize="20" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="White"/>
</StackPanel>
</Grid>
<!--<DataGrid Grid.Row="1" ItemsSource="{Binding SpiralDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#FFFFFF" >
--><!--resourceStyle 399行修改选中字体颜色--><!--
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="监听点位" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Value}" Header="监听值" Width="2*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>-->
<StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal" >
<Button x:Name="StartSpiral1Button" Content="螺旋1启动" FontSize="25" Background="LimeGreen" Width="150" Height="40" Margin="0 0 20 0" Click="StartSpiral1Button_Click"/>

@ -69,7 +69,9 @@ namespace SlnMesnac.WPF.Page
Thread.Sleep(2000);
RefreshMagNet();
RefreshSpiral();
}catch(Exception ex)
RefreshHot();
}
catch(Exception ex)
{
_logger.LogError($"设备参数监听StartMachineLisening()异常:{ex.Message}");
}
@ -886,6 +888,101 @@ namespace SlnMesnac.WPF.Page
/// <summary>
/// 烘干机参数监控
/// </summary>
private async void RefreshHot()
{
try
{
int signal1_1 = plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机螺旋状态"));
int signal2_1= plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机风机状态"));
int signal3_1 = plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机燃烧机状态"));
bool signal1_2 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机反馈传动启动"));
bool signal2_2 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机反馈风机启动"));
bool signal3_2 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机反馈燃烧启动"));
bool signal4_1 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机燃烧机运行"));
bool signal14_2 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机存在报警"));
int signal8 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机烘干温度"));
int signal9 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机加热温度"));
int signal10 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机出气温度"));
int signal11 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机输出百分比"));
bool signal7_1 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机堵料报警"));
int signal7_2 = plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机报警"));
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
HotSignal1_1.Fill = signal1_1==2 ? Brushes.Green : Brushes.Red;
HotSignal1_1_Value.Text = ChangeHotStatus(signal1_1);
HotSignal2_1.Fill = signal2_1 == 2 ? Brushes.Green : Brushes.Red;
HotSignal2_1_Value.Text = ChangeHotStatus(signal2_1);
HotSignal3_1.Fill = signal3_1 == 2 ? Brushes.Green : Brushes.Red;
HotSignal3_1_Value.Text = ChangeHotStatus(signal3_1);
HotSignal1_2.Fill = signal1_2 ? Brushes.Green : Brushes.Red;
HotSignal2_2.Fill = signal2_2 ? Brushes.Green : Brushes.Red;
HotSignal3_2.Fill = signal3_2 ? Brushes.Green : Brushes.Red;
HotSignal4_1.Fill = signal4_1 ? Brushes.Green : Brushes.Red;
HotSignal4_2.Fill = signal14_2 ? Brushes.Red : Brushes.Green;
HotSignal5_1_Value.Text = ((double)signal8 / 10).ToString();
HotSignal5_2_Value.Text = ((double)signal9 / 10).ToString();
HotSignal6_1_Value.Text = ((double)signal10 / 10).ToString();
HotSignal6_2_Value.Text = signal11.ToString();
HotSignal7_1.Fill = signal7_1 ? Brushes.Red : Brushes.Green;
HotSignal7_2.Fill = signal7_2 == 0 ? Brushes.Green : Brushes.Red;
HotSignal7_2_Value.Text = ChangeHotWarn(signal7_2);
}));
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
}
}
private string ChangeHotStatus(int status)
{
switch (status)
{
case 1: return "未知"; break;
case 2: return "运行"; break;
case 4: return "停止"; break;
default: return "未知"; break;
}
}
private string ChangeHotWarn(int status)
{
switch (status)
{
case 0: return "正常"; break;
case 1: return "风机故障"; break;
case 2: return "燃烧机故障"; break;
case 4: return "传动故障"; break;
case 8: return "超温保护"; break;
case 16: return "烘干温度超温"; break;
case 32: return "温控模块通讯超时"; break;
default: return "未知"; break;
}
}
#endregion

@ -62,7 +62,7 @@ namespace SlnMesnac.WPF.ViewModel
plc = baseBusiness.GetPlcByKey("plc");
if (plc != null)
{
RefreshHotDataGrid();
// RefreshHotDataGrid();
RefreshUnPackDataGrid();
//RefreshMagNetDataGrid();
//RefreshSpiralDataGrid();

@ -38,9 +38,9 @@
{
"configId": 1,
"plcType": "SiemensPlc",
"plcIp": "192.168.2.220",
// "plcIp": "127.0.0.1",
"plcPort": 102,
// "plcIp": "192.168.2.220",
"plcIp": "127.0.0.1",
"plcPort": 103,
"plcKey": "plc",
"isFlage": true
},

Loading…
Cancel
Save