Slow modbus digital input response

francoinf
2020-09-16
2024-04-15
  • francoinf - 2020-09-16

    Good morning,
    I am creating an application in which I have to read the variation of a digital signal, through modbus rtu, with a frequency that varies from 1 Hz to 15 Hz, but unfortunately the speed of
    response within codesys is very slow (I can capture a maximum variation of 2 Hz; above this value, I cannot capture the variations).
    Below I describe what I did: the digital signal read by the modbus controls an event task (every time the digital signal passes from 0 to 1, the event that enables
    the task). The task activates a routine that increments the counter by one unit (in this way I can count the number of rising edges in a given time interval).
    When the frequency of the digital signal does not exceed 2 Hz, I can perform this count, otherwise not (the variation of a fast signal is not captured).
    From the outside I see that the signal varies correctly, but codesys does not detect it.
    I used:
    - a baud rate of 115200 (I started from 9600 up to 115200, without getting any improvements);
    - the master bus cycle task is controlled by a 50 ms cyclic task (I have changed this interval, without obtaining better results);
    - the trigger of the modbus channel for reading the digital signal is cyclic, and set at 50 ms (I have changed this interval, without obtaining better results);

    With a modbus testing software, on the other hand, I am able to instantly capture the variation of the digital signal; it is within codesys that I can't.

    Can anyone help me?
    Thanks in advance

     
    πŸ‘
    1
  • marcolim - 2024-04-13

    Hi francoinf,
    I've the similar problem and similar configuration.
    I did with an Arduino Board loaded by a ModbusRTUServer application on it.
    What I've notice is the slowly acquisition when release the digital signal (e.g. pin2) when it gets off.

    Anyone have suggestion?!
    Thanks

     
  • marcolim - 2024-04-15

    [Update].
    My issue's solved, I applied the resistors in Pull-down configuration on each digital input.
    In thus configuration never happened "floating or delaying" acquisition on SoftPLC/Arduino Board.

     

Log in to post a comment.