0

I'm looking for the 'AppTimeStamp' information so this can be used to verify that the code is not updated/changed by service personel.

Detect code changes on Beckhoff PLC using C# At this location I already find part of my information, but I was not able to add a comment due to the 'new user' limitations

2 Answers2

0

You can find the AppTimestamp in the _AppInfo instance. So just call _AppInfo.AppTimestamp in your program to know the time of the last application start. Make sure you also check the number of online changes since last download with the OnlineChangeCnt counter which you will also find in the _AppInfo instance.

Filippo Boido
  • 1,136
  • 7
  • 11
  • Hi Filippo Thanks for the message, I see now that my message was not clear enough. I know were to find it in the PLC programm, but to my opinion it is stored someware on the PLC itself also. I'm trying to find the file that contains this timestamp information on the PLC. This information is read after startup of the PLC and thus needs to be stored somewere. – Ludo Houben Jun 07 '19 at 06:08
0

There are many possibilities where this value is saved. The TwinCAT saves data to the C:\TwinCAT\3.1\Boot folder, different files are explained here.

The ProjectName can be found for example from the configuration data (CurrentConfig.xml), from the end of the file (TcBootProject/ProjectInfo/ProjectName). The same file contains one date (<TcBootProject CreateTime="2019-06-10T13:14:17">), but it seems to be the build time of the boot project created.

I couldn't find the date of AppTimestamp in any files, but perhaps the TwinCAT uses the creation time of the files in those folders? Or perhaps it's hidden in the binary somewhere.

When you update the software without updating the boot project, the file Port_851_act.tizip is updated. So you can check its timestamp. When you update the boot project too, Port_851_boot.tizip and other files are also updated.

So basically, to check if the code is updated by someone, check that modified dates of the files under Boot directory. I suppose only .bootdata files should update as they contain saved persistent data. Of course, you can easily change the dates with 3rd party program. So one solution is to compare the Port_851.crc file contents since it contains the CRC check value of the code. It will always change when boot project is updated.

Quirzo
  • 1,183
  • 8
  • 10