I am a VB6 Newbie and I'd like some help in coverting a stream of serial data from MSComm (Com1) to integer. The serial data stream comes in at a slow rate from a industrial PLC. Multiple 16-bit values are transmitted from the PLC to my PC as a constant stream of bytes as the machine runs.

The serial data goes into "strBuffer"
Dim strBuffer As String

Since the industrial PLC is sending 16-bit data values, I believe I need to extract multiple strings of length=2, convert them into integers and then do my math. (I can always synch the data on 16b boundaries so that's not an issue).

As a test I have tried the following and it does not work.
Dim ZZZ as integer
Dim ZS as string

ZS = (Mid(strBuffer, 1, 2))
ZZZ = CInt(ZS) *** Always generates a Error 13 Type Mismatch.

I'm so lost on how to resolve this. I've gone round and round for hours. Please pass on your suggestions. Thanks Robo