s7-1500 time and date display in Citect via OPCua

Hello Everyone,

I would like to display the recorded date and time in my plc on a Citect popup. 

My PLC variable is LDT datatype, how do i communicate this correctly to Citect via OPCua. I know I will have to make some conversions, but which datatype do i need in the PLC and which datatype do i need in Citect ? Could you please help me with this. I can't find any good documentation about this.

Thank you very much in advance. 

Parents
  • Hi Roy,
    I don't know exactly how the LDT type is coded into bytes/words, but Citect expects a simple seconds count starting from 1-1-1970. So one second after new year's eve in 1970 should read 1, not 1000000000. From my experience with Siemens Step5 way in the past, there could be a byte swap involved as well as a word swap, but in your example it seems more likely that there has to be done some rearranging within the decimal notation, not byte-wise. Maybe you could test some more values and compare them with the numbers you get in Citect when using StrToDate() and/or StrToTime().

    Regards,
    Patrick
Reply
  • Hi Roy,
    I don't know exactly how the LDT type is coded into bytes/words, but Citect expects a simple seconds count starting from 1-1-1970. So one second after new year's eve in 1970 should read 1, not 1000000000. From my experience with Siemens Step5 way in the past, there could be a byte swap involved as well as a word swap, but in your example it seems more likely that there has to be done some rearranging within the decimal notation, not byte-wise. Maybe you could test some more values and compare them with the numbers you get in Citect when using StrToDate() and/or StrToTime().

    Regards,
    Patrick
Children
No Data