adccommunitymod (AutomationDirect) asked a question.

DL05 and Cmore Micro- using input bits

Created Date: December 15,2009

Created By: Tubecut

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Hello, Is there any reason to NOT use HMI bits such as X123 and use X123 in the ladder. I can't see where it is really a problem. Just checking for comments or suggestions. These input elements are not available as hardware inputs and can be used as 'spare ' unused bits.


  • adccommunitymod (AutomationDirect)

    Created Date: December 15,2009

    Created by: milldrone

    I can't see where it is really a problem. Just checking for comments or suggestions.

    The only problem I have had was when I was reverse engineering a PLC because we had no documentation This was a DL240 and I did not check the I/O configuration first.

    The available range in a DL05 is X0 to X377. My personal preference, (your preference would no doubt be different) would be to not use x100 to X117 because that would be a "natural fit " for the DL05, but X120 and up would be fair game.

    On a side note, one time in a DL06 I needed all 1024 "C " bits for a large shift register. The catch was I also need some "internal bits " also. I used "GY " bits for those.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: December 16,2009

    Created by: Tubecut

    Thanks milldrone. think this started for me when testing a quick rung to test something and I then use something like a X100 to enable it. Doesn't do anything unless I use the online tools to enable it and is easy to locate later.

    So, to day I quickly added a test PB on the HMI screen and the associated discrete in the ladder.

    A 1K shift register, that's a heck of a shift register:cool:.

    I doubt I would let the final version contain ladder that used the bits as I mentioned. But it is comforting to know the additional capacity is there if needed.

    Makes me think that perhaps there could be a memory setup to remap some of the unused to something like additional C work bits.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: December 16,2009

    Created by: bfitz

    On a side note, one time in a DL06 I needed all 1024 "C " bits for a large shift register. The catch was I also need some "internal bits " also. I used "GY " bits for those.

    Any reason you didn't use Vmem for the shift register? The 06 has instructions that would have helped with this. I don't have a manual handy and don't know them offhand, but I think they are there. I haven't done alot (read any) shift register work, so I might be missing something.

    Brian

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: December 16,2009

    Created by: milldrone

    Brian,

    What can I say, it was my second DL project. I needed to track 4 passes through a 120 " oven. with the possibility of up to 230 pieces on a pass.

    Are you suggesting a fifo?

  • adccommunitymod (AutomationDirect)

    Created Date: December 16,2009

    Created by: bfitz

    Vaughn,

    I didn't mean to sound too critical of your choice, I was just curious whether there was a technical reason you went that way. It just seemed to me that with a large, monolithic memory block requirement like that, it could be stored in Vmem to leave your Cbits available for the more mundane things in your program. Check out the table functions available for the 06. TSHFL (or TSHFR) would be the core of the Vmem style shift register. Combine this with bit-of-word instructions and the FILL command for reseting and you should be able to replicate the shift register functionality. You could even expand your shift register as the TSHFL instructions will work on up to 255 Vmem registers.

    I'm not sure if I am suggesting a fifo. What is the difference between a fifo and a shift register to you? All I see are bits moving around, I guess.

    Now, this isn't to say that I am not still learning. I don't have what I would call lots of PLC experience under my belt. I still make lots of mistakes that show up in testing; speaking of which, I should get you an updated copy of that filter code from a while back. That is a perfect example.

    Brian

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: December 16,2009

    Created by: milldrone

    I'm not sure if I am suggesting a fifo. What is the difference between a fifo and a shift register to you?

    Brian,

    A fifo to me implies shifting a group of words. Normally just 16 bits of info but not always. I have used a double word fifo (time and error code) to store faults.

    A shift register to me implies just one bit of info,(board or no board).

    I'm not above any learning experience. Let me describe what I needed, and maybe you can find a better way to do it.

    We have an oven for curing paint (primer) on boards. The boards travel transversely through the oven. We are applying two coats of primer, so they go into the oven turn around at the end and come back out. then we apply a second coat and it goes back into the oven, and back out.

    I needed to know if the boards are traveling or not, there are several places where the boards can snag if they are not placed on the conveyor correctly. Why don't we place the boards correctly? Well just like every thing else on this project, specifications changed, in this case metric lengths are involved, and the conveyor spacing is STD.

    There are proxes on the end sprockets in the oven and some photo eyes at some locations, but not all the locations I need them to be. 50 photo eyes would just about cover it! The proxes are the clock pulse for the shift registers. As the register shifts I match up the "photo eye board presence " with the set bits. If I get a big misalignment of "board present " and set bits I sound an alarm. If I get a small misalignment and the boards are moving (change of photo eye state) no alarm. If I get a large misalignment and do not see the "board presence photo eyes " change state, I stop the conveyor(s) and sound the alarm.

    Note: there are actually twice the number of conveyors as my drawing shows but the number of photo eyes (green box with arrow pointing down) doesn't change.

    This worked so well that management respecified the requirements again.

    Previously the production line stopped if the downstream paint coater had a problem. The upstream coater might have stopped earlier and left a gap that was void of product. Now with this shift register and combination of board presence photo eyes I allow the upstream coater to fill in the gaps on the conveyors. The shift register in this case acts as a "virtual board presence photo eye ".

    So you were suggesting a Vmem solution, please tell me! BTW no offense taken by your suggestion. Perhaps I can tweak some more power from your solution to fulfill management's next respecification!

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: December 17,2009

    Created by: bfitz

    Vaughn,

    See if this resembles what you were describing. I have not tested this code in any way, so no warranties :)

    You would only need the first 3 lines for the heart of the shift register. Note that the shift register length can be extended up to 255 registers (4080 bits!) by changing the K40 in the first two rungs to the number of desired registers in hex. If you need more than that let me know, I think we could stack multiple shift registers together.

    The rest of the code represents one possible way to do the matching. I don't know exactly what code you have for matching predicted board presence to actual + tolerance, but it should be able to plug right in. Just use Bxxxx.x compares instead of Cbit compares.

    If something isn't lining up, or seems wrong, please let me know and I can try to correct it.

    Brian

    PLC 06

    // Rung 1

    // Address 0

    #BEGIN COMMENT

    "This rung will manually clear the shift register when C0 is set, then reset C0. The register "

    "will be 64 consecutive Vmems starting with V2000. "

    #END

    STR C0

    LD K40

    LDA O2000

    FILL K0

    RST C0

    // Rung 2

    // Address 6

    #BEGIN COMMENT

    "This rung will use the sprocket prox to advance the shift register. V400 holds the number "

    "of bits to shift. The TSHFL instruction needs to have a Vmem argument. "

    #END

    STRPD X0

    LD K1

    OUT V400

    LD K40

    LDA O2000

    TSHFL V400

    // Rung 3

    // Address 13

    #BEGIN COMMENT

    "This rung will feed in the board presence signal at the start of the conveyor. "

    #END

    STR X1

    OUT B2000.0

    // Rung 4

    // Address 16

    #BEGIN COMMENT

    "This rung will increment a counter register for every X0 step that the photoeye state "

    "doesn't match the shift register board position. X2 is the photoeye input and shift register "

    "bit position is arbitrarily B2010.7 The error count is held in V500. This rung does have the "

    "possibility to roll over the error count; if this is a possibility, use more logic to deal with it. "

    #END

    STRPD X0

    STR X2

    ANDN B2010.7

    STRN X2

    AND B2010.7

    ORSTR

    ANDSTR

    INCB V500

    // Rung 5

    // Address 27

    #BEGIN COMMENT

    "This rung will reset the error count if the photoeye state matches the shift register board "

    "position. "

    #END

    STRPD X0

    STR X2

    AND B2010.7

    STRN X2

    ANDN B2010.7

    ORSTR

    ANDSTR

    LD K0

    OUT V500

    // Rung 6

    // Address 38

    #BEGIN COMMENT

    "This rung will sound an alarm if the photoeye is greater than 6 steps misaligned with the "

    "shift register data. "

    #END

    STR V500 K6

    OUT Y0

    // Rung 7

    // Address 41

    #BEGIN COMMENT

    "This rung will stop the conveyor if the photoeye is greater than 12 steps misaligned with "

    "the shift register data. Note that the error register is in hex. "

    #END

    STR V500 Kc

    OUT Y1

    // Rung 8

    // Address 44

    NOP

    #BEGIN ELEMENT_DOC

    "X0 ", " ", " ", "Sprocket prox "

    "X1 ", " ", " ", "Lead in photo-eye "

    "X2 ", " ", " ", "Board check PE 1 "

    "Y0 ", " ", " ", "Alarm Horn "

    "Y1 ", " ", " ", "Stop Conveyor "

    "C0 ", " ", " ", "Clear register "

    "V400 ", " ", " ", "# of bits to shift "

    "V500 ", " ", " ", "Board Check PE 1 Error count "

    #END

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: December 17,2009

    Created by: milldrone

    Brian,

    I'll try this out this afternoon. We are not in production today.

  • adccommunitymod (AutomationDirect)

    Created Date: December 15,2009

    Created by: Tubecut

    Hello,

    Is there any reason to NOT use HMI bits such as X123 and use X123 in the ladder. I can't see where it is really a problem. Just checking for comments or suggestions.

    These input elements are not available as hardware inputs and can be used as 'spare ' unused bits.