Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

PLC input time

Dontjen
2018-10-22
2018-10-23
  • Dontjen - 2018-10-22

    Hi,

    My PLC has digital inputs connected to capacitive sensors. In my program I'm checking to see if it's detecting or not,
    when it detects an object => everything is ok, continue etc.
    When there is no detection it shows an error message on the HMI to the user and stops the machine.

    Everything works like this but sometimes it shows the error when there is a object present.
    I already changed the sensor to see if that was the problem.
    I suspect it is from the vibration of the machine, the sensor is connected to the PLC over multiple connectors so if the
    connector doen't fit good(age)/bad contact/old connector/.. or so => error

    Is there a proper way to prevent this? Small timer on the input?

     
  • alwoso - 2018-10-22

    Hi Dontjen!

    Basically, a problem should be solved where it begins - hardware, software, material.....

    Without knowing your application or hardware components, it's difficult to give the right answer. Ask yourself some questions to find out, which solution might be possible:
    - How long is the part you want to detect in front of your sensor? Is it moving or standing still? Is the surface proper for this type of sensor?
    - If it's only a short time, or if the part is moving: Is the input frequency of your sensor and the input-module high enough to catch the signal?
    - If the plugs and connectors are the problem: Can they be fixed (e.g. to the machine body) or screwed together?

    If you want to use some kind of timer in the software, you have to take into account, that this always means a delay in catching the signal. Your machine cycle might be extended!
    The simple solution would be a "TON"-Timer, where the input signal triggers the timer and only if the signal is stable for the preset time, the timer-output will go high. But each flicker in the input signal will start the timer again - so your machine must stop and wait until you have a stable signal!
    There are other solutions like filters - you look onto the signal for a number of cycles and if there are more than x HIGH-signals, you take this as a high on the input... and so on. That depends mainly on your programming experience and CPU-functionalities. You can find some functions in the OSCAT-library.

    Good luck!

    Alfred

     
  • Dontjen - 2018-10-22

    alwoso hat geschrieben:
    Hi Dontjen!
    Basically, a problem should be solved where it begins - hardware, software, material.....
    Without knowing your application or hardware components, it's difficult to give the right answer. Ask yourself some questions to find out, which solution might be possible:
    - How long is the part you want to detect in front of your sensor? Is it moving or standing still? Is the surface proper for this type of sensor?
    - If it's only a short time, or if the part is moving: Is the input frequency of your sensor and the input-module high enough to catch the signal?
    - If the plugs and connectors are the problem: Can they be fixed (e.g. to the machine body) or screwed together?
    If you want to use some kind of timer in the software, you have to take into account, that this always means a delay in catching the signal. Your machine cycle might be extended!
    The simple solution would be a "TON"-Timer, where the input signal triggers the timer and only if the signal is stable for the preset time, the timer-output will go high. But each flicker in the input signal will start the timer again - so your machine must stop and wait until you have a stable signal!
    There are other solutions like filters - you look onto the signal for a number of cycles and if there are more than x HIGH-signals, you take this as a high on the input... and so on. That depends mainly on your programming experience and CPU-functionalities. You can find some functions in the OSCAT-library.
    Good luck!
    Alfred

    Thanks for the answer, delaying the input signal is not a real problem, the sensor is just there too see if there are parts present (multiple tiny parts in a container).
    I'll check the hardware again next time (although i could not reproduce the error by wiggling wires etc etc, maybe the plc is so fast that it doesn't show...).
    The oscat library is unknown too me, I'm new to plc programming.

     
  • alwoso - 2018-10-23

    Hi Dontjen!

    It's always good to find your own solution that fits for the machine. And if you are new to PLC programming, don't hesitate - each problem has a chance in it

    The OSCAT-library can be found here:
    http://www.oscat.de/dlmanager.html

    There are several libraries available, just check the "Basic". There is a pdf manual for all functions, so you should find the necessary information. Maybe the FF_x blocks are helpful, or the LATCH_es.

    Good luck!

    Alfred

     

Log in to post a comment.