Native way to read PLC Configuration Version

Hi Community,

I’ve been searching for a way to read the Configuration Version of the software running on a PLC from a PC (Linux). I am aware that you can use “ArProjectGetInfo” on the PLC, but this is not ideal since it requires specific coding on all PLCs.

I was sure that this information would be present in the SDM or OPCUA Server, but it doesn’t seem to be - only found AR version. The only place I found something was during a transfer to a PLC:

So, it seems like the information is present in the PLC somehow without using the ArProject library. Does anyone know a solution to this?

why not read it out and transfer the information to a PV and then use OPC-UA or linux ANSL library (in PVI package) ?

a much better (more reliable versioning) way is to use Git in combination with this project:

br-na-pm/BuildVersion: Collect git version information during a project build

which collects Git’s data an store it to PVs

Regards,

I know all this, and yes, it can work, but I’m in the process of creating a generic Software Deployment Server, and I can’t rely on the PLC Programmer to publish a PV with the information (also, the naming of the PV might be different from project to project?).

I thought the cleanest solution would be to use the Configuration Version since it is natively present on all B&R PLCs. :blush:

I just find it strange that we get so much info in the SDM, like build date and AR version, but nothing about the configuration version (which I know many customers use for software versioning specially those who don’t use git or mercurial).

Seems like this should be possible to read with PVI Services (Windows specific, .NET, DLLs, etc…).

Automation Help: PVI Serviecs AppInfoProjectVersion Property

I have personally not used PVI services so can’t help further.

for sure this versioning is present during runtime. Otherwise you could not read it out with the fb you mentioned.

for example it is also present in the system logger (which is part a systemdump in ‘Systemdump.xml’ )

image

but still some caveats here:

  • Systemdump.xml only contains a very limited number of entries
  • this message is entered during startup of the CPU only
  • you still have to rely on the programmer :slight_smile:

PVI services will be tricky on a Linux PC, but thanks for sharing, Tommi!

Haha, good catch, Christoph!
It’s a bit of a crazy workaround, but I guess this could actually work if we use the built-in logger in SDM instead of the systemdump.xml. We could use the $versinfo and mimic the GET request when clicking the upload from target:

The endpoint with IP 192.168.1.12 will be:

http://192.168.1.12/sdm/cgiFileLoop.cgi?type=16&scope=<Default>&module=$versinfo&option=0

Then just search for the top “Configuration version” and we should have the configuration
version running on the PLC. :blush:

2 Likes

wow excellent !
I would have used the Systemdump.xml and some Python for the xml:

but sure that would be much more effort…

Hi @mads.andersen ,

do you know the ANSL UIF?
It’s an ANSL interface that can be used in Linux (a bit like PVI DLL in Windows, but not the same interface / not code compatible).
With the function “ANSLI_CPU_GetApplicationProjectInfo” you can read out those informations needed.

But please be aware that ANSL UIF is an interface, not a program :wink: That means there’s some own coding work to do, for example developing a own little shell program…

ANSLUIF can be found in your PVI installation path in the “An\Ansl” subdirectory (for example: C:\BrAutomation\PVI\V4.12\An\Ansl), when PVI API was installed before.

I also have to mention, that at least in ANSLUIF 4.x, the above named function wasn’t documented, I found it in the ANSLUIF header file :wink:

Best regards!

5 Likes

Wow, never heard about this one and it works!

I just compiled a c program that calls “ANSLI_CPU_GetApplicationProjectInfo()” which gave the following callback (decoded from binary):

<?xml version="1.0" encoding="utf-8"?>
<ApplicationInformation AutomaticRuntime="H4.93" ProjectId="1732716597" 
ProjectName="CountingMachine" ProjectVersion="2.1.42" ArType="A" />

Thank you a lot, @alexander.hefner ! This is quite cool and could be useful for a lot of stuff! :smiley:

2 Likes