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

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:

Supply a write expression that performs the reverse of dateFormat.

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.

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?

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.

?

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

image

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

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.

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.

1 Like

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

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.

https://docs.inductiveautomation.com/display/DOC81/Types+of+Tags

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.

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.)

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

1 Like

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.