8/23/2012 5:04 PM | |
Joined: 1/28/2009 Last visit: 7/11/2024 Posts: 6844 Rating:
|
Hello , changing array size in runtime (dynamic array size) is previously discussed here: change the size of the arrayhow to creat arrayBut to summerize all discussion, experts ere scepticalto the issue,But I recommend reading the discussions. Best regards Hamid Hosseini |
8/24/2012 7:17 AM | |
Joined: 10/7/2005 Last visit: 7/13/2024 Posts: 3009 Rating:
|
Hello Gustaf_ putting aside while you may need this ability,you can in general dynamically "allocate" memory in runtime (as well as "destroy") in an S7 which makes itpossible for you tocreate dynamicArray's. The "trick" is create a DB for your Array size requirements via SFC22"CREAT_DB" as well as being able to delete it again once you did with itwhatever it is that you need to dovia SFC23 "DEL_DB". You may in that case though also want to have a look at SFC24 "TEST_DB" to either check if the DB already exists or to perhaps reuse a suitably sized previously created Array DB. Additionally,SFC25 "COMPRESS_DB" may come in handy (in case you do need to create and delete DB's regularily in runtime). Last but not least, SFC20 "BLKMOV" and SFC21 "FILL"are usefulto copy Array data and to "preset" newly created DB's with for example zero values. In sums, it is all possible, but the question remains: What exactly do you need to do that requires dynamic (runtime based) Array creation. I hope this helps |
Cheers |
|
This contribution was helpful to
2 thankful Users |
8/24/2012 9:44 AM | |
Posts: 50 Rating:
|
Thanks Fritz!! |
Last edited by: Gustaf_ at: 8/24/2012 11:10 AMLast edited by: Gustaf_ at: 8/24/2012 10:56 AMLast edited by: Gustaf_ at: 8/24/2012 10:35 AM |
|
Follow us on