DINT[32].Bit Step Logic

AutomatedOne

Member
Join Date
Apr 2016
Location
SW Michigan
Posts
8
Does anyone have experience with this type of logic? I am trying to get it to work but it does not increment my steps sequentially. It turns on steps in my logic based upon binary i.e. step three turns on steps 1 and 2. I will attach a sample of the logic.
 
Last edited:
If you want the value to represent the step, use EQU 1, EQU 2, EQU 3, etc.

For sequential bits, MOV 1 into the DINT for step 1. MUL the DINT by 2 to shift the ‘on’ bit up the DINT.
 
As mentioned, if you are trying to use the value, you need to use the math blocks such as Equal, Move, Add, Subtract, etc.

Personally, I find it much easier to use a bit for each step and then just add more DINTS if needed.
 
Not exactly sure what you mean, is it a bit shift in a dint or a dint value.
For a bit shift i.e. 32 steps 1,2,4,8,16,32,64,128 etc. then yes multiply by 2 but there is no easy way back makes it complicated, better to use individual bits, however, if you mean a value like 1,2,3,4,5,6,7 etc. you should not need a double as a 16 bit word will give you 32767 steps, this is a better way and suggest you step by increments of 10 so that leaves spare integers just in case you need to add extra steps.
simple to do for example:
Start = 10 do something move 20 to seq.
step 1 = 20 do something move 30 to seq.
step 2 = 30 if something move 40 to seq or if something else move 20 to seq. to check
step 3 = 40 do something move 0 to seq to stop process or move 10 to go back to start.

Use compare instruction to drive the logic
so if SEQWord = 10 do something
Also if certain logic depicts it to jump steps just move to the seq number you want, advantages are you can easily step back, add extra steps just use the numbers between the 10 increments. Another advantage of using an integer is that many HMI's have multistate functions where depending on a value in a variable they can display a message.
Example:
10 = Add Ingredient 1
20 = Add ingredient 2
30 = Mixing
40 = Discharging.
50 = Shutting down
 
As above, by far the easiest way. Easy to program, easy to change on the fly and easy to trouble shoot. Keep it simple.
 
Hi
For RSLogix 5000 you need to do this

Have a DINT for STEP (Step Number)
Have a DINT for your STEP_ BITS

Then use something like

CLR STEP_BITS to clear the current bit and then OTE STEP BIT.[STEP]

Using this method makes it hard to add a step in the future whereas Parkys idea is good because you can add steps in between without affecting any existing code so something to think about. Also you would need to consider what if the sequence was more than 32 steps etc
 
The way I read the question is how to reference a step number by bit. If that is the case it would be something like this:
DINT[(Bit AND(NOT 31))/32].[Bit AND 31]
 

Similar Topics

I am modifying an existing Omron CJ-2H CPU66EIP using CX-Programmer version 9.63. I simply need a rung of logic that can determine if a bit is...
Replies
20
Views
8,693
Hi guys, I have "Light_Status_DINT", which is a DINT logged every 5s. if i trend the DINT itself no issue, i got a nice graph of it. Now i want...
Replies
7
Views
2,353
Guys, I am new to PLC concept and I am trying to evaluate an existing program written in RSLogix5000 which has a faulting module up to 32 bit...
Replies
5
Views
2,101
Is there a way that you can add individual descriptions to each bit member of a DINT in a Studio5000 UDT? I use bits on a DINT for my individual...
Replies
3
Views
1,566
Hey all, I've reviewed many threads regarding converting one data type to another and I have something I'm working on that I'm stumped on and...
Replies
9
Views
5,924
Back
Top Bottom