priyankay
In my project, I need to send simple ON/OFF commands from an HMI to OpenPLC logic using Modbus.
Currently, I see that memory areas like %MW, %MD, and %ML are word-based. I’m looking for a way to use single-bit memory (e.g., %MX0.0) similar to how coils work, but within the memory area.

Does OpenPLC support writing to %MX (1-bit memory) via Modbus (e.g., %MX0.0), or is using coils (%QX / %IX) the only option for Boolean control?
 
@thiagoralves will you please help
 
Thanks in advance.
Reply 0 0
thiagoralves
Yes, OpenPLC Runtime v4 does support %MX bits.
Reply 0 0
priyankay
I'm using OpenPLC v3, does it have support for %MX bits?

@thiagoralves
Reply 0 0
thiagoralves
No, with v3 you’ll have to use %QX
Reply 1 0
fg71
In technology terms a output that we describe as coil could be a input for other process logic. It become read only... if not then it same as saying I have physical input that I set to True and I change the output coil to False. It means the physical input or input of other processed logic could be override by manipulate a output.
If SR block output signal is TRUE you could not change the output coil to write False. The problem is when Modbus and PLC cycle do not use same rule.
 
I could use output block as input but I could not use the same block if it output (meaning a block is input to output block)
 
This is very easy to make in Siemens LOGO to simulate.
 
When @thiagoralves say you need to use %QX it is now it could become confusing if do not understand the different of %QX as input or output.
 
In most PLC IDE they used a coil in Ladder logic there you could sign it to memory bit/flag/merker it become       ---------(M)--------|
It was clear to users that a output was assign to memory (M) and could be used as input for other process logic. It become very clear to most people if we do not follow the rule it become very difficult to debug or understand why something do not work.
 
Like @thiagoralves is saying this is not supported in version 3
 
I could set Q1, M1 and V0.0 from HMI to True, but I could not set Q2 to False, So it is (I hink) a bad advice to use Q1 as input.
Specially if you organize you Function Block thee you have input at left, process logic middle and output at right.
The Q in is output block and that is what the manual teach you for Siemens LOGO. Also you have used 2 physical output on the device.
 
You may think I assign or mapping the output to physical output pin and use %QX but if you also use it as input you use it as Q1 in picture below.
 
[203128%2F9747003%2Fmceclip0]
Reply 0 0
Programador s7
Yes, OpenPLC Runtime v4 does support %MX bits.
Captura de pantalla 2026-04-21 135917.png
What Modbus memory address is used for:
%MX0.0
Reply 0 0
thiagoralves
The table you referenced is for microcontrollers, which do not support %MX. As I said before, %MX is only supported on OpenPLC Runtime v4 targets. In the v4 case, the registers are sequential, according to the configuration you set on the Modbus server on the editor (blue plus button -> servers -> Modbus)
Reply 0 0
Programador s7
The table you referenced is for microcontrollers, which do not support %MX. As I said before, %MX is only supported on OpenPLC Runtime v4 targets. In the v4 case, the registers are sequential, according to the configuration you set on the Modbus server on the editor (blue plus button -> servers -> Modbus)
Thank you very much, I had that question. In the case of microcontrollers, I would use %QX1.0 and above since I don't use digital pins. I generally use a maximum of 8 digital outputs. Can I use %QXx.x outputs without defining them in the microcontroller and use them as if they were %MXx.x?
Reply 0 0
thiagoralves
Yes, you can use any QX in the microcontroller address range even if the pins for that location are not defined. They will act then as pure memory, exactly like %MX on v4
Reply 0 0
Reply