Announcement

Collapse
No announcement yet.

UDC w/ Photoelectric Switch & DL06

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


  • UDC w/ Photoelectric Switch & DL06

    I'm teaching myself about PLC's for work by using the classic example of creating a system that calculates the number of people who enter and leave a room. My input sensors are 2 Omron DS70M4T photoelectric switches. I'm using a DL06 PLC, and have a variety of different cards at my disposal (4-20 mA Analog I/O, 0-10V Analog I/O, ethernet cards, etc).

    To get started, I could use some help with getting my wiring and choice of cards right. Once I have that set up, I should be able to experiment with the programming side of things. I think the photoelectric switch output circuit diagram I need to follow is the one labeled "DC solid-state NPN output" in the switch diagram (see link above), but please tell me if I'm wrong! How do I incorporate that with my analog input cards and configure the cards?

    I'm also wondering what the difference is between card inputs and the built-in inputs - and when should I use one instead of the other?

    Thanks in advance!


  • #2
    Maybe a crucial thing to learn is the difference between discrete and analog devices.

    A discrete device (like your photoelectric switch) gives an On/Off output. Either all the way ON or all the way OFF.

    An analog device gives a varying voltage or current to reflect a range of values for a sensed state. They would be the type of device you would attach to your analog input cards. An analog input card produces a number proportional to the level of the signal received.

    And use built-in inputs if only have a few inputs. (The built-in inputs are for discrete devices as mentioned above.)
    Last edited by bcarlton; 01-26-2015, 04:00 PM.
    thePLCguy

    Bernie

    Comment



    • #3
      Thanks for catching me on that. I'm sure I'll be back with more questions soon!
      Last edited by ashgray13; 01-26-2015, 03:55 PM.

      Comment



      • #4
        Originally posted by ashgray13 View Post
        My input sensors are 2 Omron DS70M4T photoelectric switches.
        To get started, I could use some help with getting my wiring and choice of cards right. I think the photoelectric switch output circuit diagram I need to follow is the one labeled "DC solid-state NPN output" in the switch diagram (see link above), but please tell me if I'm wrong!
        The part number you gave appears from the link to be for the sensor head. I see optional output modules that can be chosen from in the link, and you would need to know which module you have to know how to wire, and to what type of PLC input.

        It would be pretty easy to do this project with a "UDC" (up/down counter). For a better learning experience, perhaps you should look into doing it with some of the math and word memory functions and some comparative contacts.
        Bob

        Comment



        • #5
          I appreciate your help, Bob. I'd like to get the system working with the UDC first before experimenting with other methods, but I'll definitely play around with the other functions once I get this going.

          I have the relay output module that the device came equipped with - so I should be wiring according to the top left output circuit diagram. If I was dealing w/ a breadboard I'd be fine, but I'm confused about how to set up two of these switches with the PLC inputs and outputs.

          Comment



          • #6
            Exactly which DL06 do you have? There are various models. The analog inpput cards are not relevant at this point.

            The DL06 manual has examples of various types of input wiring. Match the diagrams to the type of DL06 you have.
            thePLCguy

            Bernie

            Comment



            • #7
              Originally posted by ashgray13 View Post
              I'm using a DL06 PLC, and have a variety of different cards at my disposal (4-20 mA Analog I/O, 0-10V Analog I/O, ethernet cards, etc).
              which model DL06? Also, the analog I/O & network cards probably won't be needed for what you've described...


              Originally posted by ashgray13 View Post
              To get started, I could use some help with getting my wiring and choice of cards right. Once I have that set up, I should be able to experiment with the programming side of things. I think the photoelectric switch output circuit diagram I need to follow is the one labeled "DC solid-state NPN output" in the switch diagram (see link above), but please tell me if I'm wrong!
              I know this is usually everyone's answer, but it depends.... Does your PLC have AC or DC inputs? Is your field circuit compatible, or will you need to add a relay, or possibly an expansion module? Do you need to know when the pe is off, on, or a timed variation of either?


              Assuming your PLC inputs & field circuit are both 24VDC, and the PLC inputs are sinking, you would bring +24VDC to pins 1 & 3 of the sensor, 0VDC to pin 2, and a wire from pin 4 or 5 (or both) to the input(s) of the PLC. Also on the PLC, you would need a 0VDC to the common of the input set you choose.



              Originally posted by ashgray13 View Post
              How do I incorporate that with my analog input cards and configure the cards?
              again, it depends on the application. Analog modules are for measuring things that aren't discrete, like tank levels, running amps of a motor, speed, proximity, et al.

              The modules are configured in the software.

              Originally posted by ashgray13 View Post
              I'm also wondering what the difference is between card inputs and the built-in inputs - and when should I use one instead of the other?
              the expansion slot is just that, to expand I/O.... to have more options.

              Comment



              • #8
                Thank you both so much! That got me on the right track. I now have the switches set up and operating as needed. I'll be back with some programming questions soon enough, I'm sure. Thanks again.

                Comment



                • #9
                  I could use another hand. I've got the UDC function keeping a count of the room occupancy; it increments when the entrance switch [X1] makes contact, and decrements when the exit switch [X3] makes contact.

                  However, I need to learn how to get these results on a daily basis:
                  • Daily max occupancy
                  • Time the first person entered each day
                  • Time the last person left each day
                  • # of times the room was entered each day (count of [X1]).
                  • # of times the room was exited each day (count of [X3]).


                  I realize I should be able to set up counters for those last two bullet points, but for some reason just setting up a counter for X1 or X3 after the UDC function totally screws up the UDC and counter numbers.

                  Is anyone willing to help get me going with this? Thank you!

                  Comment



                  • #10
                    One thing to note is that the UDC function uses 2 counter locations. So if your UDC uses CT0, it will also use CT1 as well. Your next counter would have to start at CT2.
                    If you have an urgent issue, please contact AutomationDirect's Technical Support team.

                    AutomationDirect.com Technical Support: 1(800) 633-0405 or (770) 844-4200 Email Tech Support

                    Comment



                    • #11
                      Ah, that helps. I mainly need to focus on the first three bullet points, then. Any advice there? Is there a standard method of getting timestamps?

                      Comment



                      • #12
                        Originally posted by ashgray13 View Post
                        However, I need to learn how to get these results on a daily basis:
                        • Daily max occupancy
                        • Time the first person entered each day
                        • Time the last person left each day
                        • # of times the room was entered each day (count of [X1]).
                        • # of times the room was exited each day (count of [X3]).


                        I realize I should be able to set up counters for those last two bullet points, but for some reason just setting up a counter for X1 or X3 after the UDC function totally screws up the UDC and counter numbers.
                        I see no reason why a separate CNT on a separate rung counting X1 or X3 triggers should mess with a different count, except that the UCD uses 2 words of VMEM (as someone else pointed out while I was confirming).



                        Originally posted by ashgray13 View Post
                        However, I need to learn how to get these results on a daily basis:
                        • Daily max occupancy
                        • Time the first person entered each day
                        • Time the last person left each day
                        • # of times the room was entered each day (count of [X1]).
                        • # of times the room was exited each day (count of [X3]).

                        The daily max will require the max number be stored in a holding register and compared to the current value of the UDC every time someone enters. If the UDC value is bigger, the copy the current UDC value to the max value holding register.

                        Look up the <>= contacts and the compare instructions, as well as the LD and OUT box instructions to learn about comparing and moving numbers in and out of memory locations.

                        The time stamps will require you to copy time values to new holding registers when needed.
                        Bob

                        Comment



                        • #13
                          That helped a lot. I thought I had trouble w/ the timestamp thing, but I'm making progress now... just had to discover the preset V-locations that hold year, day, hour, etc.
                          Last edited by ashgray13; 01-28-2015, 05:23 PM.

                          Comment

                          Working...
                          X