Funzione che rende lo stato dell'ultima trasmissione fatta sul dispositivo specificato.
|
i32 ser_485_tx_sts (i32 nSer)
|
|
Serial channel number
|
|
Returns the status code. The meaning of the bits that make up the status code is:
|
|
|
0
|
0x00000001
|
485 transmission in progress
|
1
|
0x00000002
|
Transmission finished (sent last character)
|
2
|
0x00000004
|
Successful result - transmission finished and also received last character transmitted
|
3
|
0x00000008
|
Negative result - transmission aborted (cause bit 8)
|
4
|
0x00000010
|
Negative result - aborted transmission, receive timeout
|
5
|
0x00000020
|
Free
|
6
|
0x00000040
|
Free
|
7
|
0x00000080
|
Transmission/reception errors
|
8
|
0x00000100
|
Negative result - serial not in 485 mode (12)
|
9
|
0x00000200
|
Negative result - serial not manageable in 485 mode
|
|
|
Rule, Task
|
|
|
•Generates 9900 ill. Arg A:1 T:x ST:xxx if nSer illegal
•Generate 9901 ill. Funct. T:x ST:xxx if serial is not in 485 mode (see ser_mod) |
Example of use:
function SendCommand()
lungh = str_len(StrTx)
ser_bin_out(NUMBER, StrTx, lungh)
FotoTempo = tfb
loopTx:
if((ser_485_tx_sts(NUMSER) r_and 0x31C))
ErroriTx = (ser_485_tx_sts(NUMSER) r_and 0x318)
return
endif
if((tfb - FotoTempo) > 1.0)
ErroriTx = 0x2000
return
endif
goto loopTx
return
end_fun
|
|