AGG Software Forums
June 25, 2024, 01:12:54 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome on our forum!
 
   Home   Help Search Login Register  

Pages: [1]
  Print  
Author Topic: ASDL buffering issues, redirecting serial data with virtual ports?  (Read 11361 times)
Flaps
Jr. Member
**

Karma: +0/-0
Posts: 8


View Profile
« on: February 15, 2022, 05:45:25 PM »

Hi group,
This is a little lengthy but I hope you'll bear with me.
I'm experiencing some command/response issues when redirecting serial communication between 2 virtual ports and a balance.
Following a "Send" command to the balance (issued from a proprietary software) I intercept and modify the balance-response before it is redirected to a port used by the proprietary software which processes the modified data.

The setup works fine except for a detail of which I was initially unaware: When switching between balance commands  it seems as if the previous command is re-sent - not the new command. Could it be some sort of bufferthing I need to set up in ASDL ?.
There is no problem when issuing the commands directly via a terminal program (Termite). switching between commands results in the expected responses every time - no need to resend it.

Communicating directly with the balance (no virtual ports and going directly to COM5) using Termite :
Sending command  : "S"
Response : "S S       0.00 mg"
Switching to new command :
sending command  : "T"
Response : "T S       0.00 mg"

My virtual port setup is the following :
Balance <-> Com5  <->(Com4 <->Com3) <-> Software/Terminal prog.  Com3/4 are the virtual pair.
Sending command  : "S" (to COM3)
Response : "S S       0.00 mg"
Switching to new command :
sending command  : "T"
Response : "S S       0.00 mg" (Which is the response expected from the previous "S"-command). Resending the "T" command will result in the correct (taring) function.

The problem is the same whenever I switch command (from T to S or vice versa) the first response is the response expected from the previous command.

I can physically see on the balance which command it is processing  as it says whether it is "taring" or "capturing wighing data". Therefore I'm quite sure that even if ASDL states that a port is sending a "T" to the port, the balance shows that it is in fact receiving and responding to the previous "S" command.
Could this be related to some sort of buffer-setting or the like?. Any assistance would be greatly appreciated.[/left]
« Last Edit: February 15, 2022, 05:47:23 PM by Flaps » Logged
Flaps
Jr. Member
**

Karma: +0/-0
Posts: 8


View Profile
« Reply #1 on: February 15, 2022, 07:40:15 PM »

Solved - An incomplete <CR><LF> termination of the result/parsed string - balance needs both characters to recognize that a command was received on the port. As it received only "half" of the required line termination characters - it took 2 turns before it invoked the latest received command. Ouch :-).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines