Capture the effective control state
- Verify
CommPortexists and is not already open elsewhere. - Record
Settings, handshaking and control-line assumptions beforePortOpen=True. - Use
InputModeappropriate to text or binary data; binary payloads should not pass through string conversion accidentally. - Understand whether
InputLen=0drains the current receive buffer or a fixed-length read is required. - Set
RThresholdandSThresholddeliberately and log everyOnCommevent. - Clear stale buffers only at a defined protocol boundary.
Timing and deployment traps
| No receive event | Threshold, event handling, port selection, flow control or no incoming bytes. |
|---|---|
| Truncated frame | Reading on the first event without accumulating until a complete frame. |
| Corrupt binary data | Text mode, encoding conversion or delimiter assumptions. |
| Works on old PC | Changed COM number, adapter driver latency or control-line behavior. |
Build a receive buffer that separates byte arrival from message framing. Record timestamps and raw bytes so application parsing can be tested without the device.
The broader VB6 serial guide covers architecture; use framing-error diagnosis, Prolific compatibility and the VB6 pillar for adjacent layers.