The example in the documentation is good, though I would like to make some adjustments and show a good use case for such an example. By coincidence I revisited their web page to check it out, and now a description is available! I think the documentation has done a good job describing the possibilities with the ANY-type, but I wanted to elaborate with this a little further.įirst of all, the documentation only mentions that the only current possibility to use the ANY-type as VAR_INPUT inside (free) functions, but I’ve found them to be working fine as VAR_INPUT in function block methods as well (though not as VAR_INPUT inside function block bodies). Why was there no such thing available in the world of TwinCAT/IEC 61131-3? For a long time there was a link to a type “ANY” in their data types section of TwinCAT3, but the only information available on the website was that the “ANY” type was not yet available. I’ve been using generics in Ada and templates in C++, and many other languages have similar concepts. I like Ralf Hinze’s description of generic programming:Ī generic program is one that the programmer writes once, but which works over many different data types. “Generic programming… what’s that?”, you may ask.
While doing software development in TwinCAT, I have always been missing some sort of generic data type/container, to have some level of conformance to generic programming.