Author Topic: BeginWriteRaw() Max Byte Limit?  (Read 937 times)

FlockaFlame

  • Newbie
  • *
  • Posts: 4
    • View Profile
BeginWriteRaw() Max Byte Limit?
« on: January 24, 2023, 04:29:25 PM »
I am wondering if there is a max limit to how many bytes you can use on this function (or does it depend on PLC or something else?). I am currently trying to write 50000 bytes of information in one go and nothing seems to happen when I do this.
When I write 1000 bytes of information with BeginWriteRaw(), this is successful and takes about 100ms to visually see on PLC side.

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: BeginWriteRaw() Max Byte Limit?
« Reply #1 on: January 25, 2023, 10:43:46 AM »
I am wondering if there is a max limit to how many bytes you can use on this function (or does it depend on PLC or something else?). I am currently trying to write 50000 bytes of information in one go and nothing seems to happen when I do this.
When I write 1000 bytes of information with BeginWriteRaw(), this is successful and takes about 100ms to visually see on PLC side.

You didn't mention what controller you are writing to, I'm assuming CompactLogix/ControlLogix.  Modern controllers support packet size of ~4000 bytes.  There is some overhead, so I don't think you get a full 4k bytes of data but it is close to that.  I'm guessing that BeginWriteRaw doesn't use fragmented write?  That would explain why it fails, you're trying to write 50k bytes, only 4k fits in a packet.