beckhoff TwinCAT 3 — 5.2.2.1 Test signing

Preparation - only once | Module signing Command prompt from Microsoft Visual Studio 2010 / 2012 with administrator rights . (Via: All Programs -> Microsoft Visual Studio 2010/201 2 -> Visual Studio Tools -> Visual Studio Command Prompt, then right-click Run as administrator ) Developer Command Prompt from Microsoft Visual Studio 2017 / 2019 with administrator rights. . (Via: All Programs -> Visual Studio 2017 -> Visual Studio Command Prompt for VS 2017/2019, then right-click on Run as administrator ) Only if the WINDDK has been installed: Normal prompt ( Start ->Command Prompt) with administrator rights, then change to directory %WINDDK7%\bin\x86\ , which contains the corresponding tools.

1. On XAE: In the engineering system, enter the following command in the Microsoft Visual Studio 2010 / 2012 command prompt with administrator rights (see note above): makecert -r -pe -ss PrivateCertStore -n CN=MyTestSigningCert MyTestSigningCert.cer (If you do not have access rights to the PrivateCertStore, you can use a different storage location. This must also be used in the PostBuild event [ } 34] .) р This is followed by creation of a self-signed certificate, which is stored in the file "MyTestSigningCert.cer" and in the Windows Certificate Store. р Check the result with mmc ( Use File -> Add/Remove Snap-in -> Certificates ): 2. On XAE:

configure the certificate so that it is recognized by TwinCAT XAE on the engineering system. Set the environment variable TWINCATTESTCERTIFICATE to "MyTestSigningCert" in the engineering system or edit the post build event of Debug|TwinCAT RT (x64) and Release|TwinCAT RT (x64). The name of the variable is NOT the name of the certificate file, but the CN name (in this case MyTestSigningCert). From TwinCAT 3.1 4024.0, the configuration of the certificate to be used is carried out under Tc Sign in the project properties. To use signing via the operating system, as described here, please pay attention to the project settings. TwinCAT 3 31 Version: 1.19.1