Hi Fabian,
yes - altough you can't see the ST-Code in TIA Portal, it is possible to monitor the variables of a SIMATIC AX library block imported in TIA portal.
Option 1: When you have instanciated a TIAX library block in TIA Portal, you can of course see and change the values of the interface of the block when you go online on the PLC:
Option 2: You can also monitor the values of the static variables of the FB in the instance DB. Please note that the structure you defined in SIMATIC AX is preserved and visible to the deepest level here (e.g. "_c" is an instance of the counter class I created as a static variable in the FB. "val" is a static variable of this class. I can still see this in TIA Portal):
Option 3: If you need a more detailed view (not just interface and static variables, but variable values in each line of your code), you can also debug together with SIMATIC AX and TIA Portal. To do so, you need to connect with SIMATIC AX to the PLC where the program is running. To configure the connection, modify your launch.json file in the .vscode folder of your project to include the correct IP address of the PLC and the symbolsPath - which points to the compiled library file in your project (.lib-file which has been the base to generate the TIA Portal library):
After configuring the connection, open the block you want to debug and click on the debugger-symbol in the upper right corner (PLC symbol with a magnifier glass - see red square in next screenshot). The connection is established and you can set logpoints in all code lines you are interested in. You can not only show the variables that are called in this line, but all variables that are accessible in your current context (e.g. class variables).
Orange values are up-to-date-values. Grey values haven't been updated in the last cycle but you can see the last recorded state (e.g. in the screenshot in line 25 the value is not updated because the if-statement is entered in line 23 already). Grey "..." mean that this line has never been hit since the debugger is running (e.g. in the screenshot line 28 has never been reached since the condition in line 27 was never fulfilled).
Please note that you can only read values in SIMATIC AX, but can't change (write) them. If you need to change the value of a variable, do it in TIA Portal.
Also please note that for the debugging in SIMATIC AX to work, it is important that the library blocks are used inside a software unit in TIA Portal, since only then the fully qualified name (including the namespace) is preserved. If this condition is not met, the debugger can't find the variables.
Hope these explanations help. Feel free to reach out to me if you have any further questions!
🐞🔨 Happy bug bashing
Thanks Johannes for the great answer!