If you are thinking about linking a C function/object it seems you need “Codesys Extension SDK”. We also need the target to support this option and I do not know if Wago runtime does. The Codesys SL products will work I believe. Maybe also the virtual image.
We can also download Codesys control extension package, I think there are some examples there of how the API looks like. Either way the C file need to be rebuilded.