rslogix5000 compare values and use

dbradford

Member
Join Date
Sep 2010
Location
Houston
Posts
8
I am using rslogix5000 and a controllogix L73 Processor. I need to compare 4 analog position inputs and use the highest or lowest input value to move into a set point to start the next move command. So if position 3 input is the highest out of 1,2,3 and 4 I want to move position 3 into my set point for the next cycle. Does anyone know of an easy way of doing this instead of making a lot of GRT or LES to compare all of the positions to pick the on I want? Thank you
 
Last edited:
Welcome to the forum.

Copy to an array. Sort the array. Then take the lowest and highest from each end of the array.

attachment.php



However, a sort requires the processor to make a lot of comparisons and move a lot of information around, it probably takes longer to execute than just using three LES and three GRT compares.

attachment.php


tc0906131.png tc0906132.jpg
 
Last edited:
TConnolly, I tried the SRT instruction and not sure why it is not sorting in the Ascending order like the instruction is suppose to. Any ideas on what I did wrong? here is a pic of what I have.

SRT.jpg
 
I *think* the SRT puts the Highest Value in SortArray[0] and then lower values from there.

After sorting, look at your SortArray[] and I bet you will find they are highest to lowest.

If that is in fact the case, then just move SortArray[0] into position HIGH and SortArray[3] into the LOW position.
 
Thank both of you for your help. After playing with it I had to turn off the Sort_Pos to hold the positions in the Array. Then I had to execute the SRT command and it then sorted the positions that were moved into the Array.

SRT Working.jpg
 

Similar Topics

how to use compare between two programs at rslogix5000
Replies
4
Views
1,652
Hi All, I have to install a newproject in RSLogix5000. How to compare the projects.Pls advice.Thanking in anticipation
Replies
3
Views
3,802
Hi! So my problem is a little funky, I had Studio 5000 v 24 and 30 installed, but forgot to install RSLogix (which I cannot go without). Is there...
Replies
2
Views
118
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
427
Hello everyone, I have an RSLogix5000 project which is running live in the factory but I need to make some changes to the logic. I want to test...
Replies
0
Views
1,121
Back
Top Bottom