Closed Pippen19 closed 2 years ago
This looks weird indeed. Did you declare the variables as VAR or VAR_INST? Is there a difference? Which version of the applicable software did you use? (TcUnit library, TwinCAT XAE version, Visual Studio version etc) Under what environment did you run the software? PLC? Virtual machine? If you rename the variable to something else than Test, does this still prevail? If no, does the varialbe have to be named Test?
No, there is no difference between VAR or VAR_INST. I use TcUnit library. I use it on a PLC. No, I have the problem only with the name "Test".
In the meantime I found out that it has nothing to do with TcUnit, but is a fundamental problem: The problem is that the program in which the FB is instantiated is also called "Test". Apparently the namespaces are not cleanly separated. I have reported it to Beckhoff.
I was more curious of what versions of TwinCAT, TcUnit, etc you were using to reproduce the problem.
But if you know the problem is not related to TcUnit, I will close this issue.
I use TC3.1 4024.29, but I think this problem is old. TcUnit has nothing to do with it. I reproduce the problem in a dummy project without TcUnit:
This problem occurs on other CoDeSys systems as well. It's hard to reproduce but my guess would be there is a problem between Online (PLC program) and Editor's debug information.
What do you mean with "hard to reproduce"? I find it's easy to reproduce (see my little dummy project).
What do you mean with "hard to reproduce"? I find it's easy to reproduce (see my little dummy project).
More complex the program, more likely you will encounter this problem, it those scenarios is it hard to pinpoint where exactly the problem is, this is what I meant. I will have a look at your project, thanks.
🤣 just did try... this problem is even more silly than the one I had in mind. Thanks @Pippen19.
If I instantiate a variable with the name "Test" and the type "UINT" in an FB derived from FB_TestSuite, then the program no longer stops there at a breakpoint.
If there is no variable "Test" in this method, the program stops at the breakpoint:![image](https://user-images.githubusercontent.com/98035239/171845555-bec21551-1d6f-4315-a74d-ab7406c95738.png)
If there is a variable "Test" in this method, the program does not stop at the breakpoint:![image](https://user-images.githubusercontent.com/98035239/171846004-19b5757a-9423-4750-993c-5a03568dcb5d.png)
On the fly, I haven't figured out what triggers the problem. Maybe it is also a Beckhoff problem (even probable). But it is astonishing, because it only occurs in FBs that are derived from FB_TestSuite.
If I use STRING as type instead of UINT the following error occurs when trying to set a breakpoint in this method:![image](https://user-images.githubusercontent.com/98035239/171846572-00009e5d-647e-48eb-b2b8-0bef84cba3cd.png)