NI Labs Toolkits

cancel
Showing results for 
Search instead for 
Did you mean: 

NI cDAQ-9191 Web API Documentation & Examples

Download

NI cDAQ-9191 Firmware Upgrade, Web API Documentation, and Examples

Web API Overview

Using the NI cDAQ-9191 Web API you to wirelessly communicate to a NI cDAQ-9191 using a standard HTTP request from a computer or mobile device.  The Web API allows you to perform three interactions with the NI cDAQ-9191. This functionality is split between two uniform resource identifiers (URIs): a Configuration URI and a Data URI.

  1. Send a GET request to the Configuration URI to receive the current state of the chassis
  2. Send a POST request to the Configuration URI to configure a task and update the firmware
  3. Send a GET request to the Data URI to acquire data from a configured task

The NI cDAQ-9191 Web API uses JSON to communicate its configuration. JSON is a serial object representation format similar to XML. For more information, go to http://www.json.org.

Samples from the device are returned as binary data.

  • Each sample is an IEEE 32-bit floating point number in network byte order. You may need to reorder the bytes depending on your system.
  • Measurements from multiple channels are interleaved, so you must read the first sample from every channel in your task before you receive the second sample.

For complete details about the URIs and JSON format, refer to NI cDAQ-9191 Web API Documentation.pdf included in the NI cDAQ-9191 Web API Documentation and Examples Download.

iOS Examples Overview

These examples demonstrate how to access the NI cDAQ-9191 Web API from an iOS device.

  • The first example allows the user to input a host name and acquires data from ai0 using settings from the source code.
  • The second example adds configurable alarm limits. The example acquires continuous data from ai0 and ai1 until it encounters data outside the limits.
  • The third example adds auto-detection of NI cDAQ-9191 devices on the same subnet. The example also allows the user to configure and run a custom task.

Build Requirements:

  • Xcode 4.x
  • Automatic Reference Counting disabled
  • Membership in the Apple iOS Developer Program

In order to load the examples onto the iPhone/iPad, you must be a member of the Apple iOS Developer Program. However, the apps may be previewed in the Xcode simulator without a membership.

Run-Time Requirements:

  • An NI cDAQ-9191 chassis with an NI 9215 module inserted
  • Updated chassis firmware

Refer to NI cDAQ-9191 Data Display for iOS User Manual for instructions.

  • Local subnet

The chassis must be on the same subnet as your iOS device.

  • The chassis host name or IP address

All the examples require a "Host Name", which is the name you configured for your NI cDAQ-9191. You can also use its IP address in this field. For more information on discovering your NI cDAQ-9191's IP address and name, refer to NI Network Browser.

Feedback & Support

Please use the NI cDAQ-9191 Mobile Device Feedback and Support Discussion Thread to post any questions, comments, bug reports, or other relevant information.

Regards,

Chris Delvizis
National Instruments
Contributors