# How to Send Derived tag Value of String to PLC via OPC

**URL:** <https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [October 12, 2023, 1:35pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392 "2023-10-12T13:35:50Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 12, 2023, 1:35pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/1 "2023-10-12T13:35:50Z")

</div>

Hi Gents,  
Sorry if i ask a stupid question in this forum. I am just started developing some ignition project and would going in to more details.  
I ma having a tag which is derived tag , which i am converting Current date to String format "yyyy-MM-dd". which i was able to do easily. my question is how i can send this derived tag value to PLC.  
I can create a OPC Tag in Ignition and tied to PLC tag but how this Derived tag value copied to that OPC tag, so that i can read in PLC.  
see screenshot below:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/19a285212ef62bc4bd95457a477802bd03f8f87d.png)

---

<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:** [October 12, 2023, 1:38pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/2 "2023-10-12T13:38:58Z")

</div>

Supply a write expression that performs the reverse of dateFormat.

---

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 12, 2023, 1:42pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/3 "2023-10-12T13:42:44Z")

</div>

Write Expression to where.  
I have a dervied Tag date which converted current date to the string format.  
also, I created OPC tag in Ignition.

---

<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:** [October 12, 2023, 1:48pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/4 "2023-10-12T13:48:10Z")

</div>

Derived tags are bidirectional. The read expression converts from the source tag (which can be any kind of tag) to the derived tag, and the write expression converts from a value written to the derived tag into the value needed to be written to the source tag.

Maybe you shouldn't be using a derived tag? What are you really trying to do? Just maintain the current date in a PLC string?

---

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 12, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/5 "2023-10-12T13:50:10Z")

</div>

Thank you for your reply.  
I am converting current date in igntion to String format and trying to send that string value to PLC.  
I just need to read a String value in PLCTag.

---

<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:** [October 12, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/6 "2023-10-12T13:50:51Z")

</div>

> [@SANJAY\_SAUNDATTIKAR](#):
>
> I just need to read a String value in PLCTag

?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 12, 2023, 1:52pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/7 "2023-10-12T13:52:04Z")

</div>

Why are you not sending a date data type to the PLC?  
What make and model PLC is it?

---

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 12, 2023, 1:56pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/8 "2023-10-12T13:56:45Z")

</div>

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

I appreciate if you can guide how to send data in string format.  
Is it possible to do it easily?

---

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 12, 2023, 2:14pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/9 "2023-10-12T14:14:19Z")

</div>

I have a Date as a string in PLC which is not current date and i am trying to get a current date from ignition and using that as a string in PLC to compare.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 12, 2023, 2:15pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/10 "2023-10-12T14:15:25Z")

</div>

The GuardLogix can handle date format internally. Create a PLC tag of datatype date and use that. You should keep datatypes in their native format until you absolutely have to change them to string. It will save you much pain.

Convert the existing PLC string into a date in the PLC. Compare this with the date transmitted from Ignition. That will be simpler and more reliable.

---

<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:** [October 12, 2023, 2:20pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/11 "2023-10-12T14:20:21Z")

</div>

That processor has a very precise built-in clock, which can be synchronized with other clocks (like GPS clocks) fully automatically (turn on clock synchronization in the controller properties). You _ **really** _ shouldn't be passing dates or date/times as strings.

See these topics for a reliable solution:

[https://forum.inductiveautomation.com/search?q=tm2000b](https://forum.inductiveautomation.com/search?q=tm2000b)

---

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 12, 2023, 2:33pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/12 "2023-10-12T14:33:38Z")

</div>

Thank you, I am little bit of visual person.  
can you send me screenshot of the tag from ignition for the date, how it looks.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 12, 2023, 2:59pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/13 "2023-10-12T14:59:48Z")

</div>

[https://docs.inductiveautomation.com/display/DOC81/Types+of+Tags](https://docs.inductiveautomation.com/display/DOC81/Types+of+Tags)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [October 12, 2023, 7:59pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/14 "2023-10-12T19:59:04Z")

</div>

> [@Transistor](#):
>
> The GuardLogix can handle date format internally. Create a PLC tag of datatype date and use that.

> [@pturmel](#):
>
> You _ **really** _ shouldn't be passing dates or date/times as strings.

When did rockwell processors start coming with a `date` data type? I have a v24.13 processor (Most of our floor runs this version) that doesn't list date in the predefined data types. We've normally used an array of dints for the different datetime values.

---

<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:** [October 12, 2023, 8:16pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/15 "2023-10-12T20:16:10Z")

</div>

v32? v33? Something like that. Bunch of new types. Including USINT, UINT, UDINT, and ULINT. Keeping up with the Jones. (Omron NJ/NX introduced and exposed a bunch of convenient datatypes. Rockwell responded.)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [October 12, 2023, 8:23pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/16 "2023-10-12T20:23:09Z")

</div>

Looks like 32.11 doesn't have it, 33.12 doesn't have it, 34.12 has `TIME` and `LTIME`, I'm guessing these are the types you were talking about?

Interestingly 32+ has the USINT, UINT, UDINT, ULINT, but only 34+ has the TIME and LTIME

Wonder if I can make an argument to pull all our v32+ processors to v34

---

<div class="post-metadata">

**Author:** ![SANJAY\_SAUNDATTIKAR](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SANJAY\_SAUNDATTIKAR](https://forum.inductiveautomation.com/u/SANJAY_SAUNDATTIKAR)\
**Post date:** [October 13, 2023, 1:38pm UTC](https://forum.inductiveautomation.com/t/how-to-send-derived-tag-value-of-string-to-plc-via-opc/80392/17 "2023-10-13T13:38:07Z")

</div>

Gents,

Thank you very much for your support and comments. Finally resolved issue with Scripting in the derived tag and write value to OPC tag which is reading Tag in PLC.  
now I have string in PLC with date yyyy-MM-dd.
