A little help please...
Archiver
Posts: 46,084
Hi again!
Anyways, I'm communicating from a computer to a stamp with
transceivers (ABACOM). I am programming the computer side (that has
NO basic stamp, and is using the serial port) with Visual Basic 6.
My problem is the following:
When i transmit data from the computer to the stamp, the stamp
outputs messed up characters. For instance, I will transmit from the
computer "basic stamp" and the stamp will receive garbage
like "bskdjskd" etc.
When I transmit data from the stamp to the computer, everything is
fine.
the following is my code to initialize the port settings:
MSComm1.CommPort = 1
MSComm1.Settings = "2400,N,8,1"
MSComm1.PortOpen = True
and on the stamp, i use the serin 15, 1021, [noparse][[/noparse]value] code. the 1021
is for the BS2sx to indicate 8N1 no parity at 2400bps.
Does anyone know what I am doing wrong?
Regards
Debu
ps- I have coded the computer in C as well, and that worked fine (in
both directions of transmitting/recieving data), so, I am guessing it
has something to do with the Visual Basic and ActiveX controls.
Anyways, I'm communicating from a computer to a stamp with
transceivers (ABACOM). I am programming the computer side (that has
NO basic stamp, and is using the serial port) with Visual Basic 6.
My problem is the following:
When i transmit data from the computer to the stamp, the stamp
outputs messed up characters. For instance, I will transmit from the
computer "basic stamp" and the stamp will receive garbage
like "bskdjskd" etc.
When I transmit data from the stamp to the computer, everything is
fine.
the following is my code to initialize the port settings:
MSComm1.CommPort = 1
MSComm1.Settings = "2400,N,8,1"
MSComm1.PortOpen = True
and on the stamp, i use the serin 15, 1021, [noparse][[/noparse]value] code. the 1021
is for the BS2sx to indicate 8N1 no parity at 2400bps.
Does anyone know what I am doing wrong?
Regards
Debu
ps- I have coded the computer in C as well, and that worked fine (in
both directions of transmitting/recieving data), so, I am guessing it
has something to do with the Visual Basic and ActiveX controls.
Comments
I am already sending a bunch of start bytes before the data is sent.
This works with my C program, but, for some reason, it doesn't want
to work with the VB6
DS
--- In basicstamps@y..., "Chris Loiacono \(E-mail\)" <chris01@t...>
wrote:
> The VB6 InputMode also sets the output mode. You might check to see
if this
> is the beginning of a set of problems.
>
> The receiving end of each wireless transmission is probably losing
some of
> the first bits that are sent. A good practice is to send
a 'garbage' byte or
> string ahead of the data you intend to keep, and following with a
validation
> sequence that will tell the receiver that good data will follow.
>
> Chris
>
>
Original Message
> From: debu_sen_22 [noparse][[/noparse]mailto:debu_sen_22@y...]
> Sent: Wednesday, February 20, 2002 11:22 AM
> To: basicstamps@y...
> Subject: [noparse][[/noparse]basicstamps] A little help please...
>
>
> Hi again!
>
> Anyways, I'm communicating from a computer to a stamp with
> transceivers (ABACOM). I am programming the computer side (that has
> NO basic stamp, and is using the serial port) with Visual Basic 6.
>
> My problem is the following:
>
> When i transmit data from the computer to the stamp, the stamp
> outputs messed up characters. For instance, I will transmit from
the
> computer "basic stamp" and the stamp will receive garbage
> like "bskdjskd" etc.
>
> When I transmit data from the stamp to the computer, everything is
> fine.
>
> the following is my code to initialize the port settings:
>
> MSComm1.CommPort = 1
> MSComm1.Settings = "2400,N,8,1"
> MSComm1.PortOpen = True
>
> and on the stamp, i use the serin 15, 1021, [noparse][[/noparse]value] code. the 1021
> is for the BS2sx to indicate 8N1 no parity at 2400bps.
>
> Does anyone know what I am doing wrong?
>
> Regards
> Debu
>
> ps- I have coded the computer in C as well, and that worked fine (in
> both directions of transmitting/recieving data), so, I am guessing
it
> has something to do with the Visual Basic and ActiveX controls.
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@y...
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
is the beginning of a set of problems.
The receiving end of each wireless transmission is probably losing some of
the first bits that are sent. A good practice is to send a 'garbage' byte or
string ahead of the data you intend to keep, and following with a validation
sequence that will tell the receiver that good data will follow.
Chris
Original Message
From: debu_sen_22 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Hqyt8lLaWVHEhXJ0zqiuU42N2SmdupF-mf387x4FbdYT3YAa6hsTZFatfkxS15kcVcxxQz9QlGIlbykqGA]debu_sen_22@y...[/url
Sent: Wednesday, February 20, 2002 11:22 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] A little help please...
Hi again!
Anyways, I'm communicating from a computer to a stamp with
transceivers (ABACOM). I am programming the computer side (that has
NO basic stamp, and is using the serial port) with Visual Basic 6.
My problem is the following:
When i transmit data from the computer to the stamp, the stamp
outputs messed up characters. For instance, I will transmit from the
computer "basic stamp" and the stamp will receive garbage
like "bskdjskd" etc.
When I transmit data from the stamp to the computer, everything is
fine.
the following is my code to initialize the port settings:
MSComm1.CommPort = 1
MSComm1.Settings = "2400,N,8,1"
MSComm1.PortOpen = True
and on the stamp, i use the serin 15, 1021, [noparse][[/noparse]value] code. the 1021
is for the BS2sx to indicate 8N1 no parity at 2400bps.
Does anyone know what I am doing wrong?
Regards
Debu
ps- I have coded the computer in C as well, and that worked fine (in
both directions of transmitting/recieving data), so, I am guessing it
has something to do with the Visual Basic and ActiveX controls.
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
I hope this isn't a freebie, because serial comms combined with RF always
seem to be a lot of fun (translate 'fun' to whatever you wish).
It sounds like you re having trouble with Visual Basic's MSComm but if you
want to look at the stamp first:
I would start checking to see what the data at the receive end looks like
with an O'scope or BitScope. If you are using the WAIT modifier on the Stamp
Serin instruction, are you sending the anticipated byte or string to match
only once, then grabbing your string?
Also if you are using strings, the data will be case sensitive.
You didn't say whether or not you checked the Input mode property in your
VB?
VB also had more than one way to tell it you were sending either int's or
str's. I can't remember how and where off the top of my head though. If all
else fails, I'll look it up.
I also vaguely recall that the interpretation of 'inverted' and
'non-inverted' might be different between the stamp and VB. a good view of
the incoming bits would surely tell a lot...
There are also a fair bunch of properties in VB6's MSComm that could be set
improperly. Have you used this version of VB for serial comms before?
Chris
Original Message
From: debu_sen_22 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ZIRFwPFvxyPkCyYpESlleuFuih_7SDplmtgEWpgxLWuDZTL2lkqZUxwr-rKLXE4W2bayhu0HFuynqvT7RTVI]debu_sen_22@y...[/url
Sent: Wednesday, February 20, 2002 3:08 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: A little help please...
hey
I am already sending a bunch of start bytes before the data is sent.
This works with my C program, but, for some reason, it doesn't want
to work with the VB6
DS
--- In basicstamps@y..., "Chris Loiacono \(E-mail\)" <chris01@t...>
wrote:
> The VB6 InputMode also sets the output mode. You might check to see
if this
> is the beginning of a set of problems.
>
> The receiving end of each wireless transmission is probably losing
some of
> the first bits that are sent. A good practice is to send
a 'garbage' byte or
> string ahead of the data you intend to keep, and following with a
validation
> sequence that will tell the receiver that good data will follow.
>
> Chris
>
>
Original Message
> From: debu_sen_22 [noparse][[/noparse]mailto:debu_sen_22@y...]
> Sent: Wednesday, February 20, 2002 11:22 AM
> To: basicstamps@y...
> Subject: [noparse][[/noparse]basicstamps] A little help please...
>
>
> Hi again!
>
> Anyways, I'm communicating from a computer to a stamp with
> transceivers (ABACOM). I am programming the computer side (that has
> NO basic stamp, and is using the serial port) with Visual Basic 6.
>
> My problem is the following:
>
> When i transmit data from the computer to the stamp, the stamp
> outputs messed up characters. For instance, I will transmit from
the
> computer "basic stamp" and the stamp will receive garbage
> like "bskdjskd" etc.
>
> When I transmit data from the stamp to the computer, everything is
> fine.
>
> the following is my code to initialize the port settings:
>
> MSComm1.CommPort = 1
> MSComm1.Settings = "2400,N,8,1"
> MSComm1.PortOpen = True
>
> and on the stamp, i use the serin 15, 1021, [noparse][[/noparse]value] code. the 1021
> is for the BS2sx to indicate 8N1 no parity at 2400bps.
>
> Does anyone know what I am doing wrong?
>
> Regards
> Debu
>
> ps- I have coded the computer in C as well, and that worked fine (in
> both directions of transmitting/recieving data), so, I am guessing
it
> has something to do with the Visual Basic and ActiveX controls.
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@y...
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
I am not sure of the answer, but if you have news group access, try posting
a message in the following group:
microsoft.public.vb.controls
with the heading : Help with MSComm
An author of a book on serial comms under windows monitors the news group
and generally answers questions such as yours. I have copied his sig below
for contact purposes:
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com/vbpgser.
Good Luck,
Brian G.