PICS Real Time Data Base Agent (rtdba)

This program is the central distribution point for all PICS real time data. RTDBA distributes real time data throughout the PICS LAN. In a standard PICS installation (with failover support enabled) there is a master and slave copy of RTDBA running. Both master and slave receive all of the incoming real time data, but only the master transmits the changes out to the remainder of PICS. This means that within a few minutes of booting, the backup should have all of the same values as the primary -- any any unknown values will not be reported until they are known, further reducing the possibility of software artifacts in the data stream.

Internally, RTDBA allocates a block of memory large enough to hold MAXPID (the largest PICS point ID defined) real time data records (plus some subscription support data). The memory block is indexed by the PICS Point ID to provide fast access. Linked lists of local (within the same machine) subscribers to each point are associated with each real time record. When a new record comes in, RTDBA checks the linked list to see if any local programs require a copy of it.

In order to reduce network traffic, RTDBA uses UDP/IP broadcasts, rather than TCP/IP connections, to transmit data. As new data records are received, they are collected into blocks for network transmission. When a block is full (or no new data arrives for 1/4 sec) the block is transmitted.

RTDBA receives data both through EVI's IPCAPI (InterProcess Communication Application Programming Interface) and UDP/IP blocks from remote subsystems. Data received through the IPCAPI is only transmitted out from the primary node via UDP. Data received through the UDP socket (including data sent by the node itself) is only delivered to local subscribers.

Because of its use of UDP/IP, RTDBA is generally not affected by other subsystems on the network, except as follows:

  1. A 'rogue' RTDBA node could (conceivably) go into continuous transmit, flooding RTDBA with data packets. This could cause problems on the subsystem where RTDBA is executing.
  2. A broken NIC anywhere on the PICS LAN could flood the network with traffic, causing RTDBA to be unable to transmit/receive network data. This is a problem for all networks (an intelligent hub device can help reduce this risk).

Other than those listed above, RTDBA should not be directly affected by other subsystems in any way.

Command Line

Parameter Description
LogFile Only defined for the debug version of RTDBA, this activates a log file that will contain useful debugging information for the developer.
Force Primary These two word options force RTDBA into the specified state, as if the local Task Monitor has directed it. These exist for testing purposes and should never be used in a production system.
Force Backup
Force Peer
Force Standby
NoWatch Prevents the "Data not available" message from appearing.
Watch Causes RTDBA to enable the data watchdog function immediately rather than waiting for the TaskMonitor to indicate the node is completely loaded. This is useful in test situations when TaskMon may not be available.
Force Time Causes RTDBA to treat any PICS Time value as if it came from the master section (even if it comes from some other section). This effectively prevents the watchdog from showing except when all available PICS Time sources are unavailable.
SetClock Allows RTDBA to update the local system clock once per hour (to keep the local computer's time reasonably close to PICS time)
NoClock Prevents RTDBA from updating the local system clock each hour.

Configuration (INI) File

RTDBA also allows the command line settings (and more) to be maintained in an INI file, named "rtdba.ini" and stored in the standard PICS configuration folder. When a setting is found in both the INI file and on the command line, the command line setting will be used. This allows temporary overrides of the saved INI settings.

[Log] Section

Parameter Default Description
Log Path none Location where log files are to be saved. Typically, this will be %pics%log\ which is automatically translated to the log folder under the PICS root folder.
Logs to Keep none Sets the number of old log files to be maintained.
Log Limit Type none Sets the rule for when a new log is to be opened. The format for this setting is number,type where type specifies the unit of measure and number specifies the amount. The type may be one of: days, months, lines, or bytes.
Log Name none Sets the base name for the log files.

Log files are automatically cycled when the limit is exceeded by the most recently logged entry . This means that when using bytes or lines as a limit, it is possible that the actual log may contain a bit more than the exact limit because a single log entry may be up to 1024 bytes and may include more than one line of text. When log files are cycled, their names are adjusted such that the current log is always "logname.log", the next oldest log is "logname_1.log", the next oldest is "logname_2.log" and so on up to the limit set by the logs to keep setting. Be aware, though, that RTDBA logs almost nothing except for real time data loss/restore and fatal errors (which are also written to the Windows Application event log).

[Settings] Section

Parameter Default Description
INI Overrides Command Line 0 When non-zero, this causes the INI file to take precedence over the command line instead of the normal behavior.
Source Timing 0 When zero, this causes RTDBA to replace the PICS time attached to data points with the current PICS Time value when the points are received. When non-zero, RTDBA leaves the point scan (or compute) time unchanged.
Force State no When primary, backup, peer, or standby, this forces RTDBA into the specified state, as if the local Task Monitor has directed it. This exists for testing purposes and should never be used in a production system.
System Clock noclock When setclock, this allows RTDBA to adjust the local clock each hour so that it matches the current PICS time.
Watchdog default When enable, this enables RTDBA's data watchdog dialog. When disable, this prevents RTDBA from displaying the data watchdog dialog. When default, this enables the watchdog (as of version 1.0b18).
Watchdog ms 30000 Sets the amount of time that RTDBA will wait (when the time point from the master or local section was last received) before displaying the data lost watchdog (and reporting that status to Task Monitor).