Access the Alarms & Events Web Service
- Updated2025-11-07
- 3 minute(s) read
Access the Alarms & Events Web Service
The LabVIEW Datalogging and Supervisory Control (DSC) Module includes the built-in LabVIEW Web service, nialarm.
The nialarm web service exposes the Alarms & Events VIs: Read Alarms, Read Events, Acknowledge Alarms, and Alarm Status.
Specifying the URL
You use a URL and HTTP methods to interact with the nialarm 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 and XML tags in post data are case sensitive.
| Description | URL pattern | HTTP method | Input parameters |
|---|---|---|---|
| Queries alarm information. | alarms/<tag_URL> | GET | host=HOSTNAME (localhost)OUTPUT_FORMAT={XML, JSON} (XML) |
| Queries event information. | events/<tag_URL> | GET | host=HOSTNAME (localhost)OUTPUT_FORMAT={XML, JSON} (XML) |
| Queries alarm and event information. | all/<tag_URL> | GET | host=HOSTNAME (localhost)OUTPUT_FORMAT={XML, JSON} (XML) |
| Queries a summary of the alarms associated with shared variables. | alarmstatus/<tag_URL> | GET | host=HOSTNAMEminPriority=MIN_NUM (0)maxPriority=MAX_NUM (1000)showAcked=BOOL(TRUE|FALSE) (FALSE)OUTPUT_FORMAT={XML, JSON} (XML) |
| Acknowledges alarms by shared variable. | alarms/<tag_URL> | POSTPost data:ackUser=ACKUSERcomment=TEXT | host=HOSTNAME (localhost) |
| Acknowledges alarms by alarm. | alarms | POSTPost data:AlarmUrl=ALARMURL*ackUser=ACKUSERcomment=TEXT | None |
| Acknowledges alarms by alarm area. | alarms | POSTPost data:alarmArea=AREATEXT*ackUser=ACKUSERcomment=TEXT | None |
| Acknowledges events by shared variable. | events/<tag_URL> | POSTPost data:N/A | host=HOSTNAME (localhost) |
| Acknowledges alarms and events by shared variable. | all/<tag_URL> | POSTPost data:ackUser=ACKUSERcomment=TEXT | host=HOSTNAME (localhost) |
Specifying the Tag URL
When constructing a URL to interact with the nialarm web service, you can specify the tag URL in one of the following formats:
The following table shows possible example URLs:
| Web method | Example URL | Description |
|---|---|---|
| all | http://localhost:3580/nialarm/all/library1/variable2HTTP method: POSTPost data: ackUser=operator1&comment=test | Invokes the all Web method to acknowledge the alarms and events associated with the shared variable at \\localhost\library1\variable2. This example also specifies that the alarms and events are acknowledged by the user operator1 with a comment test. |
| alarms | http://localhost:3580/nialarm/alarms/library1/variable1?host=remote-computer | From the local computer, invokes the alarms Web method to retrieve all alarms for a variable on a computer named remote-computer. By default, information returns as an XML-formatted response because the URL does not specify the output format. |
| alarmstatus | http://localhost:3580/nialarm/alarmstatus?minPriority=100&maxPriority=1000 | Invokes the alarmstatus Web method to retrieve the summaries of alarms whose priority is between 100 and 1000. By default, information returns as an XML-formatted response because the URL does not specify the output format. |
| alarms | http://localhost:3580/nialarm/alarmsHTTP method: POSTPost data: AlarmUrl=\\server1\library1\variable1.Alarms.HiHi&AlarmUrl=\\server2\library2\variable2.Alarms.Hi&ackUser=operator1 | Invokes the alarms Web method to acknowledge alarms specified by the AlarmUrl tag in the post data. You can specify optional parameters, such as ackUser and comment, by delimiting these parameters with an ampersand (&). You can specify multiple alarms you want to acknowledge by delimiting them with an ampersand. |
| events | http://localhost:3580/nialarm/events/library1/variable1HTTP method: POSTPost data: N/A | Invokes the events Web method to acknowledge the events associated with the shared variable at \\localhost\library1\variable1. |
Configuring Remote Access
You can configure the nialarm web service to query alarms and events that reside on the same computer as the web service or that reside on other computers. By default, the web service can query alarms and events on other computers. To query alarms and events on the same computer as the Web service only, specify RemoteSupport=[FALSE] in the [NI_AlarmEvent_WS] section of the web service configuration file. The web service configuration file is located in the C:\ProgramData\National Instruments\WebServices\NI\nialarm\WebServices.ini directory.