Need help understanding this logic

alive15

Member
Join Date
Oct 2015
Location
Montgomery, AL
Posts
690
Good afternoon,

I want to understand this old piece of logic I found in an old program (RS Logix 500 on SLC 5/03).

I have two rungs here in a program, one output signifies a major fault in a program, while the 2nd output represents a minor fault.

The source in both MVM is the same. When I toggle output N7:2 (which I want to incite a major fault with), it changes the source from 0 to 4. I don't understand how that happens and need explanation for this. See the 'fault' image for details.

Also, after the 0 becomes a 4, my destination for both MVMs remains 0 (but I am doing this offline, unsure if I need to go online). I want to assume the masks are in Ascii, which would make sense that the destination stays 0 for both.

At the end of the day, I need my 'crankpin generator fault' to incite a major fault which will abort the cycle. Apparently, it has not been doing this for years according to the setups / techs on the line.

Thanks and have a great day!

logic.PNG fault.PNG
 
Launch your windows calculator. Choose the 'programmer' mode and hex entry.


Enter the mask for the minor fault MVM. Note which bits are 1 in the binary representatio0n. Do the same for the mask for the major fault.


You will have to change either the mask or the bit which is set in the fault detection rung.
 
I plan on just moving the fault as an input for my major fault output.

What's the purpose of setting up the logic like this using MVM and masks just to create faults? Was this more common when SLC 5/03 where first coming out? For me, it's easier to place all my fault inputs parallel to each other, so any one of them will turn my major fault output on. I could never imagine setting up the logic this way, using MVM and the "AND" logic. Why would anyone do it this way?
 
Another way would have been to use one N register for minor faults and another for major faults. Then just test each for non-zero to trigger each overall condition.
 
Right, that method would work as well. But I want to know what the original programmer was thinking when he/she created the logic using mask. Has anyone seen this before? Where would something like this be used in the manufacturing world today? I've seen old frequency drives display the parameters in binary bits similar to the "destination" slot on the MVM, so would it be possible to change multiple parameters on a frequency drive using just one MVM instruction?
 
I want to know what the original programmer was thinking when he/she created the logic using mask.
Hard to say what He or She was thinking. It could be to save on memory. Is this a large program?

At the end of the day, I need my 'crankpin generator fault' to incite a major fault which will abort the cycle. Apparently, it has not been doing this for years according to the setups / techs on the line.

To do this change the mask on the minor fault to 138h and change the major mask to 7CCCh. This will make bit 2 in the N7:0 file evaluate true in the major MVM.
 
No, only 9% of the controller memory is being used at the moment.

I won't mess around with these masks, since there are other faults also tied in together. I'm sure if I copy the Crank pin generator fault tag and paste as an XIC input parallel to the GRT, I can accomplish the same thing. This way, none of the other faults will mess up if I change the masks.

I'm super-puzzled by masks however and trying to figure out how or where I would use this if I were to ever create a future program. It would be a great resource if I understood when to use it, but I just can't figure it out with the program I am working on at the moment.
 
No, only 9% of the controller memory is being used at the moment.
I was referring to the SLC 5/03 memory. Compared to today's controllers they didn't have much memory at all.

I'm super-puzzled by masks however and trying to figure out how or where I would use this if I were to ever create a future program. It would be a great resource if I understood when to use it, but I just can't figure it out with the program I am working on at the moment.

I don't use Masks much but they are not that hard to understand. Your minor fault mask was 136hex. That translates into 0000 0001 0011 1000 in binary. So if you have a bit pattern in N7:0 that looks like this:
N7:0 - 1111 1110 0000 1000
Mask - 0000 0001 0011 1000 = 136h
----------------------------------
Result -0000 0000 0000 1000 =8h or 8 Dec.

For your Major Fault:

N7:0 - 1111 1110 0000 1111
Mask - 0111 1100 1100 1100 = 7CC8h
----------------------------------
Result- 0111 1100 0000 1100 =7C0CH or 31,756 Dec.


Basically if the mask has a 1 in it then what ever is in that bit position transfers through to the result. If the mask has a 0 then it wont transfer to the result no matter what is in that bit position.

Hope this helps you understand.
 
So you have a bunch of faults jumbled into one word.
Now someone decides that some of those are major and some are minor.
"Hey Steve, I need bits 1,2,5,8 and 9 to generate minor faults and I need bits 3,6,7,10,11,12,13 and 14 to generate major faults," says some random person.
Steve is a programmers programmer. He looks at 0316h and thinks "oh, that's a word with bits 1,2,5,8 and 9 on!" He looks at 7CC8h, scratches his head a bit and does some weird thing with his fingers like he is counting but not very well, then thinks "yup, that is a word with bits 3,6,7,10 on, and also bits 11,12,13 and 14."
It took him a little bit longer because the C is a weird one and he had to go back to first principles to remember that C is like 1100 in binary.

Because Steve has never worked night shift, or even stayed late one time to see what night shift maintenance people are like, he decided to use an MVM to move only the bits from the source that are equal to his mask into a new register, and see if any of the bits are on. How does he do this, well he knows that any number that DOESN'T have bit 15 set, but does have ATLEAST one other bit set is greater than 0. "Why didn't he use a NEQ instruction, that way the code would have worked even if bit 15 was now included in the mask?" Well, you may as well ask a man why he drove a Ford rather than a GM to the sports game. They both got him there in the end.

If only he knew! Wow. I, and many others, would much rather see:
N7/1. B3/7
Xic. Ote
N7/2
Xic
N7/5
Xic
N7/8
Xic
N7/9
Xic

You would even get to see all the descriptions!

Anyway, I hope this in someway helps you understand Stevie's mind.
 
you can do some interesting stuff w/ masks. Especially when combined w/ an XOR.

How I do my inputs:

(*Bridge Photo Eye 1*)
PE1_Input_Deb (raw_input := %I0.1.7.0,
turn_on_pre := 200,
turn_off_pre := 50,
hmi_force := ForceI[7],
deb_output1 => PE1_clear_deb,
deb_output2 => %MW0.7);
 
So you have a bunch of faults jumbled into one word.
Now someone decides that some of those are major and some are minor.
"Hey Steve, I need bits 1,2,5,8 and 9 to generate minor faults and I need bits 3,6,7,10,11,12,13 and 14 to generate major faults," says some random person.
Steve is a programmers programmer. He looks at 0316h and thinks "oh, that's a word with bits 1,2,5,8 and 9 on!" He looks at 7CC8h, scratches his head a bit and does some weird thing with his fingers like he is counting but not very well, then thinks "yup, that is a word with bits 3,6,7,10 on, and also bits 11,12,13 and 14."
It took him a little bit longer because the C is a weird one and he had to go back to first principles to remember that C is like 1100 in binary.

Because Steve has never worked night shift, or even stayed late one time to see what night shift maintenance people are like, he decided to use an MVM to move only the bits from the source that are equal to his mask into a new register, and see if any of the bits are on. How does he do this, well he knows that any number that DOESN'T have bit 15 set, but does have ATLEAST one other bit set is greater than 0. "Why didn't he use a NEQ instruction, that way the code would have worked even if bit 15 was now included in the mask?" Well, you may as well ask a man why he drove a Ford rather than a GM to the sports game. They both got him there in the end.

If only he knew! Wow. I, and many others, would much rather see:
N7/1. B3/7
Xic. Ote
N7/2
Xic
N7/5
Xic
N7/8
Xic
N7/9
Xic

You would even get to see all the descriptions!

Anyway, I hope this in someway helps you understand Stevie's mind.

Thanks man, this is what I was looking for.

Thank you everyone for your replies!
 
The source in both MVM is the same. When I toggle output N7:2 (which I want to incite a major fault with), it changes the source from 0 to 4. I don't understand how that happens and need explanation for this. See the 'fault' image for details.

You can't toggle, N7:2, as it is a DINT. You probably meant N7:0.2. Toggling N7:0.2 changes N7:0 from 0 to 4.

Also, after the 0 becomes a 4, my destination for both MVMs remains 0 (but I am doing this offline, unsure if I need to go online). I want to assume the masks are in Ascii, which would make sense that the destination stays 0 for both.

The masks are in Hexadecimal.

At the end of the day, I need my 'crankpin generator fault' to incite a major fault which will abort the cycle. Apparently, it has not been doing this for years according to the setups / techs on the line.

The mask for the Minors is
0316H = 0000 0011 0001 0110
The mask for the Majors is
7CC8H - 0111 1100 1100 1000
The minors mask acts on bit 2, the Majors does not. If you want a major fault, but not a minor fault from N7:0.2 change the minor mask to 0312H and the major to 7CCCH
 

Similar Topics

https://imgur.com/a/kKPtzyP We are making improvements to these motor controls by replacing these old resistor banks and DC generator with DC...
Replies
3
Views
1,753
I get so confused by Rockwell's licensing structure. I have two PC's that will be running the same SE application. Can/should I run this as...
Replies
7
Views
1,718
Good Afternoon , I'm sorry. But I'm struggling to understand this combination of integers in this MOV , and really anywhere else this scheme...
Replies
6
Views
1,554
Hi folks, I am wondering if you guys can help me understand what the intended operation was for some logic that relates to the operation of the...
Replies
3
Views
1,610
Hello guys, PLC 5 guy here who recently took a course through automationtraining.ca for some basic understanding on how to navigate through...
Replies
4
Views
2,311
Back
Top Bottom