I want to find out the latest date of my executables, *.br, or simply when was the latest program change done.
I try this by using DInfo() and DRead() in StructuredText, AS4x and search among the found files and their date.
The code works if I search device ‘user’ that is created with DevLink_0 and "/DEVICE=F:/Data "
But not sure how to access the path of the drive where executables are located. I tried using DEVICE=D: and some combination of that. The best I get is an error 20706 fiERR_ACCESS.
Any idea on how to do this? Maybe there is a better idea than using DInfo/DRead.
SDM that is part of our HMI can view executables with file date, but I need my application to read it out.
If you’re just looking to get information about the last program change, then I highly recommend BuildVersion. It runs a Powershell script during a project build to get the current git information (branch, tag, uncommitted changes, etc.) and then stores that information in the project such that it can be viewed after the change is transferred to a machine.
@Flystedt,
Just for some background information, the reason for why DevLink threw error “20706” was because of the partition you were trying to access. Take a look at the Information from the help explorer about FB Devlink
“Read and write operations on the partitions of the safe module system (D: and E:) are no longer possible. Changes to the project may therefore be necessary when changing versions.”
For Reference, the partitioning of the CFast/CompactFlash (without hypervisor) is as such:
SYSTEM partition (C:) - Always the first partition DATA1 (D:) and DATA2 (E:) - DATA1 mirrors to DATA2 for redundancy. Contains RPSHD/SYSROM and RPSHD/USERROM subdirectories USER partition (F:) - Completely free for user applications
for more info see the following from the help explorer.
So if Devlink do not support reading D: or E: where executables are stored, I guess that is not the way to find out.
However should it be possible in some other way. Using SDM(SmallDiagnosicManager) can I on a web page see and upload the modules, even save them as an csv-file. So there must be some FB or other way I can use to retrieve the *.br modules.
I want my application to find out and use that information.
it might be helpful if you could describe the use case to us.
Are we talking about “files” or “modules”?
*.br ist just a container file for many types of modules and later versions of AR might handle this in a different way (e.g. SG3 PLCs didn’t use a file system).
You can retrieve information about ‘modules’ using MO_info(), which I believe is more reliable than relying on the creation date of files, which depends on the underlying file system and can be manipulated.
MO_info not only delivers the creation date but also address and size of the data that can be later on used to calculate a reliable hash checksum.