SRT ladder

nur11

Member
Join Date
May 2018
Location
Texas
Posts
9
Hello dear forum users.
I am at a dead end in solving a simple problem for self-education.
There are 6 fans available, as well as engine hours, respectively, for each.
I wanted to start at a setting, for example from 10-20 1 fan with a minimum number of engine hours
With a setting of 20-30, 2 fans are already started with a minimum number of engine hours
With a setting of 30-40, already 3 fans start with a minimum number of engine hours
n the project, I realized the calculation of the operation of engine hours for each fan
I threw the working hours into a one-dimensional array and using the SRT function I want to sort the values ​​in ascending order
As described in the manuals, the SRT function sorts the array in decreasing and increasing order.
The first variable must be the maximum, the last minimum
What have I done wrong?
Sorting does not happen
Software RSLogix5000 v20.04
Hardware Emulator v16-21
Executed in a virtual machine VM Virtual Box
Sorry for my English
TL4xdwk

vX3fTfV


1.JPG 2.JPG
 
Last edited:
Actually, sorting did happen, but you never saw the result.

The SRT instruction executes on a rising edge transition of it's input rung cf. here, middle of page 530:
In this transitional instruction [SRT], the relay ladder toggles the rung-condition-in from false to true for the instruction to execute.
So it is only on such a rising edge transition that the [SRT] instruction on Rung 46 sorts the values in integer array [SORT]; in the examples in the JPEG images provided in the first post, that rising edge occurs, on one scan only, when discrete value (bit) [M228 CONTROL OIL TEMPERATURE] changes from 0 to 1, which in turn occurs on Rung 44 when the analog value [MW141 SENTPOINT OIL TEMPERATURE] first goes above 10.

On the next scan, it is unlikely that the [MW141] temperature would have dropped below 10, so [M228] would still be 1, and the sorted values in SORT are then de-sorted by the MOV instructions on Rung 45, which MOVs are triggered by the [XIC M228], which outputs a True rung state because [M228] is still 1. However the [SRT] instruction on Rung 46 will not execute and re-sort the array because [M228] does not have a rising edge on that next scan, so the values remain unsorted, because of Rung 45, for all scans after the first scan with the 0-to-1 transition of [M228].

The simplest solution would be to change the start of Rung 45 to also trigger only on the rising edge of [M228]; one way to do that might be to add an [XIO SortControl.EN] to the left side of Rung 45.

xxx.png

I see you already know this, because you asked "What have I done wrong?" but it bears repeating for those who will follow: in programming, the first rule is that it is not important what you want the PLC to do, because it will only do exactly what you tell it to do.

Also, welcome to the forum! There is no need to apologize for your english; it is far better than my русский язык.
 
Last edited:

Similar Topics

I am storing values into an array. I am wanting to find an average of the highs and an average of the lows. Something like this... After 50...
Replies
36
Views
8,773
I have a machine with a tag called SP_FLT[57] with a data type of DINT. Each bit in each DINT is a machine fault of some sort. I need a way to...
Replies
12
Views
3,446
Hi! Due to age and things are going obsolete, our team is going to upgrade the system where a Daifuku SRT-4231A is installed. But right now I...
Replies
0
Views
1,229
hi its my first time to this site finding it very helpfull and learning a lot. Can anyone explain the plcs storage, scanning, memory and its...
Replies
2
Views
1,675
I'm trying to pick the highest of 4 values using the SRT instruction. The attached ladder works but seems somewhat cludgy. The done bit toggles...
Replies
0
Views
6,429
Back
Top Bottom