Opc Da Write Fix

This commit is contained in:
parallelbgls
2016-10-03 16:30:16 +08:00
parent d70a0e9241
commit 924c74693d
8 changed files with 50 additions and 14 deletions

View File

@@ -70,13 +70,14 @@ namespace Modbus.Net.OPC
}
public class WriteRequestOpcProtocal : ProtocalUnit
public class WriteRequestOpcProtocal : SpecialProtocalUnit
{
public override byte[] Format(InputStruct message)
{
var r_message = (WriteRequestOpcInputStruct)message;
byte[] tag = Encoding.UTF8.GetBytes(r_message.Tag);
return Format((byte)0x00, tag, (int)0x00ffff00, r_message.SetValue.GetType().FullName, (int)0x00ffff00, r_message.SetValue);
byte[] fullName = Encoding.UTF8.GetBytes(r_message.SetValue.GetType().FullName);
return Format((byte)0x01, tag, (int)0x00ffff00, fullName, (int)0x00ffff00, r_message.SetValue);
}
public override OutputStruct Unformat(byte[] messageBytes, ref int pos)