Use C# to write Modbus protocol, Source code is here.