 |
violet Level: Scholar
 Registered: 08-07-2005 Posts: 38
|
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 |
|
|
violet Level: Scholar
 Registered: 08-07-2005 Posts: 38
|
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 |
|
|
violet Level: Scholar
 Registered: 08-07-2005 Posts: 38
|
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 |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
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 |
|
|
violet Level: Scholar
 Registered: 08-07-2005 Posts: 38
|
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 |
|
|
|
|
 |
 |