i am trying to check if a specific input from a hardware device is linked to my plc application on Twincat 3.1, in my example below i would like to check if "Terminal Overtemperature" is linked to a variable in the plc application side at runtime.
I appreciate any help, thanks in advance.
PS1: I do know that i can evaluate the "InputToggle" or the "CycleCounter" but these variables will only provide information if any input is linked.
PS2: I also try the method provided by Beckhoff Infosys Documentation (pragma approach), Attribute 'TcLinkTo' / 'TcLinkToOSO', this will force to link the variable every time that the configuration is downloaded nevertheless if the input is not found or if the parameter is not correctly set in the attribute (ex. wrong name) this will just generate a warning in compiling time and this warning will be deleted at runtime

New answer
There is a way. You can do this with
F_GetMappingStatusMake sure you call it in the Cyclic Context, that is not during
FB_initorcall_after_init, see here:Old answer
You can use the Automation Interface's
HRESULT ProduceMappingInfo();. This method will return an XML file with all mapped variables.Example return from InfoSys: