You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old August 10th, 2018, 12:11 PM   #1
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
Book Need help understanding this logic

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!
Attached Images
File Type: png logic.PNG (19.3 KB, 98 views)
File Type: png fault.PNG (9.1 KB, 64 views)
  Reply With Quote
Old August 10th, 2018, 12:14 PM   #2
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
I understand the N7:2 is = 4, my bad.
  Reply With Quote
Old August 10th, 2018, 12:19 PM   #3
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is online now
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,244
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.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old August 10th, 2018, 01:50 PM   #4
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
Book

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?
  Reply With Quote
Old August 10th, 2018, 02:46 PM   #5
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is online now
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,244
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.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old August 10th, 2018, 04:02 PM   #6
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
Book

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?
  Reply With Quote
Old August 10th, 2018, 04:35 PM   #7
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,306
Quote:
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?

Quote:
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.
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old August 10th, 2018, 04:43 PM   #8
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
Book

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.
  Reply With Quote
Old August 10th, 2018, 05:47 PM   #9
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,306
Quote:
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.

Quote:
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.
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old August 10th, 2018, 05:48 PM   #10
AustralIan
Member
United Kingdom

AustralIan is offline
 
Join Date: Jan 2013
Location: UK
Posts: 771
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.
  Reply With Quote
Old August 11th, 2018, 09:49 AM   #11
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,109
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);
  Reply With Quote
Old August 14th, 2018, 11:59 AM   #12
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
Thumbs up

Quote:
Originally Posted by AustralIan View Post
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!
  Reply With Quote
Old August 15th, 2018, 10:00 AM   #13
proof
Member
United States

proof is offline
 
Join Date: Jan 2014
Location: Illinois
Posts: 143
Quote:
Originally Posted by alive15 View Post

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.

Quote:
Originally Posted by alive15 View Post
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.

Quote:
Originally Posted by alive15 View Post
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
  Reply With Quote
Old August 17th, 2018, 11:38 AM   #14
alive15
Member
United States

alive15 is offline
 
Join Date: Oct 2015
Location: al
Posts: 219
Thumbs up

Thanks for the info proof, I appreciate your response!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Logic form inside the PLC bl4ckic3 LIVE PLC Questions And Answers 2 July 6th, 2015 10:38 AM
Understanding encoder logic karivelm LIVE PLC Questions And Answers 22 March 5th, 2010 10:08 PM
Understanding / Learning S5 Logic stupidav LIVE PLC Questions And Answers 2 May 9th, 2009 06:22 AM
PLCs\ladder logic in the high school? sdowns LIVE PLC Questions And Answers 25 April 23rd, 2008 09:32 AM
The 8 Results of 2 Digital Input Commands Lancie1 LIVE PLC Questions And Answers 30 June 14th, 2005 05:49 PM


All times are GMT -5. The time now is 10:16 PM.


.