Logic Question : Tracking Parts

Alan said...
"Terry I disagree. A HMI cannot change the state of an input.
The input is either off or on dependant on what is happening in the real world. You can use the HMI to decide whether to use the input value or to use another value but you can't change what the input state is. (This thread is based on a ML1200)..."


Alan...

I did not suggest that an HMI could change the state of an Input... I said it could be used to disable the input.

Now, having cleared that up, I will go on to say that, as far as the program is concerned, an HMI can certainly be used to change (reverse) the state of an input.

BTW, the following applies to ANY PLC!

INPUT CTRL-BIT
---| |------|/|----+----( ) Input Proxy
|
INPUT CTRL-BIT |
---|/|------| |----+


.
Input Proxy is used to represent the Input in the program.

The HMI controls the CTRL-BIT.

If CTRL-BIT is OFF then Input Proxy is controlled by the --| |-- Input.
Input ON = Proxy ON, and Input OFF = Proxy OFF

If CTRL-BIT is ON then Input Proxy is controlled by the --|/|-- Input.
Input OFF = Proxy ON, and Input ON = Proxy OFF

If the field device is Normally OPENED and you want a "Positive" Indication in your program then leave CTRL-BIT OFF.

If the field device is Normally CLOSED and you want a "Positive" Indication in your program then turn CTRL-BIT ON.

There ain't no rule that says you can only use actual Input Status in the program!

This can be a mighty handy tool for allowing for the possibility of having to replace a Normally OPENED device with a Normally CLOSED device(*), or vice-versa.

(*) Because it happens to be the only replacement available!

And because the Input is represented by the Proxy, there is no need to rework the code!

A "Sensor-Type" page on an HMI would allow Maintenance folks to change the "expected sensor-type" based on what they had to install... without having to go into the program.

Alan also said...

...As far as using the HMI to disable an input then that is also impossible short of faulting the processor. Even with an SLC all you can do with a HMI is disable a whole card not an individual input."


Disabling an Input is a piece-of-cake!

This also applies to ANY PLC!


INPUT CTRL-BIT
---| |------|/|---------( ) Input Proxy


.
In this case...
Again, Input Proxy is used to represent the Input in the program.
...If the HMI-controlled CTRL-BIT is OFF then the Input is Enabled.
...If the HMI-controlled CTRL-BIT is ON then the Input is Disabled.

If CTRL-BIT is ON, then, for all practical purposes the Input is disabled!

I have several instances of this in my main process... it has prevented a lot of late-night phone calls!

This PLC-stuff is nothing but playing logic games! All it takes is IMAGINATION!
(242)
 
knichols...

I am waiting still for a reasonable explanation of what you have and what you want to do...

It sounds sorta-kinda-like you want to be able to manipulate the value of a particular bit in the shift-register... is this so?

If so, you certainly can use bit-wise AND or OR to massage your current bit-value at place 34 or 40 or, "like"... wherever!

I can go into that further... but only if I am sure that's what you need (not neccessarily because that's what you want... get my drift?).

Your assumption-level is still way too high!

If you come across with what we need to help you... you WILL get a solution!

If not... then we will lose interest in your problem... that's the way it is.

YOU are the speaker! It is YOUR responsibility to get the information across the divide. It is NOT our responsibility to try to figure out what the heck you are talking about!

HEY, RON!
Did you take that class in Technical Writing?
 
Hi Terry.
We are probably dealing in semantics here.
My quote
"You can use the HMI to decide whether to use the input value or to use another value but you can't change what the input state is."

The method you describe to disable or reverse the input is manipulating the code but is not altering the state of the input or disabling it.
The input if it is on in the data table then it is still on in the data table no matter what we do with control bits. The program though will see the input as not used or reversed.

I stand by what i say that you cant change the state of an input with a HMI but i agree that you can manipulate the logic around the state with a HMI to do what you want it to.
At the end of the day it is probably all doesnt matter as long as the code does what you want it to.

Regards Alan Case
 
Hey guys, got it figured out. Thanks rube, changing the unload bit is exactly what i needed to do, once i figured out exactly what that meant. I'll try to breakdown what im doing, even though i'm a moron, and see if you agree that its valid.

-Input an integer using the HMI
-Change the Length in the Control word for the BSR
-This, in turn changes the length between the tester and the printer

This seems to work in the simulated version i have, all i have to do is figure out why the N7:0 is not retaining the value the HMI is sending it. The number stays on the HMI for like 5 seconds, then reverts to 255. Hopefully that won't be too hard to figure out.
 
Well alright! Doesn't sound like you're a moron to me. Try doing a "find all" on that integer that goes back to 255. Or use a different integer if you need to. Good luck.
 
Let’s see if I understand you correctly. You have an conveyor and parts are rolling down the line and going through a test station. You are using a bit-shift to record the results of the test. Further down the line you are using a printer. If the part fails, you are placing a 1 in the bit-shift, so that when that part gets to the printer, the printer prints whatever.

Your question seems to be, how can I set-up the program so that the printer can be physically moved further up or down the line, and all the operator needs to do is use the HMI to say the printer is at this location?

You don’t need to change the length of the BSR, no point really, so what if the BSR is keeping track of X number of bits that you don’t need (within reason). Rube’s example will work good if you have a finite number of locations at which the printer can go, but if you have some 64 different locations at which the printer could go, it will make for a fairly large rung. You might want to take a look at a MASK instruction. So you might take all the bits in B3 and only pass the one bit at which the printer is located at through the MASK. Then you would use the HMI to change the MASK depending on where the printer is located.
 
I like knichols solution. I think it's kind of clever. I certainly didn't think of it.

knichols is using the definition of the unload bit to his advantage. The unlod bit reflects the state of the bit at the "length" bit location. By changing his length field he can effectively define which shift register bit location drives the unload bit. So the code simply uses the unload bit no matter what the length is.

I thinks thats pretty elegant. Nice one knichols!!

Keith
 
Thanks kamenges, tarks idea sounds pretty cool, but now i got to figure out how to use mask instructions. My ultimate goal here is to learn anyway.

As far as the rung being really huge, I think he was referring to the earlier post with the EQU instructions. I agree that would be overkill.
 
How about using indirect addressing on the bit you want to use to trigger the printer.
Use N7:0 as the bit number from the HMI and then set up a rung like this:

B3/[N7:1] Printer Trigger
---| |-----------------( )

Need to use a limit test on N7:0 to make sure that the operator does not enter a number past the file length. Then move N7:0 to N7:1.
 
Something like this should work -

maskexample8bu.jpg


An AND instruction is what you want to use. So N7:1 contains the value entered in the HMI that corresponds to the location of the printer. As an example, let’s say the printer is located at the 3rd location, the 4th bit in the BSR. You would enter a HEX value of 0008 in N7:1. When the 4th bit in the BSR is on, N7:1 will be greater than 0, and turn on the printer output. When the 4th bit in the BSR is off, N7:1 will be 0, and the printer output will be off. By changing the value of N7:1 you change which bit in the BSR is used to turn on the printer output.

Example
B3:0 0000000000000100
N7:1 0000000000001000
N7:0 = 0, Print output is off

B3:0 0000000000001000
N7:1 0000000000001000
N7:0 > 0, Print output is on

So this will work as is if your BSR has a length of 16. If you have more than 16 bits in your BSR then you will need more than one AND instruction, you will need an AND instruction for each multiple of 16. If you have a BSR with a length of 32, and the printer could be located at any of those bit locations then you would use (2) AND instructions, one would have a Source A of B3:0 and the other would have a Source A of B3:1, plus you would need to enable the AND instruction which is examining the Source which contains the bit you want. For instance, you have a BSR of 32 and the bit the printer is at is 22. You need to turn off the AND instruction which is examining B3:0 and enable the AND instruction which is examining B3:1. Getting the right AND to turn on and the correct value for N7:1 from the HMI is the tricky part. I’m sure others who have worked with AB more than me can give you a creative way of doing this.

Although I’ve just finished all this and noticed bwheat’s post. I didn’t know you could do indirect addressing like that, and it looks a lot cleaner than what I came up with.
 
Originally posted by Tark:

Although I’ve just finished all this and noticed bwheat’s post. I didn’t know you could do indirect addressing like that, and it looks a lot cleaner than what I came up with.

I don't know that you can. When I tried to enter the indirect address values in a test project Logix 500 wouldn't let me use that format, even though I had bit address display selected. It always forced the word/bit format with indirect addresses while allowing me to enter bit only addresses without indirection on the same rung. knichols could still use indirection but the bit location would have to be split into word/bit format, which isn't too hard to do.

I know you can enter bit file indirections like bwheat shows in a PLC5, though. I've done that successfully before.

Keith
 

Similar Topics

Good morning crew! Ok my logic works but I am missing something. When the start button is pushed it should like the red light for 4sec then shut...
Replies
13
Views
409
Hey. I am new to PLCs and LogixPro. A friend and I have been trying to build this diagram and instructions using LogixPro500. Could anyone help us...
Replies
15
Views
1,260
A question was proposed to me at work after a programmer complained about '=' being both a comparative operator and also an assignment operator...
Replies
16
Views
3,877
We've got a sump pump which is switched on/off at the HMI by clicking a button on the screen then a physical pushbutton on a console, using this...
Replies
50
Views
12,161
The attached files shows a rung modified by the Migration Tool. Can anyone explain the purpose of the added parallel branch? I figure it has to do...
Replies
3
Views
1,752
Back
Top Bottom