Hello,
I use the hardware Usart to send and receive data trough RS485
dim as Ori byte , Rx_coman as byte , Quant_bytes as byte , Rx_end as byte, Temp_nr as word , pl_nr as word
dim yptas byte , Word_dbg as word , R_done as byte , Rx_dad(16) as byte , Master as byte
_a:
If Ischarwaiting(#1) <> 0 Then
Inputbin #1 , Serialchar 'get the byte
If Serialchar <> Master Then Goto localation2 'is the first byte not 254 continue to other location
Inputbin #1 , Ori , Rx_coman , Quant_bytes , Rx_end , Temp_nr , ypt , Word_dbg , R_done , Rx_dad(1) , Quant_bytes
If Temp_nr <> pl_nr Or R_done <> 125 Then 'test if part of the received data are correct or not
R_done = 0 : Rx_dados(1) = 0
Clear Serialin
Reset Watchdog
End If
End if
location2:
Note that the INPUTBIN statement doesn't wait for a <RETURN> but just for the number of bytes. Help from Bascom!!!!
What happend here if all the expected data not received correct "noise", wait the Inputbin forever?
If yes, exists a way to implement a Timeout?
Best regards
toto
[b:d444046f59][color=red:d444046f59](BASCOM-AVR version : 2.0.7.2 , Latest : 2.0.7.6 )[/b:d444046f59][/color:d444046f59]
↧