twincatstructured-text

Unknown Type Errors when using functionblocks from my own library project


So I have a library project where I defined a couple of functionblocks and interfaces. Now I want to use this library in a plc project (in the same twincat solution). So I do the whole save all, rebuild, save and install as a library spiel. If I try to declare a VAR in my MAIN it will result in unknown type errors. I have fiddled around a bit, and when I declare an interface withouth any properties or methods (in the lib) then I it does show up and can be used in the MAIN. But as soon as I add a property or method the class/FB/POU dissapears in the eyes of my MAIN...

I feel like I'm overlooking some option / atribute to help the PLC project to use the lib properly... What am I missing here? EDIT: as you can see in the images, empty blocks are found, adding anything magically makes it dissapear error available classes

EDIT 2: I solved my problem by copying the lib to a new solution. Something in the original project made it be broken. Why it did that is still a mystery...


Solution

  • Try following steps:

    if this is successfull, install the library again, remove it from the reference section and re-add it. Then clean again and build all.