Announcement

Collapse
No announcement yet.

Dl 05 programming questions

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


  • Dl 05 programming questions

    Greetings everyone hopefully i can get some quick tips or solutions to a problem i'm having with my direct logic 05, basically i want to take an analog input from a dc tachometer and compare some values that it gives so for instance if it is giving out a value from 0-2 volts i want a timer to delay the output for 1 second then if its 2.01 to 4 volts i want the delay to be .5 seconds anyone know of how i can do this or any help with it would be greatly appreciated thanks!


  • #2
    All you need is some boolean compare contacts on rungs to determine which range you are in and then

    LD K(value for that range)
    OUT V(anything in user range)

    And then the timer needs to use the same V as the OUT above as its preset value.
    "...Specialization is for insects." - Heinlein

    Comment



    • #3
      insightful,

      Did stimpsonjcat's answer give you enough of a nudge or do you need more help?

      Originally posted by insightful View Post
      basically i want to take an analog input from a dc tachometer and compare some values that it gives so for instance if it is giving out a value from 0-2 volts i want a timer to delay the output for 1 second then if its 2.01 to 4 volts i want the delay to be .5 seconds anyone know of how i can do this or any help with it would be greatly appreciated thanks!
      If you do need more help, can you define the output a little better for my feeble mind. Are you wanting an analog out? If you are wanting an analog out do you want it to mimic the analog in but delayed for the time period you specified?
      PERCUSSIVE MAINTENANCE: The fine art of whacking the devil out of an electronic device to get it to work again.

      Vaughn

      Comment



      • #4
        analog inputs

        i have a dc tach which is sending me an analog signal whenever it turns, first i was wondering how do i put this in the program meaning how can i use that analog input as a signal in the programming of the plc since there is no space to put it in as something like x0 or x1 so how can i use that in the program then i need to use what it seems like boolean operations to compare the volts that i am getting as an analog input to then use timers to set up a delay for the different voltage readings hope this helps clarify! any suggestions are welcome thanks again!

        Comment



        • #5
          If you have not already, please read the manuals

          http://web3.automationdirect.com/sta...0optionsm.html

          Also look at the IBOX manual, this will help you set up the module.

          http://web3.automationdirect.com/sta...l05_ibox_s.pdf

          Comment



          • #6
            Originally posted by insightful View Post
            first i was wondering how do i put this in the program meaning how can i use that analog input as a signal in the programming of the plc
            Insightful,

            I'm including some text that you can copy into notepad, save, open a new project in DS5 go to "file" import, program, this will open up in DS5 and maybe answer some questions. I made some presumptions that may be wrong as to what kind of output you were desiring. The analog module I chose (F0-2AD2DA-2) has inputs as well as outputs.

            If you could describe the output a little better perhaps we can give something other than a guess. So If you want a light, bell, or a shock in the seat of the pants for the operator. Or maybe you want an delayed analog playback like the one in my ladder.

            Copy below this line

            PLC 05

            // Rung 1
            // Address 0
            #BEGIN COMMENT
            "http://forum.automationdirect.com/showthread.php?t=5750"
            ""
            "Greetings everyone hopefully i can get some quick tips or solutions to a problem i'm "
            "having with my direct logic 05, basically i want to take an analog input from a dc "
            "tachometer and compare some values that it gives so for instance if it is giving out a value "
            "from 0-2 volts i want a timer to delay the output for 1 second then if its 2.01 to 4 volts i "
            "want the delay to be .5 seconds anyone know of how i can do this or any help with it "
            "would be greatly appreciated thanks!"
            ""
            ""
            ""
            ""
            "This rung loads the modules (F0-2AD2DA-2) values via the pointer method on the plc first "
            "scan"
            #END
            STR SP0
            LD K202
            OUT V7700
            LDA O2000
            OUT V7701
            LDA O2010
            OUT V7702

            // Rung 2
            // Address 7
            #BEGIN COMMENT
            "This rung scales the raw data from the module to volts the decimal point is implied so a "
            "value of 1000 = 10.00 volts. A value of 845 = 8.45 volts "
            #END
            STR SP1
            LD V2000
            MUL K1000
            DIV K4095
            OUT V2020

            // Rung 3
            // Address 12
            #BEGIN COMMENT
            "The purpose of this rung is to get a ""oneshot"" that is only ""on"" for one PLC scan every 50 "
            "milliseconds "
            #END
            STR SP6
            PD C0

            // Rung 4
            // Address 14
            #BEGIN COMMENT
            "This rung moves the values in the table starting with V3000 to V3023 (remember it's octal) "
            "and shifts them up one memory location. This happens every 50ms so the tenth location "
            "is one half second ago. The 20th location is 1 second ago. "
            ""
            "So the value that was in v3000 is now in v3001 The value that was in v3022 is now in "
            "v3023. The value that was in v3023 just disapears."
            #END
            STR C0
            LD K20
            LDA O3000
            MOV V3001

            // Rung 5
            // Address 19
            #BEGIN COMMENT
            "This rung writes a new value into v3000"
            #END
            STR C0
            LD V2020
            OUT V3000

            // Rung 6
            // Address 22
            #BEGIN COMMENT
            "This rung averages the values in the table "
            #END
            STR SP1
            LD V3000
            ADD V3001
            ADD V3002
            ADD V3003
            ADD V3004
            ADD V3005
            ADD V3006
            ADD V3007
            ADD V3010
            ADD V3011
            ADD V3012
            ADD V3013
            ADD V3014
            ADD V3015
            ADD V3016
            ADD V3017
            ADD V3020
            ADD V3021
            ADD V3022
            ADD V3023
            DIV K20
            OUT V2021

            // Rung 7
            // Address 45
            #BEGIN COMMENT
            "If the value is less than 2.01 volts load the oldest recorded analog value (1 second ago) "
            "into the output analog channel"
            ""
            ""
            ""
            "Remember the values are recorded every 50 ms so 10 recordings equal .5 second"
            ""
            #END
            STRN V2021 K201
            LD V3023
            MUL K4095
            DIV K1000
            OUT V2010

            // Rung 8
            // Address 51
            #BEGIN COMMENT
            "If the average values in the table are equal to 2.01 volts or higher load the tenth oldest "
            "recorded value into the analog out channel"
            ""
            ""
            #END
            STR V2021 K201
            LD V3011
            MUL K4095
            DIV K1000
            OUT V2010

            // Rung 9
            // Address 57
            #BEGIN COMMENT
            " I used this rung to load values into v2000 because I did not have an analog module at "
            "my desk "
            ""
            "You would need to delete this rung for your project"
            #END
            STR SP1
            LD V7766
            MUL K68
            OUT V2000

            // Rung 10
            // Address 61
            END

            // Rung 11
            // Address 62
            NOP


            #BEGIN ELEMENT_DOC
            "C0","",""," sp6 (50 ms) PD"
            "V2000","","","raw data from analog input channel 1"
            "V2010","","","analog output channel 1"
            "V2020","","","scaled voltage from analog input channel 1 decimal point is implied. So a value of 1000 equals 10.00 volts "
            "V2021","_v2021","","average scaled value for the last second"
            "V3000","_v3000","","first table address"
            "V3001","_v3001","","second table address"
            "V3002","_v3002","","third table address"
            "V3003","_v3003","","fourth table address"
            "V3004","_v3004","","fifth table address"
            "V3005","_v3005","","6th table address"
            "V3006","_v3006","","7th table address"
            "V3007","_v3007","","8th table address"
            "V3010","_v3010","","9th table address"
            "V3011","_v3011","","10th table address"
            "V3012","_v3012","","11th table address"
            "V3013","_v3013","","12th table address"
            "V3014","_v3014","","13th table address"
            "V3015","_v3015","","14th table address"
            "V3016","_v3016","","15th table address"
            "V3017","_v3017","","16th table address"
            "V3020","_v3020","","17th table address"
            "V3021","_v3021","","18th table address"
            "V3022","_v3022","","19th table address"
            "V3023","_v3023","","20th table address"

            #END
            PERCUSSIVE MAINTENANCE: The fine art of whacking the devil out of an electronic device to get it to work again.

            Vaughn

            Comment



            • #7
              analog inputs

              Vaughn,
              i have the d0-05dd plc and the module i have is the f0-04ad-2 i'm not sending out any analog outputs so how would it look or what editing would i have to do to it to just read the analog input and then send a digital on/off signal that is delayed, i want to thank you for the last post you had also it was a great help thanks for taking the time to respond i think that since i'm not sending an analog output it should make the program more straightforward? let me know please! thanks!

              Comment



              • #8
                Originally posted by insightful View Post
                how would it look or what editing would i have to do to it to just read the analog input
                In the example I sent you rung #1 sets up the PLC to read the analog module. I used a different module than what you have so you will have to make some changes.

                In rung #7 there is a "less than" compare function, in rung #8 there is a "greater than and equal to" compare function. You will need to use these as "permissives" to condition the timer(s). Or you can change the preset of the timer with the analog value.





                PLC 05

                // Rung 1
                // Address 0
                #BEGIN COMMENT
                "http://forum.automationdirect.com/showthread.php?t=5750"
                ""
                "Greetings everyone hopefully i can get some quick tips or solutions to a problem i'm "
                "having with my direct logic 05, basically i want to take an analog input from a dc "
                "tachometer and compare some values that it gives so for instance if it is giving out a value "
                "from 0-2 volts i want a timer to delay the output for 1 second then if its 2.01 to 4 volts i "
                "want the delay to be .5 seconds anyone know of how i can do this or any help with it "
                "would be greatly appreciated thanks!"
                ""
                ""
                ""
                ""
                "This rung loads the modules (F0-2AD2DA-2) values via the pointer method on the plc first "
                "scan"
                #END
                STR SP0
                LD K202
                OUT V7700
                LDA O2000
                OUT V7701
                LDA O2010
                OUT V7702

                // Rung 2
                // Address 7
                STR SP1
                LD V2000
                MUL K1000
                DIV K4095
                OUT V2020

                // Rung 3
                // Address 12
                #BEGIN COMMENT
                "when the analog value is less than 201 make the timer preset 1 second"
                #END
                STRN V2020 K201
                LD K10
                OUT V2030

                // Rung 4
                // Address 16
                #BEGIN COMMENT
                "when the analog value is greater than 201 load .5 into the timer preset"
                #END
                STR V2020 K201
                LD K5
                OUT V2030

                // Rung 5
                // Address 20
                #BEGIN COMMENT
                "here is the timer with the variable preset."
                #END
                STR X0
                TMR T0 V2030

                // Rung 6
                // Address 23
                STR T0
                OUT Y0

                // Rung 7
                // Address 25
                NOP

                // Rung 8
                // Address 26
                NOP

                // Rung 9
                // Address 27
                NOP

                // Rung 10
                // Address 28
                #BEGIN COMMENT
                "above is one way to do what you want below is another"
                #END
                STRN V2020 K201
                AND X0
                TMR T1 K10

                // Rung 11
                // Address 34
                STR V2020 K201
                AND X0
                TMR T2 K5

                // Rung 12
                // Address 40
                STR T1
                OR T2
                OUT Y1

                // Rung 13
                // Address 43
                END

                // Rung 14
                // Address 44
                NOP


                #BEGIN ELEMENT_DOC
                "X0","","","input or whatever you want delayed "
                "C0","",""," sp6 (50 ms) PD"
                "T0","","","timer that has it's time delay based on the analog value"
                "T1","","","1sec analog value below 2.01"
                "T2","","","5 sec analog value above 2.01"
                "V2000","","","raw data from analog input channel 1"
                "V2010","","","analog output channel 1"
                "V2020","","","scaled voltage from analog input channel 1 decimal point is implied. So a value of 1000 equals 10.00 volts "
                "V2021","_v2021","","average scaled value for the last second"
                "V2030","preset is_v2030","","timer preset"


                #END
                PERCUSSIVE MAINTENANCE: The fine art of whacking the devil out of an electronic device to get it to work again.

                Vaughn

                Comment



                • #9
                  analog inputs

                  wow that was very helpful thanks very much vaughn! just wondering on the side is there a way to latch a timer with itself like if the timer has a value of 50 seconds instead of using an input like X1 to stay on for 50 seconds is there a way to have x1 get flagged and tell the timer to start timing then have the timer with something like timer timing as long as it is timing then it will keep accumulating then when the 50 seconds reaches then it outputs to say have then y1 turn on 50 seconds after x1 was flagged?

                  Comment



                  • #10
                    Originally posted by insightful View Post
                    is there a way to latch a timer with itself like if the timer has a value of 50 seconds instead of using an input like X1 to stay on for 50 seconds is there a way to have x1 get flagged and tell the timer to start timing then have the timer with something like timer timing as long as it is timing then it will keep accumulating then when the 50 seconds reaches then it outputs to say have then y1 turn on 50 seconds after x1 was flagged?
                    Do you want to use this new timer with the analog delay timer? Or is this a separate timer issue?
                    PERCUSSIVE MAINTENANCE: The fine art of whacking the devil out of an electronic device to get it to work again.

                    Vaughn

                    Comment



                    • #11
                      analog inputs

                      just a general timer question so if x1 gets flagged can i make the timer keep counting without having x1 to stay on for however long 50 seconds the timer keeps going then at the end it turns on y1

                      Comment



                      • #12
                        insightful,

                        Be careful of what you ask for, you did not specify how to turn off Y1
                        Attached Files
                        PERCUSSIVE MAINTENANCE: The fine art of whacking the devil out of an electronic device to get it to work again.

                        Vaughn

                        Comment



                        • #13
                          analog inputs

                          hmmmm nice catch on my mistake thanks for that... we'll i'll follow how would i turn that off then?

                          Comment



                          • #14
                            Originally posted by insightful View Post
                            how would i turn that off then?
                            I'm going to be a little rude here.

                            I donno crystal ball broke!

                            Seriously, all I have to go on is what you put in your message.

                            Do you want it to stop after a time period? Or after an input changes? One thing I did not mention was that If you remove power to the PLC the output (Y1) will turn off when the power comes back on.

                            So what do you want to stop the output with?
                            PERCUSSIVE MAINTENANCE: The fine art of whacking the devil out of an electronic device to get it to work again.

                            Vaughn

                            Comment



                            • #15
                              timers

                              alrighty not a problem i'll try to clarify... i want my sensor which is x1 that when it sees something i want that to take the analog value from the belt speed and based on whatever voltage i want it to delay that so if it is sending out 5 volts i want a 1 second delay for instance then if its 2.5 volts i want a delay of 2 seconds but i want that to be determined once the sensor is flagged not when the sensor is blocked for 5 seconds then have it produce a certain output i want it to be sensor flagged then compared to whatever analog voltage and have it output my signal after Xtime length has passed, does this help to clarify what i'm trying to do? i hope so please ask me any clarifying questions vaughn i appreciate your help greatly!

                              Comment

                              Working...
                              X