I created a function block to initialize its Path string variable to the function block's path using the appropriate attribute pragmas as shown below. An instance of this function block in the main program is initialized to the correct and expected path.
I created a second function block in the same manner that also contains an instance of the first. An instance of this block, in the main program, and its instance of the first block are initialized correctly and as expected.
I created a third function block which extends the second block as shown below. This block does not contain attribute pragmas or variable declarations. Instead, it inherits everything from the second function block. An instance of this block in the main program initializes both inherited path variables for Base and Function function blocks to the same value, which seems to be incorrect or at least unexpected.
Is this a bug or correct behavior? If correct behavior then can someone explain why? I am working with a client who is making good use of this feature and I would like to give them a satisfactory when they ask me the above questions.
We have an adequate work around so that's not a problem. However, they and I would like to have a better understanding of what's going on here and why. We want to have confidence that we are producing robust and quality applications for my client's customers.
Any insight or information will be greatly appreciated.
I created a function block to initialize its Path string variable to the function block's path using the appropriate attribute pragmas as shown below. An instance of this function block in the main program is initialized to the correct and expected path.
I created a second function block in the same manner that also contains an instance of the first. An instance of this block, in the main program, and its instance of the first block are initialized correctly and as expected.
I created a third function block which extends the second block as shown below. This block does not contain attribute pragmas or variable declarations. Instead, it inherits everything from the second function block. An instance of this block in the main program initializes both inherited path variables for Base and Function function blocks to the same value, which seems to be incorrect or at least unexpected.
An example project and screen shot of the initialized path variables are attached.
Last edit: rickj 2020-11-12
Is this a bug or correct behavior? If correct behavior then can someone explain why? I am working with a client who is making good use of this feature and I would like to give them a satisfactory when they ask me the above questions.
We have an adequate work around so that's not a problem. However, they and I would like to have a better understanding of what's going on here and why. We want to have confidence that we are producing robust and quality applications for my client's customers.
Any insight or information will be greatly appreciated.
Last edit: rickj 2020-11-12