Skip to content

why can not i use this rule to validate variable declartion #1486

Answered by msujew
zrwsmd asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @zrwsmd,

I assume you're using the default lexical scoping mechanism. Since the variables inside of the InputsListSingle object are nested in its local scope, they are not visible to the elements of the surrounding PLC_PRG program. You need to adjust the ScopeComputation (see here for an example) to ensure that elements are visible outside of their parent node.

Note that using the word validate here is incredibly confusing. The issue isn't that you cannot validate, but that the reference cannot correctly link. The validation error is only a consequence of the linker error.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@zrwsmd
Comment options

@msujew
Comment options

@zrwsmd
Comment options

@msujew
Comment options

Answer selected by zrwsmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants