Can anyone tell me why my variables are red in the attached picture?
I just started to use siemens and I am trying to understand how udt works. Is there any tutorial or sample codes about the user define struct and pointers?
One possibility is that you have edited the UDT whilst the FB was open. Close down the editor and re-open the FB and insert the UDT again. Which version of Simatic manager are you using?
When I try to use a FC instead of FB, it does not work again. Everything same except FB is changed to FC. Does FC not work with UDT because it doesn't have its variable space?
When you enter the UDT declaration for the IN_OUT, replace the <nr> with your selected udt number as opposed to adding the number to the end of the "UDT" string. It is a bug in the editor. Saving the FC after updating the interface only (no code entered), closing and re-opening the FC will also fix it.