Integer change detection

tidwellc87

Member
Join Date
May 2018
Location
Dallas
Posts
9
Newb here learning on Unity Pro XL.

I'm working on a Modicon M580 program (in function block) and I'm trying to ensure that an integer variable is unique (for equipment priority when in auto mode). I have a set of four integers '0-3'. They can be set by operator request at the HMI, and also by some other logic that automatically increases the variable when the associated equipment goes from a running status to off so that the priority is continually rotated.

I'm trying to come up with some logic to ensure that each of these four variables are always unique. I don't ever want any of them to be equal. Any ideas on how this might be accomplished?
 
It should be noted that, strictly speaking, you could have a combination of 3-3-0-0, 3-1-1-1, 2-2-2-0, or 2-2-1-1; however, if the process doesn't really allow for this, then adding them will work.

Otherwise, you're looking at a set of Not-Equals blocks. I don't do Modicon, but an FBD may look something like this:

2018-05-07_15-35-48.jpg
 
I dealt with priority logic before and I think you are approaching this from the wrong side of the problem.

Instead of doing check to see if the priority is unique, set them properly so there would be no need to check. The logic used need to have a way to take exclusive control of the priority setting so only the "some other logic" or the operator can set them.
 

Similar Topics

I was wondering if anyone has any ideas on how to detect change in an integer in a SLC 5/04. We have a machine that runs 3 different parts. Each...
Replies
21
Views
7,447
Hey again guys, Having all kinds of issues this week. Is there a way to detect when an integer value changes? I need to set a BOOL every time...
Replies
8
Views
8,071
Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
321
Good morning all, I'm integerating a device with a Rockwell PLC with V34 Studio 5000. The device reports error codes using a single integer to...
Replies
19
Views
1,212
Ex If I Read from Integer file N7:0 N7:0 is an 8 point input card , input 0 and 2 are on , rest off When I look at : N7:0 -7 6 5 4 3 2 1 0 I...
Replies
5
Views
691
Back
Top Bottom