Agent Contexts

This section describes Agent-specific variables, functions and events that are available in context provided by Agent.

Public Variables (Properties)

Date

This variable should be manually declared in an Agent context if Iotellect Server should perform real-time clock synchronization with the Agent. If an Agent declared the Date variable, the server writes it with its current date/time each time a connection between Agent and Iotellect Server is established.

Variable Name:

date

Records:

1

Availability:

Root context

Record Format:

Field Name

Field Description

Field Type

Notes

date

Value of the real-time clock onboard the programmable controller or PC running Agent.

Date


Modtime

This variable contains timestamps for the latest modification time of every "device setting" variable in Agent's device contexts. These modification times are usually stored in EEPROM to assure correct synchronization after restarts.

After each synchronization of device settings between Iotellect Server and Agent, the server updates variable modification times stored in the Agent by setting this variable. When a device setting is modified internally (e.g. using the device's keypad and LCD screen), Agent must properly update its modification time to keep the new values from being overwritten by the old ones, stored in the server cache, during the next synchronization.

In some cases, Agent may not support modification times for some or all device setting variables. The modtime variable should not contain records for such variables. Even if it does, their modification timestamps must be set to NULL.

Variable Name:

date

Records:

0...unlimited

Availability:

Device contexts

Record Format:

Field Name

Field Description

Field Type

Notes

variable

Name of device setting variable.

String


modtime

Date/time of the last modification of this variable's value.

Date

Nullable

Public Functions

[?]

Synchronized

Iotellect Server calls this function to instruct Agent that synchronization is finished and the latter may start sending events.

Function Name:

synchronized

Input Records:

0

Input Format:

None

Output Records:

0

Output Format:

none

Confirm Event

If this function is defined by an Agent, Iotellect Server calls it every time it receives and successfully processes a non-system event.

Function Name:

confirmEvent

Input Records:

1

Input Format:

Name

Type

Description

id

Long

ID of an Agent-generated event that was successfully received, stored and processed by the server

Output Records:

0

Output Format:

None

Acknowledge Event

If this function is defined by an Agent, Iotellect Server calls it every time when an agent-declared event is acknowledged by a system operator.

Function Name:

acknowledgeEvent

Input Records:

1

Input Format:

Name

Type

Description

id

Long

ID of an Agent-generated event that was successfully received, stored and processed by the server

date

Date

Acknowledge date/time.

author

String

Username of acknowledgement author or null if acknowledgement was made by a system component.

acknowledgement

String

Acknowledgement text.

data

Data Table

Event-specific data.

Output Records:

0

Output Format:

None

Get History

If this function is defined by an Agent, Iotellect Server calls it in the beginning of every synchronization. It should return a list of historical values buffered by the Agent when server connection was unavailable. If the function has returned more than zero records, it will be called again, allowing to return historical values in batches of your preferred size.

Values of a specific variable must be reported in chronological order both within a single getHistory() result table and between subsequent getHistory() calls. Failure to do so will cause errors in Iotellect Server statistical channels.

Function Name:

getHistory

Input Records:

0

Input Format:

None

Output Records:

0...unlimited

Output Format:

Name

Type

Description

variable

String

Name of the variable those historical value is represented by the record.

timestamp

Date

Timestamp of the historical value, i.e. date/time when it was received or generated by the Agent itself.

value

DataTable

Historical value of the variable.

Was this page helpful?