Getting Started

Overview

This chapter is a guide for new users of the dataTaker DT8x Driver for LabVIEW. There are a number of examples within this chapter, which step you through creating applications with the driver.

Within each palette of the driver, there is an examples sub-palette demonstrating the use of the VIs within the selected palette.

Once installed, the driver is contained in the user libraries sub-palette. This is selected by first choosing the functions palette, in the block diagram, and following the selection
Functions>>User Libraries>>dataTaker DT8x Driver.

    top level palette

The driver VIs can be classified into two main areas. The way you choose to communicate to the dataTaker data logger and the way data is managed on the data logger.

Communication with a DT80 data logger

The dataTaker DT8x Driver communicates to the DT80's command interface, over a serial link or over a TCIP/IP network.
This can be via:

  • a direct connection to the USB port
  • a direct RS232 connection to the host RS232 or serial sensor port, using a crossover ("null modem") cable
  • a fixed or dial-up modem, which is connected to the RS232 port
  • a TCP/IP network, which is connected to the Ethernet port
  • a point-to-point TCP/IP connection, using PPP. This may use the USB, host RS232 (with or without modem) or serial sensor port.

The most common methods used are:

  1. USB

    When connecting to the DT80 through USB, it is necessary that you install the dataTaker DtUsb driver software.
    This can be downloaded from the dataTaker website, www.datataker.com

    When a DT80 is connected via USB, DtUsb will:

    • establish a PPP connection to the logger over the USB link (PPP is a protocol that allows TCP/IP traffic to be passed over a point-to-point serial link)
    • provide a local IP address, typically 127.1.1.1, which effectively becomes the DT80's IP address.
    • display the purple icon in the task bar, which will remain visible whilst the logger is connected
    • optionally, automatically launch your default web browser and display the dEX home page

    You can connect to the DT80 using USB Direct Serial Mode. To do this you will need to close down DtUsb, which will allow communications in direct serial mode. DtUsb must still be installed (but not running) in order to to use the USB port in direct serial mode

    Further information on how to do this is contained in the USB Port section of the DT8x Users Manual

  2. Ethernet

    Using a "cross-over" ethernet cable you can directly connect the DT80 to a single host computer.
    Or connect the DT80 to a spare port on an Ethernet hub, bridge or router, using a standard "straight through" cable.

    Automatic IP address
    When the Ethernet cable is connected, the DT80 will begin searching for a DHCP server. When connected directly to a PC, there will normally be no DHCP server available, so after 10 seconds or so the DT80 will give up and assign itself an "Auto-IP" address. Use the IP address that appears on the DT80 Ethernet IP screen in the TCP/IP VIs.

    Static IP address
    When connecting the DT80 to an existing Ethernet network using a static IP address, you need to be a little more careful. Setting the DT80 to an inappropriate IP address can severely disrupt the operation of the network.

    It is recommended you ask your network administrator what to set the DT80's IP address, subnet mask and gateway to. You can connect to the DT80 via USB, and set the IP settings using a terminal package such as DeTransfer.

    Further information on how to do this is contained in the Setting Ethernet Parameters section of the DT8x Users Manual

  3. Serial using RS-232

    To communicate via serial, there needs to be a direct serial cable link between the data logger, and the computer.

  4. Modem

    When communicating to a data logger with a modem, the modem and the data logger will need to be configured correctly to ensure reliable communications. Please refer to the modem section of the relevant users manual.

    Using a DT80 you can communicate through the Host RS-232 port to a modem, or through the Ethernet port using a "modem-gateway" device such as a wireless (GPRS/3G) modem.

    For further information on communicating through the Host RS-232 port refer to the Modem (Remote) RS232 Connection section of the DT8x Users Manual

    For communicating through the Ethernet port refer to the Connecting to the DT80 Ethernet Port section of the DT8x Users Manual

    With the DT80 range, there is an additional option of an integrated modem (the DT8xM models).
    Further information on the DT8xM range is contained in the Integrated Modem section of the DT8x Users Manual

Data management within a DT80 data logger

The driver is designed to be used with real-time or historical acquisition VIs.

  • The Realtime acquisition VIs are designed to send the program to the data logger and read the data returned. Please note that logging is not enabled with the realtime VIs, so data is not stored locally on the dataTaker. Logging can be enabled using
    DT8x SetStorageMode.vi
    For people familiar with the dataTaker language, logging is disabled (LOGOFF), and the real-time data return switch (/R) is on.

  • The Historical acquisition VIs are designed to send a program to the data logger, store the data on the data logger, and unload the data periodically.
    For people familiar with the dataTaker language, logging is enabled (LOGON), and the real-time data return switch (/r) is off.

Using the dataTaker High Level (dt hl) VIs

The High Level VIs are designed as single VI solutions. So a single VI from the driver will allow you to write a simple application.
They are organised according to the type of connection with the dataTaker.

Example 1: how to read a temperature

A common sensor to use with a dataTaker data logger is a type K thermocouple. We will use this to read a temperature.
This example uses the VI, DT8x SampleChannelThruTCPIP.vi to read a temperature.

  1. Connect to the DT80DT80, or using the DtUsb software communicating over USB.

  2. Wire the thermocouple into channel 1, with the yellow wire (positive, Nickel-Chromium) in the positive terminal (+), and the red wire (negative, Nickel-Aluminium) in the negative terminal (-). This is assuming the type K thermocouple follows the N.I.S.T. standard.

    type K thermocouple
  3. Create a new VI, go to the DT8x High Level Serial Palette.

    high level serial palette

    Choose the VI, DT8x SampleChannelThruTCPIP.vi

  4. From the block diagram, create the controls and indicators for the VI, by using the wiring tool, right-clicking on the terminals of the VI, and choosing Create>>Control, or Create>>Indicator, for the relevant terminals. You do not need to create a control for the "error in" terminal.

  5. Place the Simple Error Handler.vi on the block diagram, from the Functions>>Time & Dialog palette, and wire the error cluster to the VI.
    This maybe also listed under the "Programming">>"Dialog & User Interface"

  6. The front panel and block diagram for the VI will look like the following :

    panel

    diagram

  7. On the Front Panel, within the Channel Config Cluster, place a 1 in the channel number, choose TK for the channel type, and leave the wiring as Default.
    Type in the IP address for the DT80, and the port number. If connecting via an ethernet cable, the IP address will be shown on the screen. Or if connecting using a USB cable, with DtUsb, the DtUsb interface will indicate the IP address to use. The default port number of the command port is 7700.

    For more information on how to use the channel configuration cluster, refer to chapter 3, dataTaker Concepts.

  8. Run the VI and the front panel should display the ambient temperature as sensed by the thermocouple in degrees celsius.

  9. Run the VI again while holding the tip of the thermocouple, you should see the temperature change.

Example 2: Reading a temperature over a period of time

This example uses the VI, DT8x AcquireRealTimeWaveformThruTCPIP.vi to take several readings of a K type thermocouple, then plot the data on a graph.

  1. Ensure you are connected to the correct IP address of the DT80 range data logger.

  2. Leave the thermocouple wired into channel 1, as shown in point 2 in Example 1.

  3. Create a new VI, go to the DT8x High Level TCP/IP Palette.

    high level serial palette

    Choose the VI, DT8x AcquireRealTimeWaveformThruTCPIP.vi

  4. From the block diagram, create the controls and indicators for the VI, by using the wiring tool, right-clicking on the terminals of the VI, and choosing Create>>Control, or Create>>Indicator, for the relevant terminals. You do not need to create a control for the "error in" terminal. Do not create an indicator for the "real time waveform" terminal. We will use a graph for this.

  5. Place the Simple Error Handler.vi on the block diagram, from the Functions>>Time & Dialog palette, and wire the error cluster to the VI.

  6. On the front panel, create a XY graph, and wire it to the "real time waveform" terminal. Change the properties of the X axis to display time, by right-clicking on the XY graph, choosing the tab "Format and Precision" then selecting Absolute time under type.

    xy graph properties

  7. On the Front Panel, within the Channel Config Cluster, place a 1 in the channel number, choose TK for the channel type, and leave the wiring as Default.
    Type in the IP address for the DT80, and the port number. If connecting via an ethernet cable, the IP address will be shown on the screen. Or if connecting using a USB cable, with DtUsb, the DtUsb interface will indicate the IP address to use. The default port number of the command port is 7700.

    For more information on how to use the channel configuration cluster, refer to chapter 3, dataTaker Concepts.

  8. We will sample the temperature once a second, for 30 seconds. For the "trigger time type" control, the units of time we will use, will be seconds. For the "trigger time" control, we will use a time interval of 1. Enter a value of 30 for the "samples to acquire" control. This will allow the VI to run for 30 seconds.

  9. The front panel and block diagram for the VI will look like the following :

    panel

    diagram

  10. Run the VI while holding the tip of the thermocouple, and after 30 seconds you should see the temperature change on the graph.

Example 3: Running an existing example

  1. Open the example, DT8x Example HighLevelRealTimeAcquisitionTCPIP.vi which is located in the High Level TCP/IP Examples palette

  2. The channel config cluster is an array, which is for a number of channels. Fill out two channels, index 0 of the array, for a voltage, index 1 of the array, for a type K thermocouple. Both readings will be for channel 1 of the logger.

    For more information on how to use the channel configuration cluster, refer to chapter 3, dataTaker Concepts.

    The array should look like the following

    Channel Configuration Channel Configuration
  3. Ensure IP address and port settings correspond to the settings for your DT80.

  4. We will sample the temperature once a second, for one minute. For the "trigger time type" control, the units of time we will use, will be seconds. For the "trigger time" control, we will use a time interval of 1.

  5. Run the VI, you should see two plots on the graph.

  6. Look at the code, you will see that it is similar to the previous example.

Using the dataTaker Intermediate Level (dt iml) VIs

The Intermediate Level VIs are more flexible allowing a broader range of measurement applications to be developed. They are organised according to the type of connection with the data logger, then further divided into historical and real-time VIs.

These VIs require use in a particular sequence as shown in the following flow charts.

Basic Programming Flow for Real Time acquisition

    Real-Time Acquisition

Basic Programming Flow for Historical acquisition

    Historical Acquisition

With the intermediate VIs you can do multiple reads within your application, keeping the communication link open with the data logger, as opposed to the high level VIs which do not allow this.

This allows you to run other tasks while reading data in from the communication link.

Example 4: reading a voltage and a temperature

In the following example, we will use the real time acquisition VIs to read a voltage and a temperature from the same channel, and plot it to a graph.

  1. Ensure IP address and port settings correspond to the settings for your DT80.

  2. Wire the thermocouple into channel 1, as shown in point 2 in Example 1.

    type K thermocouple
  3. Create a new VI, then go to the block diagram, and select the Intermediate Level TCP/IP Palette.

    intermediate level TCP/IP palette

  4. From left to right, place the following VIs, from the Intermediate Level TCP/IP Palette, on the block diagram.

    • DT8x ConfigureRealTimeAcquisitionThruTCPIP.vi
    • DT8x StartRealTimeAcquisitionThruTCPIP.vi
    • DT8x ReadRealTimeDataThruTCPIP.vi
    • DT8x ClearRealTimeAcquisitionThruTCPIP.vi
    • Then place the Simple Error Handler.vi from the Functions>>Time & Dialog palette on the right of the diagram window.
  5. Create controls from the block diagram for the VI, DT8x ConfigureRealTimeAcquisitionThruTCPIP.vi
    Make sure the settings correspond to your serial port settings, and the settings for your data logger.

  6. Add a voltage channel at index 0 and a thermocouple channel at index 1 for channel 1 of the data logger in the Channel Config cluster array. Set the sample rate for once a second.
    This is shown in Example 3, point 2.

    For more information on how to use the channel configuration cluster, refer to chapter 3, dataTaker Concepts.

  7. Wire the error clusters , and the connection clusters through to all the VIs.

  8. From the block diagram, create an indicator for the data and the timeout for the VI, DT8x ReadRealTimeDataThruTCPIP.vi

  9. The front panel and the block diagram will look like the following :

    panel

    diagram

  10. Run the VI, you should see the voltage and the temperature of the thermocouple.

    The data is returned as a schedule data cluster. The cluster contains the schedule that the data was read from, which is schedule A for this example, the time the data was sampled, given in the number of seconds since 1st January 1904, and an array of the data from the listed channels in the schedule, which will be the voltage of the thermocouple, and temperature in degrees celsius.

  11. As a further exercise, examine the following example contained in the examples sub-palette.

    DT8x Example IntermediateLevelRealTimeAcquisitionTCPIP.vi

    This demonstrates how to take several readings of the same channel, and plots the data to a graph, using arrays.

Example 5: reading a voltage and temperature historically

The following example uses the historical VIs in the Intermediate Level TCP/IP palette, to read, log, and download data from a logger, with a temperature and voltage reading.
  1. Ensure IP address and port settings correspond to the settings for your DT80.

  2. Use the type K thermocouple and wire it into channel 1, as shown in point 2 in Example 1.

    type K thermocouple
  3. Create a new VI, then go to the block diagram, and select the Intermediate Level TCP/IP Palette.

    intermediate level TCP/IP palette

  4. From left to right, place the following VIs, from the Intermediate Level TCP/IP Palette, on the block diagram.

    • DT8x ConfigureHistoricalAcquisitionThruTCPIP.vi
    • DT8x StartHistoricalAcquisitionThruTCPIP.vi
    • Wait (ms) function from the Functions>>Time and Dialog palette
    • DT8x ReadHistoricalDataThruTCPIP.vi
    • DT8x ClearHistoricalAcquisitionThruTCPIP.vi
    • Then place the Simple Error Handler.vi from the Functions>>Time & Dialog palette on the right of the diagram window.
  5. Create controls from the block diagram for the VI,
    DT8x ConfigureHistoricalAcquisitionThruTCPIP.vi
    Make sure the settings correspond to your serial port settings and the settings for your logger.

  6. Add a voltage channel at index 0 and a thermocouple channel at index 1 for channel 1 of the data logger in the Channel Config cluster array. Set the sample rate for once a second.
    This is shown in Example 3, point 2.

    For more information on how to use the channel configuration cluster, refer to chapter 3, dataTaker Concepts.

  7. Create a control for the Wait function, then place a sequence structure from the structures palette around it. Place a value of 20 000 in the control for the wait function.
    This will pause the program for 20 seconds before reading all the data.

  8. Wire the error clusters and the connection clusters through to all the VIs and through the sequence structure.

  9. From the block diagram, create an indicator for the data and the timeout using the VI,
    DT8x ReadHistoricalDataThruTCPIP.vi

  10. The front panel and the block diagram will look like the following :

    panel

    diagram

  11. Run the VI, you should see the voltage and the temperature of the thermocouple for a 20 second period.

  12. Next, examine the following example contained in the examples sub-palette.

    DT8x Example IntermediateLevelHistoricalAcquisitionTCPIP.vi

    This demonstrates how to plot the data to a waveform graph.

    Following this example, you can easily modify the program you created with exercise 5 to plot the data to a waveform graph, using a for loop, Unbundle By Name and Transpose 2D Array function.

Using the dataTaker Low Level (dt ll) VIs

The Low Level VIs allow an advanced level of control over the dataTaker.

They are organised into three logical groups, or sub-palettes.

  • The low level general palette allows you to manage a connection, set various dataTaker modes, manage data, and configure a dataTaker program.
  • The low level utility palette allows you to set or configure various aspects of the dataTaker's configuration.
  • The low level comms palette give direct access to the functions that handle serial and TCP/IP packets. These VIs should rarely be used, and the VIs in the low level general palette should be used instead.

The Examples

For more information on the VIs at the Low Level, please examine the Examples on the relevant palette's. They clearly demonstrate the usage of the Low Level VIs.