Jump to content

Com Rx and Parsing Buffer


Recommended Posts

Im using a unistream 7 to communicate over serial with a pump. I am able to set settings over using the COM Tx and Message composer, however I am encountering issues with the COM Rx command. 

I can set rates and volumes without a problem, however I want to also grab the max rate and volume from the pump at the start of the app or when a user pushes a button. I should be able to send "read limit parameter", which then returns the max rate, min rate, max volume, min volume, The following is the return from putty.

read limit parameter
29.12145 0.00010 29.31703 0.00269

However it often takes pushing the button two times to send the command to get a response back. Does the buffer need to be cleared after a read and if so, whats the easiest way to do that? Also, the message that comes back is cut off in the buffer. I only see "read limit parameter" on the receive message. The numbers do not show up in the buffer. I am using the store buffer into tag command to show the information in a string box on the HMI.

Ive tried changing the buffer size but it still doesnt help. Any other suggestions on where to investigate the timing issue and the missing data issue?




Link to comment
Share on other sites

  • 1 month later...

There is no need to clear the Buffer but according to what you wrote, but if your message is cut off, so it`s sounds like that the Buffer is to short.

Does "read limit parameter 29.12145 0.00010 29.31703 0.00269" is the full message?

I have added our example project that might help you: UniStream_070_Message_Composer_Example.ulpr

Easy was to check the Sent/Received message is via "Hercules" software.

You can check our video tutorial on message composer:


hercules_3-2-8 (1).zip

Link to comment
Share on other sites

  • 1 year later...


I also have problem with buffer. I am using US7-B10-B1 and UAC-CX-01RS2 serial card. I am connected to serial QR reader and whem I read the QR code I get 33 bytes of data. 

Data is like: h12f34568132gbfd1fgsd541g3s351gs<9>, 32 characters of string and 09hex- horizontal tab.

I am using: Number of Bytes Waiting>30 then COM RX, and then Copy Buffer to Tag.

It hapens that buffer is not completely empty after this action. In buffer can  be 1, 2 or 3 bytes of data left.  So when I read the QR next time I instead of 

h12f34568132gbfd1fgsd541g3s351gs -> gsh12f34568132gbfd1fgsd541g3s351 (string is shifted for whatever stays in buffer)

What would be the problem and if there is really no option of flushing buffer?

Link to comment
Share on other sites

  • 3 months later...


I am having similar issue.  I am using a serial port monitor software to monitor date in my serial port.  I found that the current received data of COM Rx is not being moved into the assigned buffer.  The assigned buffer is being filled with the data received from previous COM Rx scan.  That's why it needs to press button twice to have assigned buffer updated, but with previous received data. 


Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...