PartTimePlcProg
Member
Hey,
is it possible to know, within a program, the number of the FB, or OB, the code is currently executed in?
Like, some function GetCurrentFB(), called from inside FB21, will return 21.
This could be helpful for debugging, e.g. I could store somewhere which FB did something. Using hard-coded numbers is not change proof.
Sure, *if* a consistent numbering scheme is used throughout a program (independent of FB numbers) and no mistakes are made, changing FB numbers would not be a problem. It would be nice to have something "automatic", though.
is it possible to know, within a program, the number of the FB, or OB, the code is currently executed in?
Like, some function GetCurrentFB(), called from inside FB21, will return 21.
This could be helpful for debugging, e.g. I could store somewhere which FB did something. Using hard-coded numbers is not change proof.
Sure, *if* a consistent numbering scheme is used throughout a program (independent of FB numbers) and no mistakes are made, changing FB numbers would not be a problem. It would be nice to have something "automatic", though.