Using LD, FBD, etc., in some cases, you may not be able to develop the codes with a specific purpose.
In programming the PLCs you can use the textual languages such as STL to satisfy these type of purposes.
This is true for HMI programming and design as well. For example, in WinCC, if you want to change the color of a piece of pipe with a simple click on a button, it is really easy to use the codes like VB (and you know it is not possible to do it using LD programming). In WinCC and such software, there are lots of functions provided for the textual programming languages like VB and C to make coding easy.
I do not have a special industrial example in mind at the moment but you can easily find numerous samples thru a simple search.