Announcement

Collapse
No announcement yet.

Ladder Logic Help - Duplicate Sent Messages Before Leaving a Stage

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • Ladder Logic Help - Duplicate Sent Messages Before Leaving a Stage

    I'm writing some PLC code for a DL06 that reads in an ASCII string from a scanner and sends the message to computer (acting like another PLC) over ethernet. I'm using stages and I'm having trouble in a few spots where I accidentally send duplicate messages before the power flow jumps to another stage. I don't know if I need to increase my scan time or what.

    I added a toggle bit as control that just toggles every other scan. Even using the rising edge of that bit I'm still getting 2 or 3 duplicate messages sent before I jump to the next stage.

    Can anyone offer some insight? This is my first time programming using RLL, and it's a fairly complex system (at least to me).
    Attached Files


  • #2
    Please zip up all the files which have the name 'practice' at the start. They are all needed to properly see the project.
    thePLCguy

    Bernie

    Comment



    • #3
      It would be very difficult to tell if there is a problem without seeing more of the program - are there any other message stages?

      I see that this transmission is sending 8 words starting with the contents of V3000 which you set to K200. The 'buzy' bit is correct for the slot you are using.

      It may be possible that you logic is getting back to this stage in about 2 scans. That's about all the time that a simple message would take.
      Last edited by bcarlton; 03-27-2013, 07:58 AM.
      thePLCguy

      Bernie

      Comment



      • #4
        Sorry, here is the full program with all of the files zipped.

        This is a conveyer system scanning and diverting totes at a junction. The first part of the program enables the scanner, reads a barcode and sends it to another PLC (which is actually a computer acting like a PLC). The computer sends me back a message which I break into 2 pieces that tell me the zone it needs to divert to and a unique sequence number. I then compare the zone message to match it to the right zone. (In practice here, I will insert physical divert logic that controls the actual conveyer and moves the tote.) Then I append the two broken pieces of the message back together and send it back to the computer as an arrival to say, hey, I got to the right zone!

        There is also a section at the bottom that sends a "heartbeat" message to the computer every 30 seconds just to say, hey, I'm alive.

        The last stage at the bottom is a toggle control bit that is active every other scan, just to use in control as needed in the various stages.

        Right now this program works as desired with the exception that I am getting duplicates of some messages -- I get 2 heartbeat messages sent every 30 seconds and I send 2 or 3 string messages to the computer when I scan. Any suggestions?


        Disclaimer: This is all self-taught in the last two months by reading the DL06 manuals and such. Any insights into how to do something cleaner or easier would be welcome. I went from knowing nothing about PLC's to this in just a few weeks. I feel like I'm making some progress at least!
        Attached Files

        Comment



        • #5
          Your message in stage 172 does not have a test for 'Ethernet Busy'

          In Rung 41 add a RST T1 (Reset T1) after the JMP S300. The timer in the previous stage may not be reset with your immediate JMP back to its stage.
          Last edited by bcarlton; 03-27-2013, 11:31 AM. Reason: Spelling
          thePLCguy

          Bernie

          Comment



          • #6
            Originally posted by bcarlton View Post
            Your message in stage 172 does not have a test for 'Ethernet Busy'

            In Rung 41 add a RST T1 (Reset T1) after the JMP S300. The timer in the previous stage may not be reset with your immediate JMP back to its stage.
            Good catches. I updated those. Still having the same issues.

            Would manually increasing the scan time possibly help to eliminate the duplicate messages?

            Comment



            • #7
              Actually I'm surprised that the rungs with ANDP C405 work at all.

              Don't do anything with the scan time. Are you still getting duplicates of the heartbeat?
              thePLCguy

              Bernie

              Comment



              • #8
                Originally posted by bcarlton View Post
                Actually I'm surprised that the rungs with ANDP C405 work at all.

                Don't do anything with the scan time. Are you still getting duplicates of the heartbeat?
                Yes, still getting duplicates of the heartbeat.

                Comment



                • #9
                  Can you re-post your program which includes your changes?
                  thePLCguy

                  Bernie

                  Comment



                  • #10
                    With the changes.
                    Attached Files

                    Comment



                    • #11
                      The WX in rung 10 could execute multiple times depending on the time until V1400 changes to non-zero.

                      You have JMP instructions to non-existant stages. Does this even work?
                      thePLCguy

                      Bernie

                      Comment



                      • #12
                        Originally posted by bcarlton View Post
                        The WX in rung 10 could execute multiple times depending on the time until V1400 changes to non-zero.

                        You have JMP instructions to non-existant stages. Does this even work?
                        That is a good point. I suppose I could separate that out into 2 stages and see if it helps.

                        I realize there are JMP instructions to non-existent stages. Currently the message I am receiving back from the computer is set to always designate zone 3 as a destination (for testing), so those other stages are never "jumped" to. Yes, it does currently work...with the exception of the multiple messages.

                        Comment



                        • #13
                          Separating those two into separate stages fixed my problem there. I only send one message now. (I also eliminated that toggle bit.) But I am still getting two heartbeat messages for some reason.
                          Attached Files

                          Comment



                          • #14
                            I don't see how the heartbeat is retriggering before 30 seconds. Set a C bit which you will turn on in a dataview. Use it to condition the heartbeat message. On sending one heartbeat reset it. See what happens (other than hearbeat monitoring freaking out in the PC.
                            thePLCguy

                            Bernie

                            Comment



                            • #15
                              I tried all sorts of control bit triggering and I was having the same problem, no matter what I did. In the end we figured out it was a problem on the PC end. Gah! It's only sending one message, but the PC was logging it twice. Doh. Glad it's working now. Thank you for the help!

                              Comment

                              Working...
                              X