I think the last-error pin just reflects the last error,
It should not affect communications. The fault pin gives
the current communication status. A fault count pin
might be a nice addition.
With my test setup I start with an error code of 0 but
if I interrupt communications, the fault pin is asserted
the last error pin changes to 11 ("com timeout")
if i re-establish communications, the last error remains
11 but the fault clears, and communications are re-established
Do you have bias resistors on the 7I96S serial port?
These are needed for RS-485 communications to set
the undriven line state to idle:
1 GND
2 RX+,TX+ 330 Ohm pulldown to GND (1)
3 RX-,TX-
4 RX+,TX+
5 RX-,TX1- 330 Ohm pullup to 5V (6)
6 +5V
Also you should use the 7i96s_pktv2 firmware
as it has an improved PktUART with better error resistance
and more accurate low baud rates.
EDIT: I have found by torture testing (power cycling the modbus remote while running)
I can generate a unrecoverable (stack smash) error. I believe this is because when power cycling
many bogus RX characters can be generated and the number of RX characters exceeds the max
character limit in the .mod file
I have been able to work around this by setting the max character limit to the maximum (251)
but it should probably be fixed in the driver by truncating at the limit or some other validation method.