adccommunitymod (AutomationDirect) asked a question.

SR bits not operating output w/out additional relay

Created Date: November 19,2006

Created By: CLW@CrownCork

**** 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 everyone, My first post here. I was writing small programs to help train a new employee. The objective was to see how many ways we could toggle a single output, with a single input. In the following example, I used a shift register to shift a bit through the word, and had it do different pulses when on each time. No problem. The weird thing is that the output would not respond (energize) if I only used the particular register bit that was on at the time (C10, C12, C14, C16) in the line of code for the Y0 output. I had to use another relay(C2) as the "on " bit for the output Y0. Does anyone know why this is? I felt a bit silly when I was trying to show him something, and it didn't work at first. I told him I didn't quite understand why it didn't work without the additional relay, and would give it more thought. Well, I did, and I still don't know. Anyone see the obvious thing I must be overlooking to help descramble my brain? PLC 05 // Rung 1 // Address 0 STRN X0 ANDN C2 ANDN C10 ANDN C11 ANDN C12 ANDN C13 ANDN C14 ANDN C15 ANDN C16 SET C0 // Rung 2 // Address 10 STR C1 RST C0 // Rung 3 // Address 12 STR X0 OUT C1 // Rung 4 // Address 14 STR C0 STR C1 STR C17 SR C10 C17 // Rung 5 // Address 19 STR C10 OR C12 OR C14 OR C16 OUT C2 // Rung 6 // Address 24 STR C2 AND C10 STR C2 AND C12 AND SP4 ORSTR STR C2 AND C14 AND SP5 ORSTR STR C2 AND C16 AND SP6 ORSTR OUT Y0 // Rung 7 // Address 39 END #BEGIN ELEMENT_DOC "X0 ", "PROX X0 ", " ", "Sensor " "Y0 ", " ", " ", "Light " "C0 ", " ", " ", "SR Data Entry Bit " "C1 ", " ", " ", "SR Clock Pulse Bit " "C2 ", " ", " ", "Y0 " "On " " Bit " "C10 ", "SR BIT 0 ", " ", " " "C11 ", "SR BIT 1 ", " ", " " "C12 ", "SR BIT 2 ", " ", " " "C13 ", "SR BIT 3 ", " ", " " "C14 ", "SR BIT 4 ", " ", " " "C15 ", "SR BIT 5 ", " ", " " "C16 ", "SR BIT 6 ", " ", " " "C17 ", "SR BIT 7 ", " ", "SR Reset Bit " #END


  • adccommunitymod (AutomationDirect)

    Created Date: November 20,2006

    Created by: crown spec pack

    Heh, forgot my other password, and I can't get to my other email right now.

    Anyone look at this at all? I guess it's not that important (doesn't equate to production downtime if I don't figure out why it doesn't work), but if someone knows right away looking at it, could you let me know? I just don't understand why it doesn't work without the additional C2 coil.

    If no one replies I won't bug you again, promise. I'll assume I was right and it's not important/appropriate for the forum. No worries! The machines are all running http://forum1.automationdirect.com/board/smile.gif

    Thanks!

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: November 20,2006

    Created by: bcarlton

    I loaded it but could not see any reason why the outputs would not properly energise without the intermediate bit.

  • adccommunitymod (AutomationDirect)

    Created Date: November 27,2006

    Created by: researcher

    Can you try something. I had something similar, maybe not quite the same but I added 'nop ' commands between outputs. I had 5 outputs that indicated different alarms. Individually they would work but if I purposely created the 5 alarms so that they would all come on at the same time, I would only get every other output on. I added 4 'nop ' commands between the code for each output and the alarms worked OK. This is weird but I experienced this. Maybe you can try this to see if it solves your problem.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: November 19,2006

    Created by: CLW@CrownCork

    Hello everyone,

    My first post here. I was writing small programs to help train a new employee. The objective was to see how many ways we could toggle a single output, with a single input.

    In the following example, I used a shift register to shift a bit through the word, and had it do different pulses when on each time. No problem.

    The weird thing is that the output would not respond (energize) if I only used the particular register bit that was on at the time (C10, C12, C14, C16) in the line of code for the Y0 output. I had to use another relay(C2) as the "on " bit for the output Y0.

    Does anyone know why this is? I felt a bit silly when I was trying to show him something, and it didn't work at first. I told him I didn't quite understand why it didn't work without the additional relay, and would give it more thought.

    Well, I did, and I still don't know. Anyone see the obvious thing I must be overlooking to help descramble my brain?

    PLC 05

    // Rung 1

    // Address 0

    STRN X0

    ANDN C2

    ANDN C10

    ANDN C11

    ANDN C12

    ANDN C13

    ANDN C14

    ANDN C15

    ANDN C16

    SET C0

    // Rung 2

    // Address 10

    STR C1

    RST C0

    // Rung 3

    // Address 12

    STR X0

    OUT C1

    // Rung 4

    // Address 14

    STR C0

    STR C1

    STR C17

    SR C10 C17

    // Rung 5

    // Address 19

    STR C10

    OR C12

    OR C14

    OR C16

    OUT C2

    // Rung 6

    // Address 24

    STR C2

    AND C10

    STR C2

    AND C12

    AND SP4

    ORSTR

    STR C2

    AND C14

    AND SP5

    ORSTR

    STR C2

    AND C16

    AND SP6

    ORSTR

    OUT Y0

    // Rung 7

    // Address 39

    END

    #BEGIN ELEMENT_DOC

    "X0 ", "PROX X0 ", " ", "Sensor "

    "Y0 ", " ", " ", "Light "

    "C0 ", " ", " ", "SR Data Entry Bit "

    "C1 ", " ", " ", "SR Clock Pulse Bit "

    "C2 ", " ", " ", "Y0 " "On " " Bit "

    "C10 ", "SR BIT 0 ", " ", " "

    "C11 ", "SR BIT 1 ", " ", " "

    "C12 ", "SR BIT 2 ", " ", " "

    "C13 ", "SR BIT 3 ", " ", " "

    "C14 ", "SR BIT 4 ", " ", " "

    "C15 ", "SR BIT 5 ", " ", " "

    "C16 ", "SR BIT 6 ", " ", " "

    "C17 ", "SR BIT 7 ", " ", "SR Reset Bit "

    #END

    Expand Post