While working on a new project, I've learned about a new DateTime type in Logix named DT that our controls engineer used. Has anyone else used that within Ignition yet? Or is it possible?
Even though External Access is on, we don't seem to be able to see it in the Tag Browser. So I'm guessing it might be a driver limitation.
Edit: Added link to post about new Time datatypes.
I don’t have a ton of the PLC side knowledge, looking at it in Logix, I can see it break out to 64 bools. But yeah guessing we will have to pivot to the old ways for now.
I don’t know what the datatype code for LDT is, doesn’t seem to have an analog in the CIP spec. Also not sure what elementary types TIME and TIME32 correspond to.
@pturmel I wish had to the time to give it a test! The question was more so towards IA before I relayed the info to my project team to switch to another datatype.
Keep these considerations in mind when using relative time (LTIME, TIME32, TIME) and absolute time (LDT, DT) data types:
Use the Move (MOV) instruction as a bridge between systems adopting time and date data types and legacy systems. Using time and date data types and LINT data types with MOV allows the Logix Designer to carry out a straight memory copy.
You cannot mix time and date operands with any other kind of data type except LINT. LINT data types were often used in legacy systems for time stamping, so they are the only data types that are interoperable with the time and date data types. The system allows LINTs to be used broadly but it assumes that every LINT is an LDT data type, and type conversion occurs based on that assumption. Systems using LINT microsecond tags would need to:
Manage that discrepancy wherever a LINT microsecond tag is used, or
MOV its value to a DT tag, or
Convert the LINT microsecond tag to nanoseconds and then MOV that value to an LDT tag.
For Add (ADD), Subtract (SUB), and Compare Instructions:
If both Source A and Source B are relative time, the Dest must be relative time.
If Source A is relative time and Source B is absolute time or vice versa, the Dest must be absolute time.
In ADD instructions, Source A and Source B cannot both be absolute time.
My personal takeaways:
For now MOV these new typed values to LINT tags to capture as Ignition Long tags. Use fromMillis with either divide by 1000 for microsecond DT or 1000000 for nanosecond LDT. e.g.
fromMillis( {[default]LINT_Tag_Value} / 1000 )
If we need to write an Ignition Date back to the PLC, use a Long tag with toMillis and multiply by 1000 or 1000000 before MOV'ing back to the DT/LDT tag in PLC logic:
toMillis( {[default]Date_Tag_Value} ) * 1000
Of course none of this will matter once support is added to the Ignition Logix Driver