M
Mike
Greetings,
We have a circumstance where we have a series of individual buttons,
whose functionality works. This consists of sending a message to an
RS-232 port, and awaiting a reply asynchronously.
When a button is clicked, the message is sent, and we await bytes that
are received via a delegated event. This all works as expected when we
click the buttons individually.
Now we have a circumstance where we would like to organize a sequence
of these commands, timed according to a threaded timer. During the
timer callback, we'll BeginInvoke() and subsequently call each of the
button event handlers one after the other.
The protocol has a built-in timeout feature, also a timer callback,
which effectively terminates the attempted receipt of response.
Incidentally, this may be important as well, our "protocol" of sent and
received data is such that we await the response received from one sent
message and set an AutoResetEvent when it is fully received.
As it relates to the callback, we start with the first call, we have
verified we first sent the message, and then (by what we think is how
the design ought to work) we should await an asynchronous response from
the RS-232 port.
This does not seem to be happening, so we're wondering whether there is
some sort of a timer or threading issue blocking us from actually
receiving this response. We are fairly certain that we are also
changing the timeout timer, which we are also not seeing any evidence
of.
This is very tricky because it is timers, threads, and synchronizing
this sequence of events. So we're hopeful that someone can offer some
of their insights in these areas.
Best regards,
Michael Powell
We have a circumstance where we have a series of individual buttons,
whose functionality works. This consists of sending a message to an
RS-232 port, and awaiting a reply asynchronously.
When a button is clicked, the message is sent, and we await bytes that
are received via a delegated event. This all works as expected when we
click the buttons individually.
Now we have a circumstance where we would like to organize a sequence
of these commands, timed according to a threaded timer. During the
timer callback, we'll BeginInvoke() and subsequently call each of the
button event handlers one after the other.
The protocol has a built-in timeout feature, also a timer callback,
which effectively terminates the attempted receipt of response.
Incidentally, this may be important as well, our "protocol" of sent and
received data is such that we await the response received from one sent
message and set an AutoResetEvent when it is fully received.
As it relates to the callback, we start with the first call, we have
verified we first sent the message, and then (by what we think is how
the design ought to work) we should await an asynchronous response from
the RS-232 port.
This does not seem to be happening, so we're wondering whether there is
some sort of a timer or threading issue blocking us from actually
receiving this response. We are fairly certain that we are also
changing the timeout timer, which we are also not seeing any evidence
of.
This is very tricky because it is timers, threads, and synchronizing
this sequence of events. So we're hopeful that someone can offer some
of their insights in these areas.
Best regards,
Michael Powell