Sort an Array


I create an arry with two dimenions.

F1: ARRAY [0..3, 0..1] OF UDINT;

Now I would like to sort this array in the first dimension ascending.

Does somebody has any idea?

Add New Comment


asked 9 days ago




given the small size a simple double For loop "bubble sort" should do it. Do you need to do this cyclically? What is the purpose?

Best regards



answered 9 days ago


By TW on 8/10/2017 | Like (0) | Report

I have 4 Motors M1-M4.
In the array i would safe the running time in row one and in row two the name of the Motor.
then i will sort the array. So I have a list with the motor with the least running time to the max running time.
With row two i can check the motor to have the least running time.

Do you have an example for me? ;-)

By JuergenV on 8/10/2017 | Like (0) | Report

Check out
There is a Pseudocode implementation which is pretty much like ST

By TW on 8/10/2017 | Like (1) | Report

Sort_Change := false ;
for i 0 to 2 by 1 do
if F1[i]>F[i+1] then
Sort_Change := true ;
end_for ;

until not Sort_Change
end_Repeat ;

Add New Comment

Get weekly AKS updates

Partner Exclusive Webinars


> – Login to the partner portal to register

Points Redemption Program - Redeem your points for ABB training, Bluetooth speakers and mugs. Terms and conditions >

Earn points when you refer a friend
AKS Referral Program is "Live" - Learn more

AKS Experts

Ask Harsha.D   

Rank: 5

Tech.Support,software and commisioning engineer with Proficient knowledge in 800xA and its products, RNRP,Networking in general.

Ask Dieter Henkel   

Rank: 24

Ask Sumit Gargav   

Rank: 2

I have worked with Freelance in majority, with 800xA FD and Melody system partly. Also had opportunity to work with Protocols - HART,Profibus,FF & Modbus.

Ask Govindaraj   

Rank: 10

Working in ABB India Operation Center. Have Project engineering and commissioning experience in ABB 800xA, Freelance, AC500.

Ask Stefan Stromqvist   

Rank: 1

I joined ABB in the year of 1994 and has since 1999 been working as a Service & Support Engineer at BU Control Technologies in Västerås, Sweden. My areas of expertise are: 800xA Base, 800xA for Advant Master, Information Management, operating systems, RNRP and Ethernet comms/networking in general.

Ask Flavio Mussolin   

Rank: 6

ABB AVP, Senior Electronic and Automation Engineer with over 30 years of experience in the field of process automation automotive, pharmaceutical, hollow glass, steel and rolling.

Ask kstoilov   

Rank: 22

Control System Engineer: 800xA, Compact 800, AC500, AC31-50, Advant Master, Simatic, AC&DC Drives 11 years worked for ABB - Control Systems

Ask nikismith   

Rank: 258

I have been a part of the Recording & Control Factory team for 17 years in total, having spent a number of years as a repairs technician withi the manufacturing department, but being in my current role for 9 years now.

Ask MMM   

Rank: 4

ABB PA CT Technical Support

Ask Rob Lyon   

Rank: 3 I'm an independent DCS software and commissioning engineer with extensive experience in 800xA and other ABB products. I've worked in almost every corner of the world and still haven't seen it all.