borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (releasing an adodc)Next Topic (Fonts) New Topic New Poll Post Reply
AndreaVB Forum : VB General : timer
Poster Message
violet
Level: Scholar

Registered: 08-07-2005
Posts: 38

icon timer



hi all

     i hav a timer in one form which will do som operation.. other than that i need some operation to be done continuesly in the application.... so i kept another timer in mdiform

here i hav problem that is it affect the child form timer to get the values once in 500 millisec in timer...from serial port.


kindly help me in this regard...

17-03-2006 at 08:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 530
icon Re: timer

it is not clear what you're trying to do...but if every 500 millisecond you dialog with a serial interface it should not take more than 500 milliseconds to complete or another timer event will raise and there will be no more idle time for the other events to execute...

let us know more details about your problem maybe with some pieces of code

____________________________
AndreaVB

17-03-2006 at 09:27 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
violet
Level: Scholar

Registered: 08-07-2005
Posts: 38
icon Re: timer


hi

Hi friends,

I am in a fix with Timer control in vb.

Let me explain my project in few words .

It is a project realted with the Serial port.

By getting voltage value from the serial port and it is displayed in graph . simlary for current temperature etc.. i get from serila port

a  timer has been placed with 500 milliseconds,in a child form.

Comparitive checking with user set value, on the serial port power level will be done by this timer.


Suppose the power value exceeds the user set value, the connected equipment should be  switch off .

so i put the timer in mdiform. it will continously check the power values.

Now my problem is,

when i placed the timer in mdi form ......the child form now not getting updated, it shows the voltage constantly when it loads..
if i comment the code in mdifrm it works fine ....

if the in hardware voltage changes means it shd updated in graph also but it does not give the current voltage value it stays wat it was when the form loads.

how to use timer in mdiform without affecting the child form timer in 500 milliseconds


help pls

advance thanks

violet

18-03-2006 at 05:15 AM
View Profile Send Email to User Show All Posts | Quote Reply
violet
Level: Scholar

Registered: 08-07-2005
Posts: 38
icon Re: timer


hi all

i found tha no mistake in timer...

its problem of sending output to serial port...

all are working but when i try to send the output to serial port its not updating ......

before that i send acknowledgemetn to receive and send....

pls tell me how to send output to serial port...

my code is
form1 code.....

dim buffer as string
mscomm1.output=buffer


form2 code....

private sub timer_timer()

codes here.....

buffer = hex(value)
endsub

advance thanks


[Edited by violet on 18-03-2006 at 07:54 AM GMT]

18-03-2006 at 06:49 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: timer

How did you set the mscomm control? You need to set things like communications port number, baud rate, parity, data bits, stop bits.... You also need to open the port when transmitting data. If you dont know how to do this things, you can read about mscomm ontrol from MS:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/comm98/html/vbobjcomm.asp

If you still have some troubles, post here again.

____________________________
If you find the answer helpful, please mark this topic as solved.

20-03-2006 at 01:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
violet
Level: Scholar

Registered: 08-07-2005
Posts: 38
icon Re: timer


hi

i set all the properties...think hav som bug in it..

i attacehd the code


violet

____________________________
Attached:
code.zip 1 KB (Downloads: 3)

20-03-2006 at 06:12 AM
View Profile Send Email to User Show All Posts | Quote Reply
violet
Level: Scholar

Registered: 08-07-2005
Posts: 38
icon Re: timer

Hi all

i hav a serious problem in timer.. where iam getting input through serial port after processing i am trying to send the output to serial port..


for that i hav one timer.. where intrevel i set as 1000 and once i get input i process again i sent that output through serial port this is what iam doing in that timer..

so here i am having the problem for first time it gets input and after i send output .....again the timer cant gets the input.. i am using mscomm control for receiving the input...

i am not clear whether i can send and receive the data at same time in timer to serial port

pls help me

violet

22-03-2006 at 06:35 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : timer
Previous Topic (releasing an adodc)Next Topic (Fonts) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder