Hi all,
it would be useful if the FOR LOOP had an indicator which is set to true on the last iteration of the loop. This terminal could also be set to true if the conditional terminal is used to abort the loop.
My use case:
If have various "channels" (Bits and Bytes) over which I communicate with an external ProfiBus device. These channels are identified by enums. The data values themselves are organized in a predefined numeric array in a FGV, and depending on the enum value I replace parts ("chunks" of bytes) in the array.
In most cases, I have to update more than one parameter in the external ProfiBus device. I change the values in the data array FGV using a for loop, and after the last array subset replacing action, that is in the last iteration of the loop, I actually transfer the new data array via an "update ProfiBus" notifier.
To "detect" the final iteration, I could check "i < (ArraySize - 1)", which means to have this additional (tiny) piece of code in each iteration. Another option - which I currently use - is to provide an addtional array to the loop with just as much boolean elements as in the "channel enum array", in which only the last element is set to true, to set the "update notifier" only once.
To make it short:
Please provide an additional for loop indicator which is set to true in the last iteration of the loop.
Greetings
A-T-R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.