UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Compare Rs232 Traffic Between Two Scenarios, Any Versions    
 
   
Fullmon
post Dec 21 2017, 10:37 PM
Post#1



Posts: 1
Joined: 21-December 17



I want to compare RS232 traffic between two scenarios. Feel free to skip the background and jump right to the traffic logs. Can anyone explain to me why I may be seeing differences in these scenarios?

History
I have been trying to debug some RS232 communication issues between a very legacy hardware device and an application running on a Win98 PC. The comms between this PC and the device work perfectly, but I have not been able to get success with any other setups (virtualization, USB Com Port Adapter).

I'll cut out as much of the history as possible. I have an application running on a Win98SE Virtual PC (Microsoft) and on physical hardware running Win98SE.

On the Virtual PC side I am forwarding COM2 traffic to a physical COM port, which happens to be a USB COM Port Adapter.

After disabling FIFO buffers, the port appears to work without a hitch. I can transfer files between the real Win98SE PC and the Virtual Machine over the com port using HyperTerminal.

I did some PortMon analysis, and I found that the application repeatedly sends a particular set of bytes, sending this sequence of bytes to the hardware, I get varying amounts of data sent back to me.

However, when I run the application on the Virtual PC, I note that the application does not communicate with the hardware, it reports communication errors, data does not update, etc.

Traffic Logs
Running PortMon on the real PC, I get this sequence of typical communication (this works):

CODE
19  2:17:20 PM  COMAPP  VCOMM_WriteComm COM2    SUCCESS Length: 4: 81 02 00 7E  
20  2:17:20 PM  COMAPP  EventNotifyProc COM2    VOID    : TXEMPTY  
21  2:17:20 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS EVENT  
22  2:17:20 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
23  2:17:20 PM  COMAPP  EventNotifyProc COM2    VOID    : RXCHAR    
24  2:17:20 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS RECEIVE    
25  2:17:20 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
26  2:17:20 PM  COMAPP  VCOMM_ReadComm  COM2    SUCCESS Length: 1: 06  
27  2:17:20 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS NONE    
28  2:17:20 PM  COMAPP  VCOMM_WriteComm COM2    SUCCESS Length: 4: 80 02 00 7F  
29  2:17:20 PM  COMAPP  EventNotifyProc COM2    VOID    : TXEMPTY  
30  2:17:20 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS EVENT  
31  2:17:20 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
32  2:17:20 PM  COMAPP  EventNotifyProc COM2    VOID    : RXCHAR    
33  2:17:20 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS RECEIVE    
34  2:17:20 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
35  2:17:20 PM  COMAPP  VCOMM_ReadComm  COM2    SUCCESS Length: 1: 06  
36  2:17:20 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS NONE


Running PortMon on the Virtual PC, I get this sequence of communications (this doesn't work):
CODE
21  4:56:30 PM  COMAPP  VCOMM_WriteComm COM2    SUCCESS Length: 4: 81 02 00 7E  
22  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
23  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
24  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
25  4:56:30 PM  COMAPP  EventNotifyProc COM2    VOID    : TXEMPTY  
26  4:56:30 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS EVENT  
27  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
28  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
29  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
30  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
31  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
32  4:56:30 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
33  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
34  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
35  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
36  4:56:32 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS NONE    
37  4:56:32 PM  COMAPP  VCOMM_WriteComm COM2    SUCCESS Length: 4: 80 02 00 7F  
38  4:56:32 PM  COMAPP  EventNotifyProc COM2    VOID    : TXEMPTY  
39  4:56:32 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS EVENT  
40  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
41  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
42  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
43  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
44  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
46  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
47  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
48  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
49  4:56:32 PM  COMAPP  VCOMM_ClearCommError    COM2    SUCCESS NOERROR
50  4:56:32 PM  COMAPP  VCOMM_GetCommEventMask  COM2    SUCCESS NONE


There are some obvious differences:
1. The virtualized app excessively clears Comm Errors, when they don't appear to exist.
2. The virtualized app never receives RXCHAR, and thus never reads the 06.

I am very new to this kind of analysis, but what immediately comes to mind is that some of the signals (CTS, RTS, DSR, DTR, etc...) may not work with a USB COM Adapter, and perhaps the app requires these signals. Again, I'm no expert, maybe these signals are always required.

If I use IONinja to connect to the hardware, and send the same bytes I am capturing above, I do get the 06 response (among other responses), but the application does not recognize this.

I've made a little hardware sniffer:
Attached File  oRRcom.png.jpg ( 23.34K )Number of downloads: 0


Looking at the Rx communication, then the Tx communication, I can see that all the communication is in fact occurring as expected. However, timing may be compromised. It appears that in order to function as quickly as possible, it was coded to reject information delivered out of sync from the polling requests.

On closer inspection, I see that the software does work partially, with comm state toggling between "error" and "no error" and some data being partially visible.

In conclusion, the USB adapter is what is falling down here.
Go to the top of the page
 
GroverParkGeorge
post Dec 22 2017, 07:52 AM
Post#2


UA Admin
Posts: 32,566
Joined: 20-June 02
From: Newcastle, WA


Welcome to UtterAccess.


--------------------
Go to the top of the page
 
zocker
post Dec 22 2017, 05:35 PM
Post#3


Utterly Eccentric and Moderator
Posts: 4,062
Joined: 4-March 00
From: Bristol / Ipswich / Spain


QUOTE
After disabling FIFO buffers, the port appears to work without a hitch. I can transfer files between the real Win98SE PC and the Virtual Machine over the com port using HyperTerminal.


That in itself is a major acheivement!

As George says, welcome to UA! welcome2UA.gif

Zocker

--------------------
I would like to remind members and visitors that UtterAccess is a NON SMOKING website. In that respect, it is the worlds first Thank you for not smoking.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    23rd May 2018 - 06:05 AM