Questa funzione è usata per definire le modalità di lavoro dei dispositivi seriali.
|
i32 ser_mod (i32 nSer, i32 mod)
|
|
Serial channel number (1, 2, 3, 4)
|
|
Represents the chosen working mode for the serial channel:
|
|
0
|
Robox protocol (DLE BCC) - with handshake (DTR-DSR) if supported by hardware
|
1
|
Pure serial communication - with handshake (DTR-DSR)
|
2
|
DLE-ASCII communication - without interlocks
|
12
|
RS485
|
17
|
Pure serial communication - without handshake
|
18
|
LFASCII communication - without handshake
|
|
|
Returns:
|
|
<> 0
|
The port has been configured correctly
|
0
|
Otherwise
|
|
|
Rule, Task
|
|
From RTE 34.22.01 if the Robox device serial does not have DTR and DSR, their handling is excluded (e.g., on SER2 of RP2)
|
•9900 ill. Arg A:1 T:x ST:xxx if illegal serial number or if the chosen mode is not compatible with the serial channel |
Example of use:
int esito
esito = ser_mod(3, 12)
if(esito)
sr(1) = "configuration performed correctly"
endif
|
|