No announcement yet.

Suggestion for a new behavior for uart frame management-Diablo16

  • Filter
  • Time
  • Show
Clear All
new posts

  • Suggestion for a new behavior for uart frame management-Diablo16

    I hope I'm in the correct location in the Forum for some suggestions
    it is the "Suggestion box" Thread.

    I'm working a lot with serial communication and personally I found the Diablo16 internal function a bit weak regarding this. (I'm using almost only Visi)

    Even if the majority of the frames I have to manage are "bounded" by STX and ETX qualifier Bytes, Diablo16 allow just to detect the start of frame by using a qualifier on our choosing.
    What about to detect the end of frame?

    Also there is no fired event when the buffer is full. We have to check on regular basis, most of the time using a timer.

    However all the frames on the same COM port don't have the same length. It may be 4 bytes longs or at the opposite 200 bytes long coming in on irregular pattern.
    We have to allocate the buffer size for the longest one. However, if the frame coming in is a short one, I would have to wait a lot before to get buffer full status.
    This leads that sometimes I have to check frame content while it is still under buffering. A lot of system resources consumed.

    I would suggest you to change the behavior in this way:
    Create new function or modify the "com_Init(buffer, bufsize, qualifier)" into com_Init(buffer, bufsize, Start_Qualifier, Stop_Qualifer, User function)
    The function would behave the same as actuel Com_init except that after detecting the Start Qualifier and buffering incoming bytes, it checks for the Stop Qualifier (up to buffer size) and fires a event that launch the Defined “user function”.
    Event handler (user function) can then treat the frame immediately (without any delay) when "pertinent data" are in.

    Thanks for reading.

    Best regards

    Franck P.