Sorry, I missed the destination address of the "reply" - here is my reply to Patrick. > I am no expert, but I have recently written some VB code > with MSCOMM using the Binary mode, and I have both Jan > Axelson's book (Serial Port Complete) and Richard Grier's > book (Visual Basic Programmer's Guide to Serial Communications) > - and I have at a couple of your books too, I might add! :-) > Anyway, I'd just like to point out that working with MSCOMM > in binary mode means both the input and output bytes are stored > in variants that contain byte arrays. > > Please correct me if I am wrong, but it looks like in your > example the mode is actually text, not binary. Yes - because I find a text string easier to work with than a byte array. Sorry, I should have put that in the original email. > InputMode can be a 1 or 0, with 0 being comInputModeText, > and 1 comInputModeBinary. So if you want to work with binary, > I think you would just use the constant comInputModeBinary. > > You would also store your output data in an array and then > give the array to MSCOMM like this, perhaps: > Dim aOutput(0 to 1) as Byte > Dim Buffer as Variant > aOutput(0) = &H14 'A byte to send > aOutput(1) = &H15 'A second byte > Buffer = aOutput > MSComm1.Output = Buffer > > To receive data, you would then do a similar setup: > Dim aInput(0 to 1) as Byte > Dim Buffer as Variant > Buffer = MSComm1.Input > aInput() = Buffer > > I like using binary because then I can check the InBufferCount > value to determine when to read the input buffer. The difference with Text is that you can append data to a String and not worry about the variable conversions that you have to do with the binary data. The "InputBufferCount" works for both Binary and Text data. > As far as displaying the analog data graphically, have you > looked at S-Plot Pro? > I haven't used it myself. I'd be curious to hear what > solution you come up with for graphically displaying your > data. No I haven't see this. I'm disappointed that there aren't any PICmicro examples I can try out. If I am going to display analog data graphically, I generally use a PictureBox along with an algorithmically calculated "Line" parameter to display the data. It's quite fast and very easy to do. myke -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics