Define the Maximum Number of Consecutive Failed Reads and Writes
You can use the Server Configuration Tool’s Channel settings to define the Maximum Number of Consecutive Failed Reads and the Maximum Number of Failed Writes. These settings provide a limit for consecutive failures of read and write operations, that when reached, will allow Geo SCADA Expert to regard a serial channel as having failed.
The Maximum Number of Consecutive Failed Reads and Maximum Number of Consecutive Failed Writes settings only apply to channels that are configured to have a connection type of Serial.
A failed read or failed write operation can occur as a result of:
- Hardware failure (applies to both serial (COM) ports and network attached serial ports such as DeviceMaster).
- Network fault (applies to network attached serial ports only).
Each channel is associated with a port. If there is a hardware error or network problem relating to the connection via the port, the operating system generates an error. Geo SCADA Expert uses these errors to maintain an internal consecutive fail count, and if the maximum limit for the count is reached, the channel associated with the port is deemed to have failed.
There are two consecutive fail counts, one for read operations and one for write operations. The read consecutive fail count increments when there is an error in response to a read request from Geo SCADA Expert, and the write consecutive fail count increments when there is an error in response to a write transmission from Geo SCADA Expert. Both fail counts have a maximum limit (the Maximum Number of Consecutive Failed Reads and the Maximum Number of Failed Writes settings, respectively).
Once a consecutive fail count has started, Geo SCADA Expert will continue to use the channel. For every failed consecutive attempt, the consecutive fail count increases by 1. If there is a good response (i.e. a non-error response), the count is reset to 0 and normal operations are resumed. However, if Geo SCADA Expert’s further attempts to use the port result in failures, and the maximum consecutive failure limit is reached (it is 10 by default), Geo SCADA Expert will deem the channel as failed and will de-assign from the port.
Geo SCADA Expert will then attempt to re-assign to the port after the re-establishment delay (30 seconds by default). Usually, if the hardware or network fault is transient, the delay before re-assigning the port is sufficient time for the hardware or network to recover. Upon being reassigned, normal communications can continue. But if the fault is not transient, the re-assign will also fail and the channel will remain as failed.
So, when you come to set the Maximum Number of Consecutive Failed Reads and Maximum Number of Failed Writes, you need to consider what local server hardware (including network attached serial ports) is being used. The default settings for both limits are 10, which means that it takes 10 consecutive read failures or 10 consecutive write failures for Geo SCADA Expert to deem a channel as having failed.
Using your knowledge of your system, you need to judge whether the maximum number of consecutive failed reads and maximum number of failed writes are set so that there is an appropriate delay between a fault being detected and the channel being failed
In many cases, the default limits of 10 are appropriate. However, if you require channel failures to be reported more quickly, you may choose to reduce the limit. It is unlikely that you would ever need to increase the limits above the default amount as 10 consecutive hardware/network failures would usually indicate a genuine, persistent fault rather than an intermittent problem.
To change the Maximum Number of Consecutive Failed Reads or Maximum Number of Consecutive Failed Writes so that Geo SCADA Expert is more/less tolerant of consecutive read/write failures:
- Access the Geo SCADA Expert Server Configuration Tool (see Accessing the Geo SCADA Expert Server Configuration Tool).
- Expand the Global Parameters branch of the tree structure.
- Select Channels to display the Channels section.
- Use the Maximum number of consecutive failed reads spin-box to define how many consecutive failed attempts can be made by a driver to read data from a COM port. If the defined number is reached, the channel is deemed to have failed.
A read failure occurs if a driver is unable to read data from the COM port (the operating system reports an error).
If you have a COM port that fails intermittently, a Maximum number of consecutive failed reads setting that is too low may cause the driver to restart the channel unnecessarily.
If you raise the Maximum number of consecutive failed reads setting too high, the driver will take longer to recognize a COM port as having failed.
In many cases, the default setting of 10 is appropriate.
To monitor a channel for read failures, enable the IO logging category on the driver and use the driver log file to view the failures (see Display a Driver Log File).
- Use the Maximum number of consecutive failed writes spin-box to define how many consecutive failed attempts the driver can make to transmit data (write) via the COM port. If the number of consecutive failed writes reaches the defined amount, the channel is deemed to have failed. A write attempt can fail if the operating system reports an error when data is being written to a COM port.
If you have a COM port that fails intermittently, a Maximum number of consecutive failed writes setting that is too low may cause the driver to restart the channel unnecessarily.
If you raise the Maximum number of consecutive failed writes setting is too high, the driver will take longer than necessary to recognize a COM port as having failed.
In many cases, the default setting of 10 is appropriate.
- Right-click on the system icon in the tree-structure, and select the Apply Changes option to apply the changes.