AggreGate Agent

Top  Previous  Next

The AggreGate Agent is one of the most complex and versatile concepts in the AggreGate universe. In this part of the manual, we will attempt to explain its purpose, function, and importance.

note_glossary-term

The term Agent bears defining. The inspiration for this term comes from the following sense of the word:

Agent: somebody representing another; somebody who officially represents somebody else in business. [Microsoft® Encarta® 2006. © 1993-2005 Microsoft Corporation.]

In this documentation, Agent means one of the following, depending to the context:

1.A special application that intercommunicates with AggreGate Server server using AggreGate communication protocol. This application converts data collected from hardware into AggreGate format and/or converts third-party communication protocols into AggreGate protocol. It can be implemented in virtually any programming language, while Tibbo provides reference implementations in Tibbo BASIC, Java, .NET, and embedded C/C++.
2.An external hardware device (programmable controller or computer) that runs a Agent application.

Agent And Dedicated Device Drivers

The AggreGate Server can communicate with a device in one of two principal ways:

1.Via a dedicated Device Driver: Using this method, the AggreGate Server communicates with a Device via its native communication protocol. The driver allows the AggreGate Server to correctly parse and 'understand' the data from this specific device, and thus make it accessible via the various AggreGate Server facilities (events, reports, context trees, etc.). This driver is a Java software component running on the server side. The drivers are 'one-off' -- meaning, to connect a different device to AggreGate Server using this method, you would need a different driver which 'understands' the protocol used by the new device. Writing such a driver requires extensive familiarity with AggreGate Server internals and Java programming.
2.Via an Agent: The Agent is a separate hardware device (controller, module, or PC) running a special-purpose application. This hardware/software combination acts as a mediator between the actual hardware device (connected to Agent using serial, Wi-Fi, GPRS or other link) and the AggreGate Server. Connection between AggreGate Server and Agent is established over IP network.

note_further-wt

Agent application may be also integrated into device design and executed by the device's main CPU. Alternatively, a communication coprocessor running Agent application may interact with the main CPU responsible for device "business logic" via SPI interface.

Let's discuss this second modus operandi a bit further:

When using an Agent, data conversion is done in hardware. The device running the Agent application receives a stream of data from the hardware device using the device's own native protocol. It then converts this stream into a AggreGate Server generic protocol, and sends it to the AggreGate Server. When receiving instructions from the AggreGate Server, the Agent converts them back into the device-specific protocol and sends them to the device. In effect, the Agent application is composed of two primary parts:

1.Device-Specific side: This part of the code is written specifically for the particular hardware device connected to the Agent hardware platform. This is the only part which has to be modified to make AggreGate work with any new hardware device.
2.Network side: This part of the code handles all AggreGate Server communications. This is a generic part. In effect, it communicates with AggreGate Server using the AggreGate Communications Protocol. This part never has to be changed to make AggreGate work with a new device.

You may think of the AggreGate as a hardware-based driver or protocol converter. If you have a hardware device you wish to plug into AggreGate so it would exploit all of the power and benefits of the system, all you have to do is just include an open-source Agent library to your firmware/software, and voila - you've got complete AggreGate connectivity for your device!

Agent application provides AggreGate operators several methods to control, monitor and configure hardware devices connected to it:

It exposes the internal settings of your device to AggreGate Server, so that settings such as Number of Records to Keep (for a time clock) or Maximum Permitted Speed (for a forklift) will be seamlessly displayed and edited in any AggreGate Server User Interface (such as AggreGate Client).
It allows to execute different operations with the device, such as Perform Self Test or Send Message To Device LCD. Operators may specify input parameters for every operation and view their execution results.
It helps to monitor events generated by a device, such as User has entered the area or User has exited the area for the Access Control Terminal. AggreGate Server stores all device events persistently and provides access to their history for system operators.

In addition, one Agent hardware platform can be connected to several different devices. For example, you could use a 4-port DS1000 Programmable Controller manufactured by Tibbo as your hardware platform, and connect it to 4 serial devices (time clocks, for example). Your Agent application will allow access to each of these time clocks as if it were individually connected to the network.

Agent Device Driver

Agent has a counterpart on AggreGate Server -- Device Driver called Agent Driver. This driver is responsible for all communications between AggreGate Server and Agent.

Using Agent As a Core Hardware Component

Since Tibbo provides full portfolio of powerful programmable modules and controllers along with the free IDE, another option would be to build your system around a Tibbo processor running the Agent application. In such a case, you could hook the peripheral components of your system (LCD, keypad, etc.) directly to the Tibbo processor and use it as the main CPU for your system. You would then code your device logic in Tibbo BASIC, as part of the Agent application. This would provide your new device with native AggreGate functionality.

Customizing Agent For Your Devices

The Agent application may be customized to connect any existing or newly created device to AggreGate. You just have to include Agent library into your software/firmware and provide:

Definitions for device settings, operations and events,
Code that implements reading and writing device settings,
Code for forwarding operation requests to devices,
Code for polling the device for events or receiving events asynchronously and sending them to the server.

Agent SDK

For information about implementing Agent as a part of a PC-based application based on Java or .NET technology, see Agent SDK section.