#总装移交版本
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* =================================
|
||||
* CLR版本 :4.0.30319.42000
|
||||
* 命名空间 :NSAnalysis.Define
|
||||
* 文件名称 :ConfigPlc.cs
|
||||
* =================================
|
||||
* 创 建 者 :shupeng.wang
|
||||
* 创建日期 :2022/9/28 18:49:01
|
||||
* 功能描述 :
|
||||
* 使用说明 :
|
||||
* =================================
|
||||
* 修改者 :
|
||||
* 修改日期 :
|
||||
* 修改内容 :
|
||||
* =================================
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using BaseFunction;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NSAnalysis
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ConfigPlc
|
||||
{
|
||||
private int m_WriteStartAddr = 0;
|
||||
|
||||
public int WriteStartAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_WriteStartAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_WriteStartAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_ReadStartAddr = 100;
|
||||
|
||||
public int ReadStartAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ReadStartAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ReadStartAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PLC通信协议: 1:Modbus;3:S7
|
||||
/// </summary>
|
||||
public static int PlcType = 1;
|
||||
|
||||
public static string strIP = "192.168.1.30"; //PLC的IP地址 沈机:100
|
||||
public static string strPort = "502"; //PLC的端口号
|
||||
public static string strMac = "1"; //设备号
|
||||
public static bool bReConnect = false;
|
||||
public static bool bPositiveAequence = true;
|
||||
|
||||
public static void LoadConfig()
|
||||
{
|
||||
string strTemp = "TCP";
|
||||
strIP = FileIni.ReadString(ConfigDfn.strConfigFile, strTemp, "ModbusTcp_IP");
|
||||
strPort = FileIni.ReadString(ConfigDfn.strConfigFile, strTemp, "ModbusTcp_Port");
|
||||
strMac = FileIni.ReadString(ConfigDfn.strConfigFile, strTemp, "ModbusTcp_Addr");
|
||||
bReConnect = FileIni.ReadBool(ConfigDfn.strConfigFile, strTemp, "ModbusTcp_Reconnected", 1);
|
||||
bPositiveAequence = !FileIni.ReadBool(ConfigDfn.strConfigFile, strTemp, "ModbusTcp_ReverseSequence", 1);
|
||||
PlcType = FileIni.ReadInt(ConfigDfn.strConfigFile, strTemp, "PlcType", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user