Getting Started

Overview

This chapter is a guide for new users of the dataTaker Instrument 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>>LabVIEW DataTaker 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 dataTaker data logger

Using the driver VIs, we can communicate to the data logger in three different ways.

  1. 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.

    Datataker Pty Ltd has a number of useful guides on modem communications. They cover areas such as, matching baud rates, flow control, and preventing messages from the data logger being sent to the modem, which are not interpreted correctly. Please contact your Datataker support office for this information.

  2. Serial using RS-232

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

  3. Ethernet using TCP/IP

    To communicate via TCP/IP, there needs to be a TCP/IP connection between the data logger and the computer. The TCP/IP connection can be made directly to the DT800 over an Ethernet network, directly to the DT800 from the computer using a cross over cable, or using the DT500 family of data logger's, using the RS-232 to Ethernet converter.

    Using a PPP connection, you can communicate to the data logger over a serial link using TCP/IP commands. This is useful for serial links that may be unreliable due to noise or other problems. This is only available with the dataTaker DT800 data logger.

Data management within a dataTaker 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
    DT 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

When purchasing a dataTaker data logger with accessories, a type K thermocouple and potentiometer are included. We will use the type K thermocouple to read the temperature.
This example uses the VI, DT SampleChannelThruSerial.vi to read a temperature.

  1. Ensure your data logger is connected to the PC serial port, with the correct cable. There are different cables for the DT500 family and for the DT800.

  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 (-). With a type K thermocouple follows the N.I.S.T. standard, as supplied with the data logger.

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

    high level serial palette

    Choose the VI, DT SampleChannelThruSerial.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.

  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. Choose the type of dataTaker data logger you have for the "DT Type" control, then ensure the VISA resource name and port config settings correspond to the serial port settings for your dataTaker data logger.

    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, DT AcquireRealTimeWaveformThruSerial.vi to take several readings of a K type thermocouple, then plot the data on a graph.

  1. Ensure your data logger is connected to the PC serial port, with the correct cable. There are different cables for the DT500 family and for the DT800.

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

  3. Create a new VI, go to the DataTaker High Level Serial Palette.

    high level serial palette

    Choose the VI, DT AcquireRealTimeWaveformThruSerial.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 X Scale>>Formatting, then selecting Time & Date under Format.

    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. Choose the type of dataTaker data logger you have for the "DT Type" control, then ensure the VISA resource name and port config settings correspond to the serial port settings for your dataTaker data logger.

    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 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. Enter a value of 60 for the "samples to acquire" control. This will allow the VI to run for one minute.

  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 60 second you should see the temperature change on the graph.

Example 3: Running an existing example

  1. Open the example, DT Example HighLevelRealTimeAcquisitionSerial.vi which is located in the High Level Serial 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 the VISA resource name and port config settings correspond to the serial port settings for your data logger.

  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 your data logger is connected to the PC serial port, with the correct cable. There are different cables for the DT500 family and for the DT800.

  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 Serial Palette.

    intermediate level serial palette

  4. From left to right, place the following VIs, from the Intermediate Serial Palette, on the block diagram.

    • DT ConfigureRealTimeAcquisitionThruSerial.vi
    • DT StartRealTimeAcquisitionThruSerial.vi
    • DT ReadRealTimeDataThruSerial.vi
    • DT ClearRealTimeAcquisitionThruSerial.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, DT ConfigureRealTimeAcquisitionThruSerial.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, DT ReadRealTimeDataThruSerial.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.

    DT Example IntermediateLevelRealTimeAcquisitionSerial.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 Serial palette, to read, log, and download data from a logger, with a temperature and voltage reading.
  1. Ensure your data logger is connected to the PC serial port, with the correct cable. There are different cables for the DT500 family and for the DT800.

  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 Serial Palette.

    high level serial palette

  4. From left to right, place the following VIs, from the Intermediate Serial Palette, on the block diagram.

    • DT ConfigureHistoricalAcquisitionThruSerial.vi
    • DT StartHistoricalAcquisitionThruSerial.vi
    • Wait (ms) function from the Functions>>Time and Dialog palette
    • DT ReadHistoricalDataThruSerial.vi
    • DT ClearHistoricalAcquisitionThruSerial.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,
    DT ConfigureHistoricalAcquisitionThruSerial.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,
    DT ReadHistoricalDataThruSerial.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.

    DT Example IntermediateLevelHistoricalAcquisitionSerial.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.