简体   繁体   English

在哪个文件中存储在Beckhoff TwinCAT 3 PLC中的_AppInfo数据

[英]In which file is the _AppInfo data stored in Beckhoff TwinCAT 3 PLC

I'm looking for the 'AppTimeStamp' information so this can be used to verify that the code is not updated/changed by service personel. 我正在寻找'AppTimeStamp'信息,因此可用于验证服务人员未更新/更改代码。

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 使用C#检测Beckhoff PLC上的代码更改在此位置我已经找到了部分信息,但由于“新用户”的限制,我无法添加评论

You can find the AppTimestamp in the _AppInfo instance. 您可以在_AppInfo实例中找到AppTimestamp。 So just call _AppInfo.AppTimestamp in your program to know the time of the last application start. 因此,只需在程序中调用_AppInfo.AppTimestamp即可知道上次启动应用程序的时间。 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. 确保您还检查自上次使用OnlineChangeCnt计数器下载后的在线更改数量,您也可以在_AppInfo实例中找到该计数器。

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 . TwinCAT将数据保存到C:\\ TwinCAT \\ 3.1 \\ Boot文件夹, 此处说明不同的文件。

The ProjectName can be found for example from the configuration data ( CurrentConfig.xml ), from the end of the file (TcBootProject/ProjectInfo/ProjectName). ProjectName可以从配置数据( CurrentConfig.xml ),文件末尾(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. 同一个文件包含一个日期( <TcBootProject CreateTime="2019-06-10T13:14:17"> ),但它似乎是创建的启动项目的构建时间。

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? 我在任何文件中都找不到AppTimestamp的日期,但是TwinCAT可能会使用这些文件夹中文件的创建时间吗? 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. 在不更新引导项目的情况下更新软件时,将更新文件Port_851_act.tizip So you can check its timestamp. 所以你可以查看它的时间戳。 When you update the boot project too, Port_851_boot.tizip and other files are also updated. 当您更新引导项目时,也会更新Port_851_boot.tizip和其他文件。

So basically, to check if the code is updated by someone, check that modified dates of the files under Boot directory. 所以基本上,要检查代码是否由某人更新,请检查Boot目录下文件的修改日期。 I suppose only .bootdata files should update as they contain saved persistent data. 我想只有.bootdata文件应该更新,因为它们包含保存的持久数据。 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. 因此,一种解决方案是比较Port_851.crc文件内容,因为它包含代码的CRC校验值。 It will always change when boot project is updated. 更新引导项目时,它将始终更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM