Searching \ for '[OT]: Using Visual Basic with RS232 Read' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/serials.htm?key=rs232
Search entire site for: 'Using Visual Basic with RS232 Read'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: Using Visual Basic with RS232 Read'
2000\08\07@182749 by Dan Mulally

flavicon
face
part 1 6207 bytes content-type:text/plain; (decoded 7bit)

----- Original Message -----
From: "Michael Rigby-Jones" <spam_OUTmrjonesTakeThisOuTspamNORTELNETWORKS.COM>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Friday, August 04, 2000 2:58 AM
Subject: Re: [OT] Using Visual Basic with RS232 Read


> > {Original Message removed}
part 2 86 bytes content-type:application/octet-stream; (decode)

part 3 794 bytes content-type:application/octet-stream; (decode)

part 4 14288 bytes content-type:application/octet-stream; (decode)

part 5 142 bytes (decode)

2000\08\07@212304 by Jim P

flavicon
face
"  I implemented your suggestions as best I could. It seems to work except
 for one glitch: If a byte value of zero is sent, the program doesn't seem
to
 recognize it. It seems that any value from 0 to 255 should be valid."

The old 'error on Null' scenario.

*I believe* we worked out a solution by utilizing an "on error" statement
and 'trapped' for the condition where a Null char is rcvd.

IIRC - that was the only solution we had found at the time (VB5 - a couple
of years back).

Part of our protocol used on the Motorola Creatalink II XT called for
the use of nulls (0x00) as padding chrs - and we ran into a prob
where VB would - and things are getting foggy now - would "error"
when reading a null from the comm port *even though* a char should
have been there to 'pull' out.

Using an "On ERROR" statement - we trapped to the ON ERROR
routine and simply stuck a 'null' into the string.

IIRC that is ...

Jim






----- Original Message -----
From: "Dan Mulally" <dtconspamKILLspamRAPIDNET.COM>
To: <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Sent: Monday, August 07, 2000 5:25 PM
Subject: Re: [OT]: Using Visual Basic with RS232 Read


----- Original Message -----
From: "Michael Rigby-Jones" <EraseMEmrjonesspam_OUTspamTakeThisOuTNORTELNETWORKS.COM>
To: <PICLISTspamspam_OUTMITVMA.MIT.EDU>
Sent: Friday, August 04, 2000 2:58 AM
Subject: Re: [OT] Using Visual Basic with RS232 Read


> > {Original Message removed}

2000\08\08@030344 by Michael Rigby-Jones

flavicon
face
> Thanks Mike,
>     I implemented your suggestions as best I could. It seems to work
> except
> for one glitch: If a byte value of zero is sent, the program doesn't seem
> to
> recognize it. It seems that any value from 0 to 255 should be valid. Is
> there something unique about 0 when using strings perhaps? Maybe this was
> also part of my original problem. I'm also wondering if there is a way to
> clear MSComm1.CommEvent which is read only.
>     My modified code is attached.
>     Thanks for the useful suggestions.
>
> Dan Mulally
>  << File: lloydspc.vbw >>  << File: lloydspc.vbp >>  << File: lloydspc.frm
> >>
>
>
Ooops, sorry about that.  This is due the the Comm control expecting ANSI
characters and Character 0 is a Null character which it dosen't like.  You
can fix this by setting Comm1.InputMode = comInputModeBinary.  This means
the Input method of the Comm control returns a byte array rather than a
string so your routines will have to be modified a tiny bit.

The VB Example shows how to do this using a Variant, which I don't usualy
like using but it does make the code very simple.

Dim Buffer as Variant
Dim bytArray() as Byte


' Get the contents of the Comm buffer

Buffer = MSComm1.Input

'Convert to byte array

bytArray = Buffer

' Send the data to your display routine

For intCount = LBound(bytArray) To Ubound(bytArray)
 DisplayChar(bytArray(intCount))
Next intCount


Hope this works, I don't have two PC's available right noe to test this.

Cheers

Mike

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\08\17@110959 by Dan Mulally

flavicon
face
Mike,

Thanks for the help and also to Jim P. I'll try your suggestion when I get a
chance. Since the data is from an A/D converter, for now I just changed all
zeros to ones so my resolution is reduced slightly. I'll get back to the
problem later and remove the "bandaid."

Dan

{Original Message removed}

2000\08\21@081550 by George Chatzigeorgiou
flavicon
face
I think that 2 PC's are not nessecary to test communications. You can
shortcut
the Transmit and Recieve pins. I didn't follow the conversation from the
beggining so
i may be talking nonsence.


{Original Message removed}

2000\08\21@115642 by Dan Mulally

flavicon
face
Mike,
   Your code seems to work like a charm! Thanks.

Dan

----- Original Message -----
From: "Michael Rigby-Jones" <@spam@mrjonesKILLspamspamNORTELNETWORKS.COM>
To: <KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU>
Sent: Tuesday, August 08, 2000 1:00 AM
Subject: Re: [OT]: Using Visual Basic with RS232 Read


> > Thanks Mike,
> >     I implemented your suggestions as best I could. It seems to work
> > except
> > for one glitch: If a byte value of zero is sent, the program doesn't
seem
> > to
> > recognize it. It seems that any value from 0 to 255 should be valid. Is
> > there something unique about 0 when using strings perhaps? Maybe this
was
> > also part of my original problem. I'm also wondering if there is a way
to
> > clear MSComm1.CommEvent which is read only.
> >     My modified code is attached.
> >     Thanks for the useful suggestions.
> >
> > Dan Mulally
> >  << File: lloydspc.vbw >>  << File: lloydspc.vbp >>  << File:
lloydspc.frm
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2000\08\21@122546 by Michael Rigby-Jones

flavicon
face
Glad I could help.  The COMM control is quite usefull, it's just that
Microsoft didn't see fit to include much in the way of documentation or
simple examples.

Cheers

Mike

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...