advertisement
from the Electronic Equipment Testing department...
Modbus read/write (0x17) function
Software, including programming, OS issues, etc. topic
Posted by Avijit Paul on 23 October, 2012 - 4:05 am
I am trying to create a profile header into an unit at a particular
address with C#, but I get the error message: The operation is timed
out. My is as below:-

moderator's note: space below is to make sure ad does not cover code.



















ushort[] ustNewData = {0x4350,0x436F,0x6C6F, 0x7374, 0x7275, 0x6D20,
0x4E6F, 0x726D, 0x616C, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001,
0x0004, 0x4561,0x0000, 0x0000, 0x0001 };

SerialPort spPort = new SerialPort();
spPort.BaudRate = 19200;
spPort.ReadTimeout = 2000;
spPort.WriteTimeout = 2000;
spPort.Handshake = Handshake.XOnXOff;

ModbusSerialMaster mb;
mb =
ModbusSerialMaster.CreateRtu(spPort);
if (!spPort.IsOpen) spPort.Open();
try
{
profile_no = mb.ReadWriteMultipleRegisters(1, (ushort)0x2006, (ushort)1, (ushort)0x2006, ustNewData);
}
catch (Exception ex)
{

System.Windows.Forms.MessageBox.Show("Error " + ex.Message);
}

This also fails for TCP/IP or ASCII cases.


Posted by Lynn August Linse on 23 October, 2012 - 10:12 am
First things first, most Modbus devices do NOT support read/write function 0x17. So can you confirm that your device does support it?

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2013 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
The bureaucracy is expanding to meet the needs of an expanding
bureaucracy.
Advertise here
Advertisement
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive