Searching \ for '[EE]:Vbasic' 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/language/index.htm?key=basic
Search entire site for: 'Vbasic'.

Exact match. Not showing close matches.
PICList Thread
'[EE]:Vbasic'
2002\05\29@013142 by Salah

flavicon
face
Hello List,
 Anybody knows where to find some Vbasic code about how to read the RS-232
data from the PC serial port which is connected to PIC MPU sending data in
continous way. Any links,ideas are all welcomed.
Regards,
Salah.

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


2002\05\29@055057 by Mike Singer

picon face
Salah wrote:

>Hello List,
>  Anybody knows where to find some Vbasic code about how to read the RS-232
>data from the PC serial port which is connected to PIC MPU sending data in
>continous way. Any links,ideas are all welcomed.
>Regards,
>Salah.

  Hi, Salah.
  Didn't you see, all PICList heavy-weights dislike M$ software?
You mean MS VB, yeah? Most of the community are extremely
software-ascetic, being EE. Have look at postings in threads:
  "Best small windows developer platform??"
  "You Can Make it if You Try, Roman."
  Personally, I can't afford myself to be a software spartan,
since I have to make my living in any way, so what can I say:
  You are on a right way, Salah. MS VB is a good choice, sure.
As for me, the best way to handle RS-232 from VB is using
MS Comm control.
  Going this way, you absolutely need MSDN, installed on
your computer, particularly "VBREF98.CHM" book. In the chapter
"Controls reference"-"ActiveX controls" it has a lot of documentation
on "MSComm Control" with examples.
  To handle RS-232 from PIC side, if you going to start with 16F87X,
you may read:  "PICmicro MID-RANGE MCU FAMILY", DS31018A,
Section 18. USART
  In addition I'd like to mention Olin Lathrop's posting "Re: [EE]: Class AB
output stage clipping". It goes about electronics, but the idea how to choose
learning curve is the same.

{Quote hidden}

  Great thoughts, by the way.
     Why not to strike them on a PICList  facade wall?

  Good luck.
  Mike.

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


2002\05\29@100514 by M. Adam Davis

flavicon
face
Serial port communication in VB is almost always done with an activex
control, and that control is usually the MSCOMM control.  IIRC, MSCOMM
control did not come with certian lower version of VB (I belive it has
always been in enterprise and pro, but unsure about standard and
student).  If it is not included in your version then you can get it
wrapped up in someone elses activex control - do a search for it.  If
not then look for other serial port controls.

Once you have that straightened out there are tons of examples for its
use.  My own simple program is here:
http://www.ubasics.com/adam/electronics/ha/software/software.shtml

and a huge resource for any VB fanatic is
http://www.planetsourcecode.com/

Good luck!

-Adam

Salah wrote:

{Quote hidden}

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


2002\05\29@103226 by tmariner

flavicon
face
Hello Salah,

Virtually every design we have done for the past 15 years has included an RS-232 port and companion Visual Basic program for initial loading, production diagnostics, etc.

I would get any version of VB (although the newest, VB.NET is a bit steeper learning curve) and use a copy of the sample code for Terminal.com (or VBTerm). The ways of including the MSCOMM control on the forms and reacting to the incoming and outgoing messages should become clear.

Other bits of advice:

1. Have a database (probably ACCESS) behind the program. You'll find a million uses for it, both in storing the data and program settings, etc.
2. Leave your communications in ASCII with CR's both ways. That way you can diagnose comms problems before they get to your program.

Tom Mariner

{Original Message removed}

2002\05\29@111202 by Alan B. Pearce

face picon face
>2. Leave your communications in ASCII with CR's
>both ways. That way you can diagnose comms
>problems before they get to your program.

It also means you can use some sort of snooper or even Hyperterminal or
other terminal program to do debugging if you use printable ASCII that makes
(human) sense for the command structure, and Hex or Dec for the values
passed across.

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


2002\05\29@134920 by Bob Ammerman

picon face
Or, if you have the standard version of VB and thus don't have VB, and if
you are a masochist, then you can do serial comms with the low-level Win32
API, just the way we C++ programmers do ;-)

Bob Ammerman
RAm Systems

{Original Message removed}

2002\05\29@144125 by Peter L. Peres

picon face
On Wed, 29 May 2002, Bob Ammerman wrote:

>Or, if you have the standard version of VB and thus don't have VB, and if
>you are a masochist, then you can do serial comms with the low-level Win32
>API, just the way we C++ programmers do ;-)

No, the masochists use VBComm, normal people use read/write on serial
ports which are like normal DISK FILES on SANE systems so you can read and
write to them like to any file. This even works on MSDOS fyi. Of course
they had to improve things.

Peter

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


2002\05\29@181528 by Mike Singer

picon face
Peter L. Peres wrote:

>On Wed, 29 May 2002, Bob Ammerman wrote:

>>Or, if you have the standard version of VB and thus don't have VB, and if
>>you are a masochist, then you can do serial comms with the low-level Win32
>>API, just the way we C++ programmers do ;-)
>
>No, the masochists use VBComm, normal people use read/write on serial
>ports which are like normal DISK FILES on SANE systems so you can read and
>write to them like to any file. This even works on MSDOS fyi. Of course
>they had to improve things.
>
>Peter

  Agree, but SUPER-normal people use big drums or fire to communicate with
each other somwhere in savanna. >This even works without MSDOS fyi. Of course
they had to improve things.<

  Mike.

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


2002\05\29@213640 by Salah

flavicon
face
Hello !
  thanx for Adam,tmariner,Alan,Bob,Peter and Mike .... I wrote some code
and it is working but still I have a problem ...
I tried ur code Adam that is listed in the link u`v wrote to me ..it is
working but have the same problem i had in my code ....
I am sending a 9 chars. length data at a time from the PIC16F877 side and
trying to receive the same data but unfortunately  when I display it in the
text box I will have 8 char. in the first line and 1 char in the next line
while I am not using the new line char just in the end of the receiving ....

data format is: CXASD
CX : is channel no. C1,C2, up to C4.  (2 chars.)
A    : Alarm status ,it can be Y/N.       (1 char.)
S     : Sign , +/-  (1 char.)
D    : Data , 5-digit data  (5 chars. "0" to "9")

sample data : C1N+01000   which means channel 1,no alarm, plus 1000v.
the received data must be something like this :

C1N+01000
C1N+01000
C1N+01000
C1N+01000
C1N+01000

{Original Message removed}

2002\05\29@224247 by M. Adam Davis

flavicon
face
If I understand you correctly, what you are saying is that you are
reading each character into a text box, and only 8 characters appear on
each line?

Make sure your text box is big enough (make it to hold 12-14
characters).  If it still happens then use the hex$() function to
convert each byte into hex, and display the data as hex - this will help
you catch non printing characters such as CR or LF.  IF you are
receiving correct data then cut the code down as much as you can to
still demonstrate the problem.  We might be able to find out what's
happening then.

Are you using the japanese version of windows?  If so, please note that
you need to use the mscomm control in binary mode, you need to use
binary arrays to process it (not text strings as I have in my program)
and you need to convert each byte into DBCS (double byte character
something or other) before it will display properly in your textbox.

-Adam

Salah wrote:

{Quote hidden}

>{Original Message removed}

2002\05\29@235445 by Salah

flavicon
face
Thanx Adam.....
it is working  now :-)))))
u was very helpfull .

Thanx again.


----- Original Message -----
From: "M. Adam Davis" <spam_OUTadampicTakeThisOuTspamUBASICS.COM>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Thursday, May 30, 2002 11:41 AM
Subject: Re: [EE]:Vbasic


{Quote hidden}

the
> >text box I will have 8 char. in the first line and 1 char in the next
line
> >while I am not using the new line char just in the end of the receiving
....
{Quote hidden}

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


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