Debugging Visual Studio 2017 and C# Program

Hi, I tried to wrote a very simple first example with C# and VS 2017. I could run the prog in PLCnext. Thats fine. It is running and I can add two values a = b+c. But if I try to enable the debug mode in VS, then this message box appears. It seems that the debug mode is running (I adjust also the settings files on the PLCnext controller → gateway, port, etc.) What could be the reason for that message box? Debug PLCnext Firmwar 2020.6.1 PLCnext Eng. 2020.6.2 By the way. It seems that you need per Inputport variable a separate property definition. Can’t see the InputPort “c” in PLCnext Eng. [Global, OutputPort] public int a = 1; [Global, InputPort] public int b = 2; `` public int c = 3; With this syntax I can see the InputPort “c” in PLCnext Eng. [Global, OutputPort] public int a = 1; [Global, InputPort] public int b = 2; [Global, InputPort] public int c = 3;

`` Thanks. Alex

Hello Alex, it looks like you have unsaved changes? Please try saving, recompiling and downloading the project. Then setting the breakpoint. You can follow these instructions to setup remote debugging for C# function blocks. You can find some syntax examples here. Some more examples can be found at GitHub. As far as I know attributes always just impact one type declaration. So the behavior is correct. If you want to declare multiple variables at one attribute you would have to do it like this: [Global, InputPort] public int b = 2, c = 2; I will check if this is intentional or if InputPort attribute should be added to “c” in the template. Kind regards, Oliver