# Address configuration for s7 1200 as OPC device

**URL:** <https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583>\
**Category:** Ignition\
**Created:** [September 28, 2024, 10:17pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583 "2024-09-28T22:17:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 28, 2024, 10:17pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/1 "2024-09-28T22:17:10Z")

</div>

Hello,  
I am trying to set up Ignition to communicate with an S7 1200 by Modbus and having trouble with the booleans. The Holding registers work the way I expect but I can't figure out how to set the Modbus Address for the coils. If I set them both to 1 I would expect them to conflict but they don't. The Coils are being set somewhere in the PLC but I can't figure out where.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/1/01e1b1f0c530bd937f51e9add979a22d5487e242.png)

I expect the Coil values from the Quick Client to be in the Coils array of the TIA table, but they don't show up there

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/f/af040288c842e85e6f209a79a03c0e6541973160.png)

But if I change the values of the Coils in the Quick Client they change somewhere

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6dc6028bda652b19df561925890fb1725011e5c1.png)

I am trying to use modbus with both holding registers and coils but it seems like only the holding registers work, does anyone know if its possible to have both holding registers and coil registers in the same modbus block?

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [September 30, 2024, 12:35am UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/2 "2024-09-30T00:35:25Z")

</div>

Lets start at the start of your post. I would title the post "Address configuration of S7-1200 as Modbus device" it will get more responses from people quickly scanning the topics.  
Next, I would suggest to never use the "Address Configuration" section of the modbus driver, and instead use the [Modbus Addressing | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/opc-ua/opc-ua-drivers/modbus/modbus-addressing) system. This system is much easier to use and to troubleshoot.  
Make your tags in the tag browser on ignition, use these examples as the OPC Path:  
Holding Register - `ns=1;s=[Test Stand - S7 1200 Mdbs]1.HRF2`  
Coil - `ns=1;s=[Test Stand - S7 1200 Mdbs]1.C1`  
Then lets see what the tags show as in the tag browser.

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 1:37pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/3 "2024-09-30T13:37:54Z")

</div>

Hi David,  
Thanks for the response. I have tried using modbus addressing in the OPC Item Path. It works for the Real numbers, so HRF2 returns 179.77, as I expect.  
The problem is that the Booleans in TIA are not affected by commands like  
ns=1;s=[Test Stand - S7 1200 Mdbs]1.C1  
It just doesn't do anything. In Ignition it appears the bit is being toggled somewhere, and I can see it toggling in the Quick Client but nothing in tia changes in the Booleans section. If I manually change the booleans in TIA, again nothing happens in Ignition. I can read bits in Ignition from TIA if I use commands like HRF1.0 will read in Ignition if I manually toggle bits in TIA but if I try to write the bit in Ignition it says the bit is Read Only.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4b7ad6a0d27010e1d50e7aa5578b335ef6508593.jpeg)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d7c71f8219420338160f59b55725f054912e8832.png)

The reason I tried the "Address Configuration" Feature was because addressing in the tag isn't working.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 30, 2024, 1:42pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/4 "2024-09-30T13:42:03Z")

</div>

Are you sure TIA supports Modbus coil addresses? Instead of mapping booleans into holding registers?

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 2:01pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/5 "2024-09-30T14:01:55Z")

</div>

Hi pturmel,  
I am not sure that TIA supports coils except that in the documentation it says it can. Here is a screenshot.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/663e16d3cde8d785d7ba960097ed30470c2e88c3.png)  
One difference is that the Ignition documents say that TIA uses X instead of C for bits like MX0.1 (Or IX0.1, or similar) should work to toggle the bit I am after, but it doesn't.  
I am looking for an example of someone that has used booleans and reals(or whatever) with TIA portal. The examples in the documentation don't work.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [September 30, 2024, 2:05pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/6 "2024-09-30T14:05:56Z")

</div>

Here, you're mixing up the Siemens driver with the Modbus driver. If you want to use the Siemens driver, you'll use that format, but when using Modbus, you have to stick with the Modbus format. You can't mix the two different formats.

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 2:20pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/7 "2024-09-30T14:20:52Z")

</div>

Hi Michael,  
Thanks for the response. I don't know what that means. I thought it was the Siemens Modbus driver? What command should I use in Ignition to control the bit at offset 1.0 in TIA?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 30, 2024, 2:49pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/8 "2024-09-30T14:49:33Z")

</div>

Siemens native format is not Modbus. When using the native format, you would not have a Modbus Server block in your code.

If you **do** want to use Modbus, then only the Siemens addresses that are deliberately exposed through the MB Server instructions will actually be usable. Siemens addresses that start with "I" are fundamentally read-only externally, no matter what else you do. (And it wouldn't be called "Siemens Modbus". It's just "Modbus".)

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 7:56pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/9 "2024-09-30T19:56:55Z")

</div>

pturmel, Thanks for the reply. I think I am exposing the addresses in DB5 called Modbus.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/9/c92add20e93844f55862e3dca1bb4a8b8cb2989b.jpeg)

I set up the MB\_SERVER block like this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/74c43f48c83644a9f8d826ca89ddcb4ce33b9a18.jpeg)

It seems like '[Test Stand - S7 1200 Mdbs]1.C1' should work, or just '[Test Stand - S7 1200 Mdbs]C1' and it from Ignition it looks like they do but I can't see any changes in TIA, I don't know where the C values are changing, I expect them to change bewteen offsets 0 and 1.7 in the Modbus DB from the way the MB\_SERVER block is set up, but they don't.  
With the way I have the MB\_SERVER block set up and the Modbus DB what command should I use to control bit at offset 1.0?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 30, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/10 "2024-09-30T20:01:52Z")

</div>

Have you tried `HR1.0`, `HR1.1`, etc...?

The word "coil" doesn't appear a single time in [the documentation](https://cache.industry.siemens.com/dl/files/340/102020340/att_118119/v6/net_modbus_tcp_s7-1500_s7-1200_en.pdf) for these Modbus function blocks from what I can see.

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/11 "2024-09-30T20:17:20Z")

</div>

Hi Kevin, Thanks for the reply. I have tried that, I can read the value at offset 1.0 with HR1.0 but when I try to write to it I get an error

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/90e76bebf75cb78769674b13cb0bdc2bd2582810.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d7d3b72773dd8af744d384c8ee59755c857153f9.jpeg)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 30, 2024, 8:20pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/12 "2024-09-30T20:20:25Z")

</div>

If you change the bit in the PLC does it reflect on the Ignition side?

Is there an error in the Ignition logs when you try to write to that bit? Writing to a bit within a register requires that the Modbus slave/server supports function code 0x16 Mask Write Register.

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 8:32pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/13 "2024-09-30T20:32:26Z")

</div>

Kevin,  
Yes, if the bit changes in the PLC it is shown correctly in Ignition, but can't write from Ignition to PLC.  
Yes, there is an error

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f67e3cc63dc44e7ed763200ea4f6fba5bd50b84.png)  
Maybe the 1200 doesn't support the function, as you noted. It seems like there should be a way to control bits... I can imagine a script to write bits of a word or something, but that sounds more complicated than it should be.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 30, 2024, 8:34pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/14 "2024-09-30T20:34:22Z")

</div>

> [@gary\_truell](#):
>
> I can imagine a script to write bits of a word or something, but that sounds more complicated than it should be.

This is pretty much what you need to do. Create a new word that represents the bits you want set or not set, then write the whole register.

Or... stop using the Modbus driver and start using the Siemens S7 driver or a direct OPC UA connection? I hope you're only doing this with Modbus as an exercise.

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 8:47pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/15 "2024-09-30T20:47:25Z")

</div>

> Or... stop using the Modbus driver and start using the Siemens S7 driver or a direct OPC UA connection? I hope you're only doing this with Modbus as an exercise.

When activating OPC in TIA portal the IDE crashes, the fix apparently is to get a 1500, in a few months. Using modbus was supposed to be a quick way to get around the OPC problem. Writing to a word still seems faster than waiting for a 1500, but more than seems necessary. Must be a Siemens thing.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 8:59pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/16 "2024-09-30T20:59:02Z")

</div>

Kevin,

Maybe you can answer a question? If using the Siemens device driver, what would be the syntax for something like [Test Stand - S7 1200 Mdbs]C1, or is that it? I still don't understand the difference between modbus and siemens driver for the syntax.  
Also, do you know of a way to set up using bits in the addressing feature?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/6/46d655a4901c5c1f33f99d15747c2af85484cb0b.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 30, 2024, 9:01pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/17 "2024-09-30T21:01:23Z")

</div>

The Siemens address syntax is described here: [Siemens | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/opc-ua/opc-ua-drivers/siemens#configuring-siemens-addressing)

In this case the bit addresses might be something like `DB5,X0.0`, `DB5,X0.1`.

---

<div class="post-metadata">

**Author:** ![gary\_truell](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gary\_truell](https://forum.inductiveautomation.com/u/gary_truell)\
**Post date:** [September 30, 2024, 9:27pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/18 "2024-09-30T21:27:31Z")

</div>

I have tried that syntax and get an error  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89334c9bfc937c779a9fabb42e8b1283647edc95.png)

I'm not having much luck with this PLC, usually this is easy.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 30, 2024, 9:33pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/19 "2024-09-30T21:33:23Z")

</div>

Is your tag configured as Read Only?

Did you call it "OpcItemPath" or is there something else goofy going on here? How are you trying to write to it?

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [September 30, 2024, 9:34pm UTC](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583/20 "2024-09-30T21:34:13Z")

</div>

> [@gary\_truell](#):
>
> I still don't understand the difference between modbus and siemens driver for the syntax.

Modbus and the native Siemens driver are 2 completely different protocols. It's like trying to talk Spanish to someone who only talks English. You have to use the correct syntax for the correct driver/protocol.

[Next page](https://forum.inductiveautomation.com/t/address-configuration-for-s7-1200-as-opc-device/96583.md?page=2)
