25092403 注释掉了所有线圈的读取接口
This commit is contained in:
@@ -222,53 +222,53 @@ namespace C_Windows_1
|
||||
public int workstation;
|
||||
public int workstation2;
|
||||
|
||||
public void Booltomath(int sta, UInt16[] shangweiji)
|
||||
{
|
||||
try
|
||||
{
|
||||
OperateResult<bool> reslutget;
|
||||
reslutget = CH1.ReadBool(Convert.ToString(sta));
|
||||
if (reslutget.IsSuccess == true)
|
||||
{
|
||||
if (reslutget.Content == true)
|
||||
{
|
||||
shangweiji[sta] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
shangweiji[sta] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
//public void Booltomath(int sta, UInt16[] shangweiji)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// OperateResult<bool> reslutget;
|
||||
// reslutget = CH1.ReadBool(Convert.ToString(sta));
|
||||
// if (reslutget.IsSuccess == true)
|
||||
// {
|
||||
// if (reslutget.Content == true)
|
||||
// {
|
||||
// shangweiji[sta] = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// shangweiji[sta] = 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
public void Booltomath2(int sta, UInt16[] shangweiji)
|
||||
{
|
||||
try
|
||||
{
|
||||
OperateResult<bool> reslutget;
|
||||
reslutget = CH2.ReadBool(Convert.ToString(sta));
|
||||
if (reslutget.IsSuccess == true)
|
||||
{
|
||||
if (reslutget.Content == true)
|
||||
{
|
||||
shangweiji[sta] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
shangweiji[sta] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
//public void Booltomath2(int sta, UInt16[] shangweiji)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// OperateResult<bool> reslutget;
|
||||
// reslutget = CH2.ReadBool(Convert.ToString(sta));
|
||||
// if (reslutget.IsSuccess == true)
|
||||
// {
|
||||
// if (reslutget.Content == true)
|
||||
// {
|
||||
// shangweiji[sta] = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// shangweiji[sta] = 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
//sta 起始寄存器
|
||||
@@ -715,13 +715,14 @@ namespace C_Windows_1
|
||||
Modbusread(8, 2, ReadData);
|
||||
Modbusread(16, 4, ReadData);
|
||||
Modbusread(25, 24, ReadData);
|
||||
Booltomath(8, ReadData);
|
||||
Booltomath(9, ReadData);
|
||||
//Booltomath(8, ReadData);
|
||||
//Booltomath(9, ReadData);
|
||||
int ba = pb_CH1progressBar.Value + 2;
|
||||
if (ba >= pb_CH1progressBar.Maximum)
|
||||
ba = pb_CH1progressBar.Maximum;
|
||||
pb_CH1progressBar.Value = ba;
|
||||
|
||||
|
||||
|
||||
if (ReadData[8] != 0 && (ReadData[9] == 1 || ReadData[9] == 2))//当仪器状态位不为0且有结果时
|
||||
{
|
||||
workstation = (int)yiqi.finish;
|
||||
@@ -731,7 +732,7 @@ namespace C_Windows_1
|
||||
{
|
||||
System.Threading.Thread.Sleep(300);
|
||||
Modbusread(8, 2, ReadData);
|
||||
Booltomath(9, ReadData);
|
||||
//Booltomath(9, ReadData);
|
||||
if (ReadData[9] == 1 || ReadData[9] == 2)
|
||||
{
|
||||
workstation = (int)yiqi.finish;
|
||||
@@ -746,8 +747,8 @@ namespace C_Windows_1
|
||||
|
||||
case (int)yiqi.standby://读取仪器是否启动
|
||||
Modbusread(8, 2, ReadData);
|
||||
Booltomath(8, ReadData);
|
||||
Booltomath(9, ReadData);
|
||||
//Booltomath(8, ReadData);
|
||||
//Booltomath(9, ReadData);
|
||||
//MachineStatus.Text = "待机中";
|
||||
if (ReadData[8] != 0 && ReadData[9] == 0)
|
||||
{
|
||||
@@ -757,8 +758,8 @@ namespace C_Windows_1
|
||||
|
||||
case (int)yiqi.finish:
|
||||
Modbusread(8, 2, ReadData);
|
||||
Booltomath(8, ReadData);
|
||||
Booltomath(9, ReadData);
|
||||
//Booltomath(8, ReadData);
|
||||
//Booltomath(9, ReadData);
|
||||
Modbusread(16, 4, ReadData);
|
||||
pb_CH1progressBar.Value = pb_CH1progressBar.Maximum;
|
||||
Display(1, tb_CH1Code.Text);
|
||||
@@ -921,8 +922,8 @@ namespace C_Windows_1
|
||||
Modbusread2(8, 2, ReadData2);
|
||||
Modbusread2(16, 4, ReadData2);
|
||||
Modbusread2(25, 24, ReadData2);
|
||||
Booltomath2(8, ReadData2);
|
||||
Booltomath2(9, ReadData2);
|
||||
//Booltomath2(8, ReadData2);
|
||||
//Booltomath2(9, ReadData2);
|
||||
int ba = pb_CH2progressBar.Value + 2;
|
||||
if (ba >= pb_CH2progressBar.Maximum)
|
||||
ba = pb_CH2progressBar.Maximum;
|
||||
@@ -936,7 +937,7 @@ namespace C_Windows_1
|
||||
{
|
||||
System.Threading.Thread.Sleep(300);
|
||||
Modbusread2(8, 2, ReadData2);
|
||||
Booltomath2(9, ReadData2);
|
||||
//Booltomath2(9, ReadData2);
|
||||
if (ReadData2[9] == 1 || ReadData2[9] == 2)
|
||||
{
|
||||
workstation2 = (int)yiqi.finish;
|
||||
@@ -951,8 +952,8 @@ namespace C_Windows_1
|
||||
|
||||
case (int)yiqi.standby://读取仪器是否启动
|
||||
Modbusread2(8, 2, ReadData2);
|
||||
Booltomath2(8, ReadData2);
|
||||
Booltomath2(9, ReadData2);
|
||||
//Booltomath2(8, ReadData2);
|
||||
//Booltomath2(9, ReadData2);
|
||||
//MachineStatus.Text = "待机中";
|
||||
if (ReadData2[8] != 0 && ReadData2[9] == 0)
|
||||
{
|
||||
@@ -962,8 +963,8 @@ namespace C_Windows_1
|
||||
|
||||
case (int)yiqi.finish:
|
||||
Modbusread2(8, 2, ReadData2);
|
||||
Booltomath2(8, ReadData2);
|
||||
Booltomath2(9, ReadData2);
|
||||
//Booltomath2(8, ReadData2);
|
||||
//Booltomath2(9, ReadData2);
|
||||
Modbusread2(16, 4, ReadData2);
|
||||
pb_CH2progressBar.Value = pb_CH2progressBar.Maximum;
|
||||
Display(2, tb_CH2Code.Text);
|
||||
|
||||
Reference in New Issue
Block a user