Discussion in "General help Guidance and Discussion" started by    abbas1707    Aug 8, 2007.
Sat Aug 25 2007, 02:55 PM
#11
hi ajay,
hardware for this project is completed and also i have tested on hyper terminal.every thing working fine.now i want to make vb software for this project.i am thinking to plot the graphs for temperature vs time/date.but its a rough idea.can u provide me some better suggestion??i will be thankful to u...
how can i learn to receive and send characters to serial port in a vb program??can u provide me with any helpful link for it??
thanks in advance... :-|
Sat Aug 25 2007, 07:05 PM
#12
abbas i cant see the circuit diagram how to open data logger.dns
file
which software u r using :mad
Sat Aug 25 2007, 07:12 PM
#13
@ TPS:
it can be opened by Proteus VSM Simulator software.

Hi abbas,
you can have this sample code for opening/sending/receiving data from the serial port. Once you are able to work on this it will be easy for you to customize it.
The sample GUI code can be downloaded from here
Download Serial communication in VB Sample Code

From the Author: David M. Hitchner

Overview:
The routines in this module facilitate most operations associated with serial communication by encapsulating the API details in easy to call wrapper functions. For example, the CommOpen routine can be used to open and initialize a serial port.

CommOpen takes three parameters: the Port ID mentioned above, a port name such as "COM1" and the desired communication settings (Example: "baud=9600 parity=N data=8 stop=1").

CommOpen checks to see if the specified port is open. If not, it opens it with a call to the CreateFile API for generic read and write access. Next the port's input and output buffers are initialized by calling the SetupComm API followed by a call to PurgeComm. PurgeComm insures the newly created buffers are clean.

After this, the time-out parameters for all of the port's read and write operations are set by populating a COMMTIMEOUTS structure and passing it to the SetCommTimeouts function.

CommOpen now sets the control settings (baud rate, parity, etc.) for the port. To do this the current settings are: retrieved into a DCB (Device-Control Block) structure via GetCommState, modified as desired using a call to BuildCommDCB, and set with the SetCommState function.

Once this is done, the CommWrite routine can be used to write to the port. As you can see, these routines perform the bulk of the work for you. All you need to do is call them appropriately.

See the .BAS module and .TXT file for further details.


For more information there is a text file in it. also.. take a close look at the .bas file which contains the serial module. Hope this will be helpful for you.
 abbas1707 like this.
Tags serial communication with VB softwareVB sample codeVB serial communicationVB MSCOMM
Sun Sep 02 2007, 07:12 AM
#14
unable to attach more than 1 image


[ Edited Sun Sep 02 2007, 07:20 AM ]
Sun Sep 02 2007, 07:16 AM
#15
hi ajay!
first im making logging software for only 1 channel.i have done logging to html file.here are samples of my software

i will make for 8 channels later but first i want to make spread sheet on excel for only 1 sensor.
for this i need your help coz i dnt know how to logg vb data to excel file.can u plz provide me some info about it??
thanx in advance


029C 9/1/2007 10:43:13 PM
030C 9/1/2007 10:43:14 PM
031C 9/1/2007 10:43:15 PM
031C 9/1/2007 10:43:16 PM
031C 9/1/2007 10:43:17 PM
031C 9/1/2007 10:43:17 PM
031C 9/1/2007 10:43:18 PM
031C 9/1/2007 10:43:19 PM
031C 9/1/2007 10:43:20 PM
031C 9/1/2007 10:43:21 PM
031C 9/1/2007 10:43:22 PM


[ Edited Sun Sep 02 2007, 07:26 AM ]
Sun Sep 02 2007, 09:12 AM
#16
here is some notes for you..
read carefully will give you good idea..
Methods for transferring data to Excel from Visual Basic

and a sample code..
Vb to Excel data export

Version Compatibility: Visual Basic 5 Visual Basic 6

More information: The purpose of this programme is to generate report by populating data into an Ms-Excel sheet from an Ms-Access database. It will also display the sub total and grand total of the amount column at runtime, using auto formating technique.



Do share your project after you finish...
Fri Sep 07 2007, 09:50 PM
#17
hi ajay,
my project stopped working.i made pcb for it two times,and implemented one time on vero board.
but it works fine for some time and after dat it shows no response.i request u to review my code which i posted before.i dnt understand where the problem is.i have doubt about the clock frequency but not sure.
shud i make some extra circuitry??
also one thing is eating my mind! im making circuit on bread board at this time.but when i implement the code
#include <reg51.h>

void delay()
{
int k,l;
for(k=0;k<50;k++)
for(l=0;l<280;l++);
}
void init()
{
TMOD=0x22;
TH1=0xFD;
SCON=0x50;
TR1=1;
}
void sendChar(unsigned char ch)
{

delay();
delay();
SBUF=ch;
while(TI==0);
TI=0;
}
void main()
{
init();
while(1)
{
sendChar('a');
delay();

}
}
i get aaaa on hyper terminal
but when i burn the program below
#include <reg51.h>
void delay()
{
int k,l;
for(k=0;k<50;k++)
for(l=0;l<280;l++);
}
void init()
{
TMOD=0x22;
TH1=0xFD;
SCON=0x50;
TR1=1;
}
void sendChar(unsigned char ch)
{

delay();
delay();
SBUF=ch;
while(TI==0);
TI=0;
}

void sendString(unsigned char *a)
{
while(*a!='\0')
{
sendChar(*a);
a++;
}
}
void main()
{
init();
while(1)
{
sendString("abbas");
delay();

}
}
i get nothing on hyper terminal
y is it so?? i dnt understand
plz plz tell me what to do
Fri Sep 07 2007, 10:38 PM
#18
try changing this
while(*a!='\0')
{
sendChar(*a);
a++;
}

to

while(*a)
{
sendChar(*a++);
}

and tell me the results..
Sat Sep 08 2007, 06:57 AM
#19
nothing new happened wid your code.
also when i bring adc in circuit...sendChar() method stops responding
.wid adc in the circuit i get nothing . :mad :mad
i have changed every thing adc,max32,controller,crystal,capacitor
but
this is the same circuit and program which were giving me
nice output 2 days ago.but i dont know what happend now.
even im unable to print string :mad :mad
wat shud i do.plz help
Sat Sep 08 2007, 08:41 AM
#20
if you are saying that you have changed the circuit too.. then.. probably the programming mistake.. lets solve it.. paste your program again.. i want to see it..
also the circuit..

Get Social

Information

Powered by e107 Forum System

Conversation

Sat May 15 2021, 11:47 AM
Derek Wolcott
Geometric Energy Corporation announced the dogecoin-funded mission on Sunday, with DOGE-1 representing a 40 kilogram cube satellite flying as a payload on a Falcon 9 rocket.
Thu May 13 2021, 07:18 PM
Rufus
Pretty section of content. I just stumbled upon your weblog and in accession capital to assert that I get actually enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently quickly. https://mkfinstitute.com Trisha Trisha
Wed May 12 2021, 01:23 PM
Jed Roan
Now you can promote your site all over the internet for FREE: http://www3.listofsitesthatacceptfreeads.club
Wed May 12 2021, 08:20 AM
Edgardo
If some one wants to be updated with most recent technologies afterward he must be visit this web page and be up to date every day. annual credit report https://creditscoresetf.com
Wed May 12 2021, 06:11 AM
Laurinda
Great website. A lot of useful information here. I'm sending it to some pals ans also sharing in delicious. And of course, thanks on your effort! annual credit report https://creditscorecheckn.com

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 114, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123