When developing new code, especially for a project that is still in development in other disciplines (such as electrical or process), not all of the information may be available

This may mean that you end up with something like the picture above. You know you need something as an interlock or control method at a particular point, but you just don’t know the specifics yet.

Wildcards tag group in project tree
Wildcard” Tag Group

By creating a PLC Tag group for Wildcards, we can segregate them from our actual programming tags.

Wildcard Tags inside group

These tags are then assigned high memory addresses (in the 900 range for me), well out of the way of standard IO addresses in my system.

I can then cross-reference these to see where they are used and how many “Unknowns” I have left in my project.

I have a different type of WC variable for each data type that I use often.

Additional Benefits

There are some other benefits of using “Wildcards” too

  • Libraries will declare a warning if a globally accessible tag is used within an object you are trying to add to a Type Library
    • This helps ensure that your code is always finished before adding to a Library
  • Compile Compliant
    • The compiler does not see “Wildcards” as an issue because it’s still tied to a valid memory address
    • This means code can be tested, even if all the information is not available yet
  • Write Control
    • By writing a false to the WC_Bool variable at the start of the PLC scan, you can ensure that no code will accidently be executed during testing

Leave a Reply