1.2. Data Flow

In a typical Cogent modular software system, data flows via the Cascade DataHub. Any C or Gamma program can write values to the datahub, and register to automatically receive data in the datahub, in real time.

Data creation and distribution:  The data in the demo is created by the PID Emulator (emul.g). This is a program written in Gamma that emulates a PID loop, generating data similar to what a control system might receive from one or more input drivers. The data is passed to the Cascade DataHub, which distributes the data to the other programs. The data flows via Cogent interprocess communication (IPC), supported by the Cascade QueueServer and the Cascade NameServer (qserve and nserve), two Cogent API programs that run behind the scenes.

Monitoring the data: You can view the data and change some of the PID Emulator settings with the Monitor (gtkmonitor.g or phmonitor.g), a GUI program written in Gamma. The Monitor displays the PID Emulator data in real time, as received from the Cascade DataHub, and sends changes to PID Emulator settings via the Cascade DataHub. Data from the PID Emulator can also be viewed with the DataHub Viewer (dhview). This Cogent utility provides a display of all data points in the Cascade DataHub, as well as a means to manually change data point values.

Data logs and histories: Logs and histories of data from the PID Emulator can be generated using the Cascade TextLogger and the Cascade Historian, which get the data from the Cascade DataHub. In this demo, you can interact with them using the Gamma GUI programs Log (gtklog.g or phlog.g) and History ( gtkhistory.g or phhistory.g).

Data into Windows: PID Emulator data can also be monitored and controlled from Excel or any other DDE-enabled Windows application. It requires a mirroring connection over TCP/IP to a Cascade DataHub running in Windows. The details for doing this are not included in this tutorial, but you can refer to the Cascade DataHub for Linux and QNX and Cascade DataHub for Windows manuals for more information.