9/16/2014 8:56 AM | |||
Joined: 1/5/2011 Last visit: 6/15/2024 Posts: 815 Rating: (123) |
Dear Joseph, what you could do is use an array to storethe number of counts, use avariable index to access the different components of your array. This can either be done by STL(not applicable for S7-1200), SCL and in S7-1500(not sure about S7-1200) it can also be done in LADDER.
For SCL programming following syntax can be used: "<Data block>".<ARRAY>["i"] // one-dimensional ARRAY For STL, check previous link, an example is given there. (not applicable for S7-1200) Another option is using multiple move blocks which are enabled with a comparator function. You'd want to compare the current counter value with a fixed value. For example: If index =0 then move countvalue to dbw0 If index =1 then move countvalue to dbw2 If index =2 then move countvalue to dbw4 ... Increase your index number upon clicking the button on your hmi. PEEK/POKE can also be used for S7-1200. ( PEEKinstruction is used to write a memory address to a memory area without specifying a data type.) So lots of possibilities, you can choose whichever one suits you best. Let us know what you think. Kind regards, Jens |
||
Last edited by: Jens_app at: 9/16/2014 9:02 AMadded peek/poke (optional) Keep it simple and on-topic. |
|||
Follow us on