I noticed that when I use certain blocks in Step7, that you must supply information at each input or output of the block or it will not compile and has the 3 red ???.
However I also notice that some blocks do NOT require that all the inputs and outputs be defined.
Like the S_OFFDT for example.
I would like to include this feature in my blocks and functions that I write.
In this way I could have an optional item that could be left blank if not needed this time.
In this way I could combine 2 similar functions or provide several options of output for the same function.
Another good example is the PID block.
I suspect it may be because these are FBs with a DB assigned and the position is defined with a default value if none is provided.
Is this what happens when you name a Timer? Does naming "timer" to "T100" reserve a small bit of memory in which defaults are placed?
To compress:
Can you write a function such that if a variable input is left undefined, a default value is inserted.
or no value is required to save the block?
However I also notice that some blocks do NOT require that all the inputs and outputs be defined.
Like the S_OFFDT for example.
I would like to include this feature in my blocks and functions that I write.
In this way I could have an optional item that could be left blank if not needed this time.
In this way I could combine 2 similar functions or provide several options of output for the same function.
Another good example is the PID block.
I suspect it may be because these are FBs with a DB assigned and the position is defined with a default value if none is provided.
Is this what happens when you name a Timer? Does naming "timer" to "T100" reserve a small bit of memory in which defaults are placed?
To compress:
Can you write a function such that if a variable input is left undefined, a default value is inserted.
or no value is required to save the block?