SerialCOM

2020-12-08
2020-12-09
  • andras-mozes - 2020-12-08

    Hello,

    I am trying to implement a serial communication.
    Currently I try to adapt the Serial COM with Visualization project.

    It works fine except sometimes the device (Cognex hand-held wireless code reader) doesn't get the command thus I have to send it twice or more times.

    Is it possible to improve the reliability of the communication?

    Thanks for your help in advance.

     
  • andras-mozes - 2020-12-08

    How should I set up for instance the cycle time of the IEC task i.e. based on baud rate?

    Is there some guide some where?

    How the Serial COM library knows whether some data bits are missed or not?

    Thanks in advance!

     
  • Morberis

    Morberis - 2020-12-09

    Does the device have an error when it doesn't read the device?

    You should not have to set the cycle time of the task based on baud rate, the serial port and other fieldbus's execute outside the task cycle times. However if you have timing requirements for that code reader if you are for instance sending a sequence of data might require you to have quicker cycle times. A good rule of thumb would be 3x faster than what is required to ensure consistant results. At least that's what it is when on the receiving side.

    When you say "How the Serial COM library knows whether some data bits are missed or not?" do you mean when you change the value of a variable does the serial com library finish transmitting the old value or does it suddenly change to transmitting the new value if it's currently transmitting that variable? Did I understand that right or am I off base? I don't know the answer.

    When I've done similar things but over modbus RTU I've always transmitted the same thing until I can read that the register has changed or read something else that indicates it has been received. Looking at you Lenze with your unlock controls register that you don't allow to be read that puts the drives communication into fault and don't have any register I can read that tells me drive controls are unlocked. ΰ² _ΰ² 

    If all else fails you, you might need to use asynchronous communication or asynchronous tasks... which I only know about from reading about. Or pay for a service ticket to talk to Codesys Support.

     
    πŸ‘
    1

    Last edit: Morberis 2020-12-09
    • andras-mozes - 2020-12-09

      Hi Morberis,

      I really appreciate your help.

      Actually I have dropped handwriting the serial communication and moved to Modbus πŸ˜„

       
      πŸ‘
      1
      • Morberis

        Morberis - 2020-12-09

        Glad you found a solution (οΌΎοΌΎ)b

         
        πŸ‘
        1

Log in to post a comment.