Selection Sort Method

Ammar

Member
Join Date
Aug 2005
Location
Selangor
Posts
1
I'm a novice to S7-200 (CPU 224) and really need help to solve the problem that I'm having at the moment, I have two groups of data to be sorted out as below:

1) The first group of data is for the required length size of sheet metal to be cut (example length value: 23165mm) and going to be stored into a memory location VW204 - VW282 (40 locations).

2) The second group of data is for the required quantity to be produced for each required length (example quantity: 12pcs) and the data going to be stored into a memory location VW404 - VW482 (40 locations).

3) I'm using Add To Table instruction for the data entry via a HMI (Manufacturer: HITECH, Model:pWS1711),where VW100 for length data entry (write to VW200 table)and VW300 for quantity data entry (write to VW400 table).

4) The length data is entered randomly in various length sizes and in pair with the quantity data.

Problem:
The length size need to be sort out in descending order and the quantity data need to follows the sorted length to whatever location the length data had been moved after the sorting process(example: If VW204 moved to VW210 then VW404 need to be moved to VW410 and so on).

I had surfed trough some websites (see below) showing some example programming of data SELECTION SORT method and this might can help for someone whom are also expert in some other programming language to interpret the programm into Simatic ladder. Really appriciate from this forum community for helping me to solve the problem. it might be as simple as 4 or 5 rungs of programming but I'm still learning.

Thank you.
emotion-9.gif


http://www.vb-helper.com/tut1.htm#Quicksort
http://www.ee.unb.ca/brp/lib/java/selectionsort/
 
Indirect addressing needed

I don't know the S7 range, but this sounds like a case for using indirect addressing.

You could match quantities to length easy enough, and there may be a sort function in the S7 that you could use, or you could 'roll your own' sortation block or code.

There is bound to be an easy way to do it, you just need to find out how, and make sure you understand it.
 

Similar Topics

Hello all, I am attempting to sort a selection list via 'part-selection' buttons. Ex. a certain type of model is selected, I only want to have...
Replies
5
Views
1,355
I need an enclosure for wifi access points that will be outdoors. The antennas will mount outside the box but everything else inside. Standard...
Replies
4
Views
156
I am trying to implement a profibus network and am a newbie in the automation and communication industry. what are the components required for the...
Replies
1
Views
105
Dear Members; We are going to design a Simplex Control System With Following: 1. 24 Digital Inputs (SIL 2) 2. 24 Digital Outputs (SIL 2) 3. 4...
Replies
14
Views
1,132
Respected Members; I am going to design the PLC control system. The requirement as under: 1. Input/ Out put modules are SIL 2 certified. 24...
Replies
2
Views
413
Back
Top Bottom