2/28/2020 9:03 PM | |
Joined: 1/3/2019 Last visit: 12/16/2022 Posts: 64 Rating: (0) |
Hello dear experts.. I have a process that has six electromotors... Now i have decide to sort their runtime from low to high... Unfortunally i'm not strong in STL , is there a way , or special math algorithm for that..?! ( i found MIN , MAX block in tia portal but its not suitable for sorting run time value ) Thanks alot.. ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 03/02/2020 06:22:39New subject after splitting En. M.ABZADEH |
|
2/29/2020 1:04 PM | |
Joined: 9/21/2012 Last visit: 5/25/2024 Posts: 3949 Rating: (446) |
You have a SCL network, and trying to insert STL code. |
3/2/2020 8:55 AM | |
Joined: 9/23/2005 Last visit: 5/23/2024 Posts: 4552 Rating: (699) |
Which S7 family is your question about? In case it's S7-1500 check this out. There's a Shell's sort implementation. However I'm pretty sure it is not what you need. In fact you need to have some references to motors (indices/symbols/whatever what will tell you which motor it is) sorted based on their runtimes. But I might be wrong, not knowing why you want to use a sorting. |
Regards, |
|
This contribution was helpful to1 thankful Users |
3/2/2020 10:31 AM | |
Joined: 3/5/2017 Last visit: 5/24/2024 Posts: 771 Rating: (126) |
Hi, Attached is BubbleSort in LAD. I'm not that good with LAD, so there can be lots of better ways of coding that. EDIT: My CPU firmware is 1.x so i cannot use arr[*], UPPER_BOUND or LOWER_BOUND And that kind of sorting does not really make any sense. It won't arrange motors just times. AttachmentBubbleSort.pdf (275 Downloads) |
Last edited by: K_Ohjus at: 03/02/2020 10:31:52Last edited by: K_Ohjus at: 03/02/2020 10:33:41Last edited by: K_Ohjus at: 03/02/2020 10:42:22Last edited by: K_Ohjus at: 03/02/2020 10:54:01- Trying is the first step towards failure. |
|
This contribution was helpful to1 thankful Users |
3/7/2020 8:58 AM | |
Joined: 1/3/2019 Last visit: 12/16/2022 Posts: 64 Rating: (0) |
Thanks a lot |
En. M.ABZADEH |
|
Follow us on