M
Marco Trapanese
Hi,
every 250 ms (timer event) I must send several commands via serial
port. The serial unit will answer to each command sent. I must wait the
answer before send the next command.
How can I achieve this? I receive the incoming data in the "data
received" event of the serial port. Furthermore I need to manage a
timeout: if I receive no answer within a specified amount of time an
event will be generated.
Here an example in pseudo-code:
Timer event:
Send command 1
Wait for answer
Send command 2
Wait for answer
Send command 3
Wait for answer... the communication was broken so the timeout event
will be generated
Data_received event:
Store the incoming string into the right variable (selected by the
command sent).
Timeout event:
Message to the user "Communication fault!"
Thank you for any advice
Marco / iw2nzm
every 250 ms (timer event) I must send several commands via serial
port. The serial unit will answer to each command sent. I must wait the
answer before send the next command.
How can I achieve this? I receive the incoming data in the "data
received" event of the serial port. Furthermore I need to manage a
timeout: if I receive no answer within a specified amount of time an
event will be generated.
Here an example in pseudo-code:
Timer event:
Send command 1
Wait for answer
Send command 2
Wait for answer
Send command 3
Wait for answer... the communication was broken so the timeout event
will be generated
Data_received event:
Store the incoming string into the right variable (selected by the
command sent).
Timeout event:
Message to the user "Communication fault!"
Thank you for any advice
Marco / iw2nzm