|
|
@@ -210,5 +210,32 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
nodeValues.Add(string.Format(plcAddress.ScrewProNum.Address, Number), ScrewProNum);
|
|
|
return await pLC.WriteNodesAsync(nodeValues);
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 将点位数据写入到PLC地址
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="plcAddress"></param>
|
|
|
+ /// <param name="pLC"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<bool> WriteToPlcAddressEx(PlcPointAddress plcAddress, OpcUaClientPLC pLC)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> nodeValues = new Dictionary<string, object>();
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.X_Position.Address, Number), X_Position);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.X_Velocity.Address, Number), X_Velocity);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Y_Position.Address, Number), Y_Position);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Y_Velocity.Address, Number), Y_Velocity);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Z_Position_Start.Address, Number), Z_Position_Start);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Z_Velocity_Start.Address, Number), Z_Velocity_Start);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Z_Position_Stop.Address, Number), Z_Position_Stop);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Z_Velocity_Stop.Address, Number), Z_Velocity_Stop);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.U_Position.Address, Number), U_Position);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.U_Velocity.Address, Number), U_Velocity);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.R_Position.Address, Number), R_Position);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.R_Velocity.Address, Number), R_Velocity);
|
|
|
+ //nodeValues.Add(string.Format(plcAddress.Torque.Address, Number), Torque);
|
|
|
+ nodeValues.Add(string.Format(plcAddress.Feeder.Address, Number), Feeder);
|
|
|
+ nodeValues.Add(string.Format(plcAddress.ScrewProNum.Address, Number), ScrewProNum);
|
|
|
+ return await pLC.WriteNodesAsync(nodeValues);
|
|
|
+ }
|
|
|
}
|
|
|
}
|