|
|
@@ -517,13 +517,21 @@ namespace UAS_PLCDataReader
|
|
|
//存放返回的所有数据
|
|
|
Dictionary<string, string> ItemData = new Dictionary<string, string>();
|
|
|
int[] Arr = BaseUtil.GetDecimalData(BaseUtil.ASCIIToString(client[DpcID].Returnvalue[IP]), 8);
|
|
|
- if (Arr.Length == DC.Rows.Count)
|
|
|
+ //返回的参数个数和定义的参数个数相等或者小于的时候
|
|
|
+ if (Arr.Length == DC.Rows.Count|| DC.Rows.Count > Arr.Length)
|
|
|
{
|
|
|
for (int i = 0; i < Arr.Length; i++)
|
|
|
{
|
|
|
ItemData.Add(DC.Rows[i]["dc_type"].ToString(), Arr[i].ToString());
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (int i = 0; i < DC.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ ItemData.Add(DC.Rows[i]["dc_type"].ToString(), Arr[i].ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!ReturnData.ContainsKey(Decode))
|
|
|
{
|
|
|
//添加本地数据内容
|