# Parameterizing Siemens PLC Tag Mappings

**URL:** <https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [February 25, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573 "2022-02-25T14:51:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuart.williams](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stuart.williams/32/42310_2.png) [@stuart.williams](https://forum.inductiveautomation.com/u/stuart.williams)\
**Post date:** [February 25, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/1 "2022-02-25T14:51:21Z")

</div>

Hi everyone,

I have created UDTs for repetitive tag blocks in a Siemens S7 PLC. My hope was to parameterize the OPC mappings in my UDTs, but I am having trouble getting it to parse correctly. Here is an example of a opc path: nsu=http://www.siemens.com/simatic-s7-opcua;s=“Motor\_CamAssy\_Mtr11”.“DrvTemp”.

However, due to the double slashes in the http address, this is what the mapping looks like:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bcd41620ee787379f17564f6634ff5469882d326.png)

Whenever I try to pass in my machine name string parameter with the value Motor\_CamAssy\_Mtr11, I get an Error\_Config. I’m not sure if the path just isn’t resolving correctly with the parameter or if there’s another way I need to format the path.

Any help is appreciate.

---

<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:** [February 25, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/2 "2022-02-25T14:54:13Z")

</div>

Ignition uses curly braces around parameters, not quotes. I’m not familiar with the Siemens OPC server, but I would not expect quotes to be in the final item path.

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [February 25, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/3 "2022-02-25T14:54:46Z")

</div>

Try ns=3. That is the default Simatic namespace

---

<div class="post-metadata">

**Author:** ![stuart.williams](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stuart.williams/32/42310_2.png) [@stuart.williams](https://forum.inductiveautomation.com/u/stuart.williams)\
**Post date:** [February 25, 2022, 2:55pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/4 "2022-02-25T14:55:46Z")

</div>

Correct. This is what the path looks like when I pass in the parameter. I’ve tried it with and without the quotes surrounding the param:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/9/f98551bb1c150b8e05f94298c628579e073e6ae7.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:** [February 25, 2022, 2:56pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/5 "2022-02-25T14:56:13Z")

</div>

> [@pturmel](#):
>
> I’m not familiar with the Siemens OPC server, but I would not expect quotes to be in the final item path.

Oh, they're definitely part of the OPC Item Path.

> [@deon.korb](#):
>
> Try ns=3. That is the default Simatic namespace

What he's doing is fine. Using the URI is actually safer because technically a server can change the index a namespace resides at.

---

<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:** [February 25, 2022, 2:58pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/6 "2022-02-25T14:58:52Z")

</div>

Using curly brackets like in [this post](https://forum.inductiveautomation.com/t/ignition-8-1-siemens-udt-via-opc-ua-trouble/54865/8) should work… not sure why yours is acting differently. What “doesn’t work” about it?

---

<div class="post-metadata">

**Author:** ![stuart.williams](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stuart.williams/32/42310_2.png) [@stuart.williams](https://forum.inductiveautomation.com/u/stuart.williams)\
**Post date:** [February 25, 2022, 3:02pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/7 "2022-02-25T15:02:32Z")

</div>

Whenever I pass in the parameter into the opc item path, it is throwing an Error\_Config:

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

thanks for linking that other post. I can review that to see if anything is configed wrong on the plc itself

---

<div class="post-metadata">

**Author:** ![stuart.williams](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stuart.williams/32/42310_2.png) [@stuart.williams](https://forum.inductiveautomation.com/u/stuart.williams)\
**Post date:** [February 25, 2022, 3:04pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/8 "2022-02-25T15:04:37Z")

</div>

Wow. Typical mistake on my side where it doesn’t work until I reach out and makes a liar out of me lol thanks for the quick help, all

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f79b6e12930ea26c0387ed89285e916f00d8dc0f.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:** [February 25, 2022, 3:04pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/9 "2022-02-25T15:04:50Z")

</div>

Do the tag diagnostics for that tag have any more details?

You’re definitely missing the quotes, whether you put them in the parameter value or OPC Item Path is up to you.

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [February 25, 2022, 3:05pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/10 "2022-02-25T15:05:06Z")

</div>

It looks like there are quotes missing around `{Machine Name}`,

Try `"{Machine Name}"`

---

<div class="post-metadata">

**Author:** ![stuart.williams](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stuart.williams/32/42310_2.png) [@stuart.williams](https://forum.inductiveautomation.com/u/stuart.williams)\
**Post date:** [February 25, 2022, 3:11pm UTC](https://forum.inductiveautomation.com/t/parameterizing-siemens-plc-tag-mappings/56573/11 "2022-02-25T15:11:02Z")

</div>

Yeah, that was it. I swear I’ve tried that in the past. Thanks for the help!
