News:

  • September 22, 2026, 05:50:35 AM

Login with username, password and session length

Author Topic: Program Help  (Read 39689 times)

Dock

  • Jr. Member
  • **
  • Posts: 11
Program Help
« on: June 25, 2013, 03:43:53 PM »
Hi all, asking for a little help here.

I have been using the AD processors for some time now but am new to the DO MORE and some of the more complex programming functions.

Anyways I have experience with mostly discrete, and straight forward programs.  I have a project now that is challenging me and I am looking for a little help from the Brain Trust.

I will try and describe the best I can to see if any of you have any ideas.

I have an application with a small recycling line and am having a little trouble with a bin queue.

DOO:
Operator picks a bin off of an incoming stack and places it on a load conveyor section.  The operator then assigns a destination via an HMI (1,2,or 3 based on bin contents), after the destination assignment the bin advances one zone into a queue (there are four zones in the queue).  When the queue reaches the last zone the bin is then sent down the line to be transferred off the main line via a right angle transfer.  After the bin has been transferred the next bin in the queue is then sent down the line, transferring off the main line based on the destination assigned by the operator.

What I'm struggling with is trying to find a way for the PLC to execute the destination assignments in order. Example bin 1 goes to dest 2, send to queue. bin 2 goes to dest 3, send to queue. bin 3 goes to dest 1, send to queue. Bin 4 goes to dest 2, send to queue.  Bin 1 has now landed at the last zone in the queue and now needs to be sent down the line to be transferred but it needs to know where to go and so does the one behind it and so on....

Clear as mud?

Any help on this would be much appreciated!

By the way HOST the new stage programming is really NICE!

Thanks,

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Program Help
« Reply #1 on: June 25, 2013, 04:50:57 PM »
Are you using barcodes on the bins with strategically placed barcode readers to know what bin is where?
OR just simple prox switches and so the PLC must "maintain" the position logically (what happens if someone manually removes a bin, or moves a bin? that could create confusion in the logic)?
OR combination of both
OR no feedback at all, because the system is mechanically simple and you can safely assume that all steps are executed properly
OR ? ? ?

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Program Help
« Reply #2 on: June 25, 2013, 07:39:34 PM »
There are lots of ways to do it, but, one way that may get you started:

Create a user unsigned byte block called "BIN" with a length of at least the maximum number of bins that could be on the conveyors at once (my understanding of your post suggests 4).

Whenever the operator places a bin on the line and presses the destination button, then load the destination number into BIN[0].

When that bin reaches the queue then perform a MOVER (MOVE Range), Source: BIN0, Destination: BIN1, Length: 3.

Now you can examine the contents of BIN3 and whatever number is in it tells you where to send the bin coming out of the queue.

Clearer? or muddier? ;D

Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #3 on: June 26, 2013, 07:05:18 PM »
Are you using barcodes on the bins with strategically placed barcode readers to know what bin is where?
OR just simple prox switches and so the PLC must "maintain" the position logically (what happens if someone manually removes a bin, or moves a bin? that could create confusion in the logic)?
OR combination of both
OR no feedback at all, because the system is mechanically simple and you can safely assume that all steps are executed properly
OR ? ? ?

No barcodes, the bins are used throughout the facility for other tasks and processes, that would be to easy!

The PLC must maintain its state throughout the sequences.  They are aware of the issues if they had to remove a bin and start over.  The line is not that big and mechanically simple, the probability of jams is low.  So, yes it is an issue however one that I don't believe will be much of a problem, famous last words right?

The bin will be transferred when it reaches its destination (assigned by the operator at the HMI) so the PLC must maintain this memory until it arrives at its assigned destination, triggered by a Photoeye, then transferred.  There is feedback after the transfer to make sure the product has arrived at its destination, which would signal the next one in queue to go down the line, again with a memory destination.

This is all because of timing, the operator can send bins and they can travel faster than the workers can process them.  The reason for the queue is to allow the loading operator to load several bins at once without having to wait for whats happening downstream and be completing other related tasks as well...  Also the fact that we have no other intelligent means of identifying where it needs to go (barcode).

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #4 on: June 26, 2013, 07:15:55 PM »
There are lots of ways to do it, but, one way that may get you started:

Create a user unsigned byte block called "BIN" with a length of at least the maximum number of bins that could be on the conveyors at once (my understanding of your post suggests 4).

Whenever the operator places a bin on the line and presses the destination button, then load the destination number into BIN[0].

When that bin reaches the queue then perform a MOVER (MOVE Range), Source: BIN0, Destination: BIN1, Length: 3.

Now you can examine the contents of BIN3 and whatever number is in it tells you where to send the bin coming out of the queue.

Clearer? or muddier? ;D



Slightly clearer but still muddy, I think I could figure out the move instructions but im lost with the "Byte Block", care to elaborate on that? Again, I have never had to do much with the advanced programming and have no one here to really turn to for advice.. 

See if im on the right track with this but Im probably moving backwards!

Create a memory block with a least 4 destinations....
Input the memory block with a numeric via the hmi...
MOVE the numeric to a specific destination
Examine the numeric
Execute the task based on the numeric...

Not sure if im on track or not, probably way off.  How would the memory block create a stack or execute them in the order they were input?

I was not at my desk today to try and play with what you suggested but will be there to give it a try tomorrow.

Thanks Fellas,

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #5 on: June 27, 2013, 05:21:48 PM »
Ok so I didn't get much time on this today but I believe I figured out how to create the byte block.  More tomorrow.

CReese

  • Hero Member
  • *****
  • Posts: 184
Re: Program Help
« Reply #6 on: June 27, 2013, 05:53:42 PM »
I think a picture here would help a lot, regarding data transfer. Picture the block of memory like the line. Create a block four elements long, assuming you have four stations.

   B0     B1     B2     B3
--------------------------
|       |       |       |       |
|       |       |       |       |
|       |       |       |       |
--------------------------

Each memory address corresponds to a station. The value in the memory location is the ultimate destination of the bin. So, first bin is queued in the first station with a destination of, say, 3. Load the destination into B0:

   B0     B1     B2     B3
--------------------------
|       |       |       |       |
|  3   |       |       |       |
|       |       |       |       |
--------------------------

Next bin approaches. Operator sez it goes to two. MOVER B0 to B1 length 3. Then set B0 to the destination, 2:

   B0     B1     B2     B3
--------------------------
|       |       |       |       |
|  2   |  3    |       |       |
|       |       |       |       |
--------------------------

Eventually you get a full stack, and the sequence will be:

Send bin to main line with destination B3 (station destination address in memory location B3)
MOVER B0 --> B1
Set B0 = selected destination.

To account for startup, you might initialize the memory block with zeroes. Then:

B[0-4]=0
While not error condition:
    If B3 > 0 && B3 < 4:
        Send bin to B3 destination
    Elif B3 = 0:
        No bin in position
    Else:
        Invalid destination error

MOVER B0 --> B1

If operator select:
    B0 = selection
Else:
    B0 = 0
End While

I'll leave translating the above pseudocode into efficient ladder logic to the experts.

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #7 on: June 28, 2013, 10:32:49 AM »
CReese,

Thanks for the illustration, that helps.  I think I have an understanding of how the user assigned destinations are inputted into memory, and I believe I have created the memory block correctly.  Now I just need to figure out how to apply this data to the memory block  via the HMI.  From what I have read I need to use a read or write instruction to apply the data to the memory block.  I have seen several read/write instructions available and need to try and figure out which one to use. 

So far I believe I need the MRX instruction to read the user inputted data via Ethernet. I have created a new device called "HMI" to communicate with the instruction via MODBUS/TCP.  I set the IP address in the instruction as the IP address of the controller.  This is as far as I have gotten, am I on the right track? :-\

If I am now I need to figure out how to associate the memory block I created with the instruction?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Program Help
« Reply #8 on: June 28, 2013, 10:45:12 AM »
Typically, the HMI is the "Master" and the Do-more is the "slave", hence no need for the Do-more to use MRX which is a Modbus Master instruction.  Do-more as a slave is a passive operation, so there are no instructions to make the HMI work.  

Are you using C-more?  If so, it has a Do-more driver (no need to use Modbus).  If not, whatever HMI you have, if it has Modbus driver, that will work just fine.

However, user created data blocks are not accessible via C-more, so you will still have to move the data from V or N (built-in blocks) into your B data block.  The MOVER or SUBSCRIB can do that.  If Modbus, your HMI will be writing to MHR data-block.  Again, use MOVER or SUBSCRIB to move data from MHR data block into your B data block.  If you need to READ Do-more values from your HMI, use MOVER or PUBLISH to write to M* data-blocks (MI, MC, MIR, MHR: Modbus (Discrete) Input, Modbus Coil, Modbus Input Register, Modbus Holding Register).

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #9 on: June 28, 2013, 10:55:06 AM »
Thanks for the Reply! This keeps me from going down the wrong road!

Yes I am using a cmore panel, I will play with your advice and let you know what I come up with.

Thanks,

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Program Help
« Reply #10 on: June 28, 2013, 12:08:32 PM »
Try this:
In the Cmore create a push-button referencing C0 for example, set it up as a Set-bit.
Then in the DoMore have a rung with STR C0, RST C0, MOVE, Source: 1, Destination: BIN0.

Now copy this process for the other three destinations, ie: C1 MOVE 2, C2 MOVE 3, C3 MOVE 4.

...I'll try to make it easy... see the attached screenshots:
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #11 on: July 01, 2013, 12:39:47 PM »
So I think I have the move and mover under control.  Now the question is how do I examine the contents of the byte block and apply that with the ladder logic to trigger a stage?  Is there a way to map the contents of the block to C bits for program control?  This project is making me go bald with all the head scratching, but im learning!

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Program Help
« Reply #12 on: July 01, 2013, 12:52:10 PM »
See the attached screenshot.
It will set C10 for divert to 1, C11 for divert to 2 etc.
If the number is out of range it will set C20
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Program Help
« Reply #13 on: July 01, 2013, 01:00:02 PM »
Added a contact to the rung:
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

Dock

  • Jr. Member
  • **
  • Posts: 11
Re: Program Help
« Reply #14 on: July 01, 2013, 02:27:35 PM »
Thank you! This worked well.  Now I just have to figure out how this will work if say two or more of the SAME destination assignments are made in a row...