No announcement yet.

Multiple sensors to one counter and one output for each sensor signal

  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple sensors to one counter and one output for each sensor signal

    Quick background, I have a DL06 I purchased sometime around 2004 to use as a proof of concept for a product we developed, ultimately with a different technology. I taught myself RLL when designing the proof of concept. I am now needing to provide a solution for a customer that I think a PLC will be perfect for. I'll probably use a different PLC than that DL06 for the final solution, but for now I'm testing on the DL06. So, I have some, but limited RLL knowlege, so please forgive me if I use unconventional terminology.

    The solution I need to provide is to receive line counts from 20 different sensors and send 1 output signal for each item counted on the 20 lines. There will be zero chance of two lines being triggered at the same time and the shortest gap between 2 counts on the same line will be about 1/2 second.

    I can most likely just send a 1 to 1 signal (i.e. in X0, out Y0; in X1, out Y0; in X2, out Y0, etc), but just in case there are timing issues with the hardware receiving the output signal, I would like to have a backup plan where the counts get accumulated and send out a timed output signal. I have accomplished this using an up down counter and a timer (see attached image), but one thing I noticed is that if the up count input to the counter was held high, it would ignore the down count input.

    Is there a way around this? Perhaps some way to only trigger the up count on the leading edge of the sensor signal? I've kicked around having a counter for each sensor, but it seems like a lot of math will have to be done to ultimately send one timed signal to a single output.

    Any help you have would be greatly appreciated.

    Attached Files

  • #2
    Maybe look at incrementing a numeric value on the rising edge of any of your input sensors.
    Then if the numeric value is > 0,
    Output to the specified Y output for a specified On time base then shut off
    Start timer for Minimum Off Time for Y Output
    Decrement the numeric value by one
    When Minimum Off Time for Y output is reached, go back to comparing the numeric value > 0

    In this manner, each sensor activation will provide one output pulse.
    Only a single on and a single off timer is required.


    • #3
      I think using rising edge inputs to an increment instruction would be better as well. You wont have the problem of inputs being held on when the number should decrease anymore and INC/DEC should be more legible for the program than the counter method.

      So something like this:

      Click image for larger version  Name:	image_3424.png Views:	1 Size:	59.1 KB ID:	117066

      You could actually merge rung 2 and 3 if you wanted to condense the program and increase scan time efficiency a bit more.
      Last edited by MikeN; 08-13-2018, 11:02 AM.


      • #4
        Thank you all so much. That helped a bunch!