Modbus device does not support function 01

Could use some help debugging what's going on here. I've tried changing some advanced settings as described here.

It's all airgapped so screenshots are difficult. Posting from my phone so excuse my sausage-finger-typo's.

I'm trying to write coils. The PLC-programmer has tested their modbus accessibility with the following string;
01 05 00 00 FF 00
This should enable coil one.
When I use a PLC-tag with [device]1.C0 I expect the same string (or at least one with some resemblance) to be sent. Instead the logger shows I'm sending the following commandstring;
01 5A 00 00 00 06 01 01 00 00 00 01
Changing the source of the tag to 1.C1 the commandstring changes to;
01 5A 00 00 00 06 01 01 00 01 00 01

This has helped me understand some of what's going on, but what I don't understand is why the part of the commandstring that appears to be the read-request (from 06 onwards) doesn't start with 05. According to the documentation I'm sending requests to read a register instead of a coil?

As mentioned I've tried to change some of the settings to try and get it to access single coils, but no success so far. Any pointers in the right direction would be appreciated.

After some more tinkering:
01 01 00 01 00 01 is actually the command-part. 01 for device 1, 01 for read coil, 00 01 is the coil address, and I'm assuming 00 01 is some sort of delimiter as it hasn't changed so far.

I'm starting to question my sanity, everything seems to be correct - yet the response is something's incorrect?

Final edit!

I've changed the title as well. Turns out the Omron PLC in question does not support modbus function 01. This means Ignition can't read the coil and gives the "bad" status. It is possible to write (using a modbus-tester), but afaik if Ignition deems the tag to be "bad" it won't write? Or at least will keep spamming the log with failed read-requests.

Is there an accepted work-around? Currently I'm thinking of moving the writable bits back to the HR, but the PLC also doesn't support overwriting single bits in the HR. This means we'd have to (re-)calculate the whole int for every read/write operation. This is obviously not ideal, but currently looks to be the only functional solution.

Try writing with system.opc.writeValue() instead of setting up a tag. OPC tags must be readable. Write-only addresses must bypass the tag system to write directly through OPC.

3 Likes

I haven't had to use this, but do you know if one were to set up an OPC tag with a tag group set to not poll (0ms for the rate), could you write to it and get it to function as a write-only tag? (I may try this later if I get time)

Don't know, but I'd not do that anyway. It gives one the impression that the value it holds has meaning.

1 Like