RSLogix 5000 mixing literals and tags

Maximuse

Member
Join Date
Apr 2013
Location
Ontario
Posts
51
Hello everyone,
I've done a lot of searching on this and haven't found an answer yet. As the thread title implies is there any way to mix these elements within an instruction?
I know it can be done within array square brackets but I haven't been able to employ the same methodology elsewhere.
Specifically I was trying to make a Limit instruction to do this:

--------LIM-----------
|
| Lo Lim: (Apple - 5)
|
| Test: Orange
|
| Hi Lim: (Apple + 5)
|
-----------------------

Thanks!
 
Hi,
Unfortunately this is not possible as far as I'm aware, however you could just add a rung previous to this and use a SUB instruction (Apple - 5) and move the answer into another tag (Banana) and an ADD instruction (Apple + 5) move that into another tag (Pear) then on your Limit test:

--------LIM-----------
|
| Lo Lim: (Banana)
|
| Test: Orange
|
| Hi Lim: (Pear)
|
-----------------------

Which is how I would go about it....
 
Welcome to the forum.

Use two CMP instructions instead of the LIM instruction. CMP will support computation expressions.

CMP Orange>=(Apple-5) CMP Orange<=(Apple+5) OTE Banana


Edit:
Better yet, change the expression so you can use a single CMP
CMP ABS(Apple-Orange)<=5
 
Last edited:
TConnolly, your first example is actually what I've started doing it was at least a way to get everything on one rung. However, I love your suggestion of using the ABS inside of the compute, great idea +1 to you good sir.
 

Similar Topics

Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
2
Views
140
I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
568
First off, I'm a hobbyist-level programmer, and this program isn't controlling anything anything that could even remotely be considered "life...
Replies
18
Views
511
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
118
Back
Top Bottom