Hi all,
i don't know if i can ask in english, though it is a german forum
I have a device connected to the serial port of my PC. I use the
serialPort component in order to communicate with the device. I have to
send 2 different strings of data to the serial port but the trick is
that after sending the first string of data I have
to wait for the serial port to respond. Then I have to check the
response and decide whether I must send the second string or not. Also
after sending the second string, I have to check also the response of
the serial port.
I tried to use an arbitrary amount of wait time between the sending of the two strings. Something like
SerialPort.Write(...) ; Thread.Sleep(2000); SerialPort.Write(...);
But the software failed when I tried it in a slower PC. So is there a
way to replace the Thread.Sleep(2000) with a command that will wait
until the serial port complete its response?
Regards
aTsiri
i don't know if i can ask in english, though it is a german forum
I have a device connected to the serial port of my PC. I use the
serialPort component in order to communicate with the device. I have to
send 2 different strings of data to the serial port but the trick is
that after sending the first string of data I have
to wait for the serial port to respond. Then I have to check the
response and decide whether I must send the second string or not. Also
after sending the second string, I have to check also the response of
the serial port.
I tried to use an arbitrary amount of wait time between the sending of the two strings. Something like
SerialPort.Write(...) ; Thread.Sleep(2000); SerialPort.Write(...);
But the software failed when I tried it in a slower PC. So is there a
way to replace the Thread.Sleep(2000) with a command that will wait
until the serial port complete its response?
Regards
aTsiri