Reading and Wring Boolean %MX Bits

I am trying to write to a Scheidner TM251MESE PLC Boolean %MX1040.0. I have attached a screen shot of the PLC variable declarations. My Ignition item path is “ns=1;s=[PLC]HR520.0” which appears to show the correct value. But when I click on the value to toggle it, a message of “error writing to TAG:bad” appear. Please help.

Schneider PLCs do not implement the Atomic Read-Modify-Write modbus function code needed to write bits of a holding register. You will need to write the whole 16-bit register.

It is a display of amazing incompetence on the part of their firmware developers, as Schneider is the successor company of the inventor of the protocol. The legacy products they bought out do implement the function code.

I recommend either:

  1. Using coil memory instead, or
  2. Using a PLC brand whose engineers have a clue.

Yeah. I am familiar with their 4x, 3x, 1x, and 0x addressing. Unfortunately your two recommended options are out of my control. Thank you for the reply.

My condolences. You will need to do the appropriate bit shifting & masking/ORing yourself before writing.

So i just tested a write to an individual holding register bit on a M340. It worked just fine, and used function code 22. From some brief googling it looks like Read/Modify/Write operation is a work around for devices that don’t support function code 22.

Ah, so they did implement function 22 on some newer models. Yours is the first report I’ve seen. Maybe there’s a firmware upgrade @Adinh can try.

Doesn’t look like it, the manual as of March 2022 skips right to FC 23. :face_with_diagonal_mouth:

How do you use function code 22? Thanks.

It just happens, had to run a wire shark to see exactly which code was used.

Go here:

Then click through to the Specifications and agree to the terms.

Then pick the MODBUS Protocol Specification.

It isn’t going to help you, because Ignition uses FC 22 automatically to write bits in 4xxxxx registers. Because it is the only way to write less than a full 16-bits to a 4xxxxx register.

But going through this will help you understand what the problem is, what precisely to complain about to Schneider, and how to explain to your customer that their choice of PLC has crippled some kinds of common operations.

1 Like

So i did a bit of research, and the M340 was released in 2007, 19 years after SE acquired Telemecanique. They must have people who somewhat know what they are doing, but i guess those aren’t the ones that work on the TM251MESE. I think the TM251MESE is newer than the M340, so no clue what their excuse is.

1 Like

So, they’re getting dumber? Oy!