G
Guest
We are porting existing desktop/laptop applications to a Windows CE 4.2 based
platform using VB.NET 2003. Our software interacts via RS232 to in-house
manufactured hardware.
We have established basic comms with our hardware using OpenNetCF serial IO.
We need to send the hardware a startup command, wait 2 seconds for a startup
acknowlegement from the hardware, and if received, send hardware setup
parameters, and wait for 4 seconds for an acknowlegement of those settings,
the user being presented with a dialog box indicating a failure in comms if
either the 2 or 4 second timeout elapses.
I have a form, with timer. On a command button I send the startup character
to the hardware, set the timer.interval to 2000, and enabled to true.
In the oncomm event for the OpenNetCF comm port, when the startup
acknowlegement comes in I disable the timer, send the hardware settings out
the comm port, set the timer.interval to 4000 and enable it again. If the
hardware is set to deliberately NOT give the startup acknowlegement, the
tick event of the timer always fires. However, if it is set to give the
startup, but NOT the settings acknowlegement the second tick event doesn't
fire (after disabling the timer, changing the interval, and re-enabling it)
If I DON'T disable the timer, but still change it's interval, the second
event still does'nt fire.
If I DON'T disable the timer, and DON'T change it's interval the second tick
event DOES fire.
I did set up a second timer which would check the enabled property of the
first timer, and it indicated that the first timer IS enabled after the
second enabling, but still the tick event doesn't fire.
Any suggestions?
platform using VB.NET 2003. Our software interacts via RS232 to in-house
manufactured hardware.
We have established basic comms with our hardware using OpenNetCF serial IO.
We need to send the hardware a startup command, wait 2 seconds for a startup
acknowlegement from the hardware, and if received, send hardware setup
parameters, and wait for 4 seconds for an acknowlegement of those settings,
the user being presented with a dialog box indicating a failure in comms if
either the 2 or 4 second timeout elapses.
I have a form, with timer. On a command button I send the startup character
to the hardware, set the timer.interval to 2000, and enabled to true.
In the oncomm event for the OpenNetCF comm port, when the startup
acknowlegement comes in I disable the timer, send the hardware settings out
the comm port, set the timer.interval to 4000 and enable it again. If the
hardware is set to deliberately NOT give the startup acknowlegement, the
tick event of the timer always fires. However, if it is set to give the
startup, but NOT the settings acknowlegement the second tick event doesn't
fire (after disabling the timer, changing the interval, and re-enabling it)
If I DON'T disable the timer, but still change it's interval, the second
event still does'nt fire.
If I DON'T disable the timer, and DON'T change it's interval the second tick
event DOES fire.
I did set up a second timer which would check the enabled property of the
first timer, and it indicated that the first timer IS enabled after the
second enabling, but still the tick event doesn't fire.
Any suggestions?