The program used for this example can be found on github.
Alternatively the program can be obtained via apax:
apax create ae-debugging
Debug symbols information
The sdb needs the "debug symbols information" to work correctly. The debug symbols information contains data about where to find a symbolic address (for example a variable) at a physical absolute address on the SIMATIC 1500 PLC.
The debug symbols information is generated by the ST Compiler (stc) command line tool. The stc does not generate any debug information as standard, so the '--debug' parameter must be provided if debug information if required. This can also be done using apax.yml and the apax build command.
The following snippet must be added to 'apax.yml':
variables:
APAX_BUILD_ARGS:
- "--debug"
It is strongly recommended that the optimization feature be turned off ('--Optimize') from the stc if a program is to be debugged. If optimization remains active during debugging, it may break some debug features.
See stc documentation and apax.yml reference for more information.
When downloading an application via the sdb, the debug symbols information is stored directly on the SIMATIC 1500 PLC. The sdb can then read the debug information from the PLC as required.
Build and download program
The program can be built and downloaded to the PLC as follows. Make sure apax.yml contains the snippet from above.
apax build
apax sld load --target 192.168.0.1 --input ./bin/1500/ --certificate ./cert.cer --password aSecurePassword --restart --accept-security-disclaimer