Accessing the Citadel Web Service (DSC Module)

LabVIEW 2017 Datalogging and Supervisory Control Module Help

Edition Date: March 2017

Part Number: 371618K-01

»View Product Info
Download Help (Windows Only)

The LabVIEW Datalogging and Supervisory Control (DSC) Module includes the built-in LabVIEW Web service, nicitadel. The nicitadel Web service exposes the following Historical VIs and Tags VI.

Specifying the URL

You use a URL and HTTP methods to interact with the nicitadel Web service. Refer to the following table to specify the URL pattern, which consists of the Web method and tag URL, and input parameters of the URL. Input parameters are case sensitive.

Note  The default value of an input parameter appears in parentheses.
Description URL pattern HTTP method Input parameters
Queries a list of computers on the local network. computerlist GET OUTPUT_FORMAT={XML, JSON} (XML)
Queries a list of databases on the computer you specify in <computer>. databaselist/<computer> GET OUTPUT_FORMAT={XML, JSON} (XML)
Queries a list of traces. tracelist GET dbpath=DB_SERVER/DB_PATH (localhost/Default_Database)

OUTPUT_FORMAT={XML, JSON} (XML)
Queries trace information. info/<tag_URL> GET dbpath=DB_SERVER/DB_PATH (localhost/Default_Database)

OUTPUT_FORMAT={XML, JSON} (XML)
Queries trace data. trace/<tag_URL> GET start=TIMESTAMP (Timestamp of the first data point)

end=TIMESTAMP (Timestamp of the last data point)

dbpath=DB_SERVER/DB_PATH (localhost/Default_Database)

maxItems=INTEGER (–1)

decimate=BOOLEAN (FALSE)

OUTPUT_FORMAT={XML, JSON} (XML)
Queries historical alarms. alarms/<tag_URL> GET start=TIMESTAMP (Timestamp of the first alarm)

end=TIMESTAMP (Timestamp of the last alarm)

dbpath=DB_SERVER/DB_PATH (localhost/Default_Database)

OUTPUT_FORMAT={XML, JSON} (XML)

Specifying the Tag URL

You must specify the <tag_URL> as an absolute path in the following format: computer/library/variable. For example, when you invoke the info or trace Web methods, you must specify the variable name in the <tag_URL>.

When invoking the alarms Web method, you can define <tag_URL> as computer/library, computer, or unspecified. If you do not specify the <tag_URL>, the alarms Web method queries the historical alarms under the localhost and the default database.

Specifying the Input Parameters

When you specify an input parameter, use the following table to understand the values that the input parameter can accept.

Input parameter Input parameter value Description Example
dbpath DB_SERVER/DB_PATH Specifies the database path. DB_SERVER and DB_PATH are strings. The forward slash (/) is required. dbpath=computer1/mydatabase
start

end
TIMESTAMP Specifies the timestamp. The format must be YYYY-MM-DDThh:mm:ss(+/-)time-offset, where T is a delimiter separating the date and time and time-offset is the hours and minutes ahead or behind UTC time. start=2010-12-31T00:30:57+08:00
maxItems INTEGER Specifies an integer. The default is –1, which means the trace Web method queries the maximum number of traces. Possible values are –1, 0, 1, 2,... If the value is greater than 2,147,483,647, the Web method queries only a maximum of 2,147,483,647 traces. maxItems=1000
decimate BOOLEAN Specifies a Boolean. Possible values are TRUE and FALSE. decimate=TRUE

Example URLs for Accessing the Citadel Web Service

The following table shows possible example URLs:

Web method Example URL Description
computerlist http://localhost:3580/nicitadel/computerlist?OUTPUT_FORMAT=JSON Invokes the computerlist Web method to retrieve computers on the local network. Information returns as a JSON-formatted response.
databaselist http://localhost:3580/nicitadel/databaselist/computer1?OUTPUT_FORMAT=JSON Invoke the databaselist Web method to retrieve the list of databases on the computer computer1.
trace http://localhost:3580/nicitadel/trace/computer1/library1/variable1?OUTPUT_FORMAT=JSON&dbpath=computer1/Default_Database Invokes the trace Web method to retrieve the trace data of the trace URL computer1/library1/variable1 and database path computer1/Default_Database.
alarms http://localhost:3580/nicitadel/alarms/computer1/library1?dbpath=computer1/C__Program_Files_National_Instruments_LabVIEW_2010_data Invokes the alarms Web method to retrieve the historical alarms of the trace URL computer1/library1/variable1 and database path computer1/C__Program_Files_National_Instruments_LabVIEW_2010_data. By default, information returns as an XML-formatted response because the URL does not specify the output format.

Refer to the Citadel Web Service Client Demo.lvproj in the labview\examples\lvdsc\Data and Alarm Historical Logging\Citadel Web Services Client Demo directory for an example that demonstrates how to interact with the nicitadel Web service.

WAS THIS ARTICLE HELPFUL?

Not Helpful