Creating a Short Cut data logger program

You must provide a program for the data logger in order for it to make measurements, store data, or do control. There are several ways to write a program. The simplest is to use the program generator called Short Cut. For more complex programming the CRBasic editor is used. The program file may use the extension .CR1X, .CRB or .DLD.

Data logger programs are executed on a precise schedule termed the Closedscan intervalThe time interval between initiating each execution of a given Scan() of a CRBasic program. If the Scan() Interval is evenly divisible into 24 hours (86,400 seconds), it is synchronized with the 24 hour clock, so that the program is executed at midnight and every Scan() Interval thereafter. The program is executed for the first time at the first occurrence of the Scan() Interval after compilation. If the Scan() Interval does not divide evenly into 24 hours, execution will start on the first even second after compilation., based on the data logger internal clock.

Measurements are first stored in temporary memory called ClosedvariablesA packet of SRAM given an alphanumeric name. Variables reside in variable memory. in the ClosedPublic TableA CRBasic command for declaring and dimensioning variables. Variables declared with Public can be monitored during data logger operation.. Variables are usually overwritten each scan. Periodically, generally on a time interval, the data logger stores data in tables. The ClosedData TablesA concept that describes how data is organized in memory, or in files that result from collecting data in memory. The fundamental data table is created by the CRBasic program as a result of the DataTable() instruction and resides in binary form in main-memory SRAM. The data table structure also resides in the data cache, in discrete data files on data logger drives, and in binary or ASCII files that result from collecting final-data memory with data logger support software. are later copied to a computer using your data logger support software.

Use the ClosedShort CutA CRBasic programming wizard suitable for many data logger applications. Knowledge of CRBasic is not required to use Short Cut. software to generate a program for your data logger. Short Cut is included with your Closeddata logger support software.LoggerNet, RTDAQ, PC400, and PC200W - these Campbell Scientific software applications include at least the following functions: data logger communications, downloading programs, clock setting, and retrieval of measurement data.

This section will guide you through programming a CR1000X data logger to measure the voltage of the data logger power supply, the internal temperature of the data logger, and a thermocouple. With minor changes, these steps can apply to other measurements. Use the following instructions or watch the Quickstart part 3 video .

  1. Using data logger support software, launch Short Cut.
  2. Click Create New Program.

  3. Select CR1000X Series and click Next.

    NOTE:

    The first time Short Cut is run, a prompt will ask for a noise rejection choice. Select 60 Hz Noise Rejection for North America and areas using 60 Hz ac voltage. Select 50 Hz Noise Rejection for most of the Eastern Hemisphere and areas that operate at 50 Hz.

    A second prompt lists sensor support options. Campbell Scientific, Inc. (US) is usually the best fit outside of Europe.

    To change the noise rejection or sensor support option for future programs, use the Program menu.

  1. A list of Available Sensors and Devices and Selected Measurements Available for Output display. Battery voltage BattV and internal temperature PTemp_C are selected by default. During operation, battery and temperature should be recorded at least daily to assist in monitoring system status.

  2. Use the Search feature or expand folders to locate your sensor or device. Double-click on a sensor or measurement in the Available Sensors and Devices list to configure the device (if needed) and add it to the Selected list. For the example program, expand the Sensors/Temperature folder and double-click Type T Thermocouple.

  3. If the sensor or device requires configuration, a window displays with configuration options. Click Help at the bottom of the window to learn more about any field or option. For the example program, accept the default options:
    • 1 Type T TC sensor
    • Temp_C as the Temperature label, and set the units to Deg C
    • PTemp_C as the Reference Temperature Measurement.
  4. Click OK.

  5. Click Wiring Diagram on the left side of the window to see how to wire the sensor to the data logger. With the power disconnected from the data logger, insert the wires as directed in the diagram. Ensure you clamp the terminal on the conductor, not the wire insulation. Use the included flat-blade screwdriver to open/close the terminals.

  1. Click Sensors on the left side of the window to return to the sensor selection window, then click Next at the bottom of the window.

  2. Type 1 in the How often should the data logger measure its sensor(s)? box.

  3. Use the Output Setup options to specify how often measurements are to be made and how often outputs are to be stored. Note that multiple output intervals can be specified, one for each output table (Table1 and Table2 tabs). For the example program, only one table is needed. Click the Table2 tab and click Delete Table.

  4. In the Table Name box, type a name for the table. For example: OneMin.

  5. Select a Data Output Storage Interval. For example: to 1 minute.

  6. Click Next.

  7. Select the measurement from the Selected Measurements Available for Output list, then click an output processing option to add the measurement to the Selected Measurements for Output list. For the example program, select BattV and click the Average button to add it to the Selected Measurements for Output list. Repeat this procedure for PTemp_C and Temp_C.


    (Click image to expand/collapse display)

  1. Click Finish and give the program a meaningful name such as a site identifier. Click Save.

  2. If LoggerNet or other data logger support software is running on your computer, and the data logger is connected to the computer (see Making the software connection for more information), you can choose to send the program. Generally it is best to collect data first; so, we recommend sending the program using the instructions in Sending a program to the data logger.

TIP:

It is good practice is to always retrieve data from the data logger before sending a program; otherwise, data may be lost. See Collecting data for detailed instruction.

If your data acquisition requirements are simple, you can probably create and maintain a data logger program exclusively with Short Cut. If your data acquisition needs are more complex, the files that Short Cut creates are a great source for programming code to start a new program or add to an existing custom program using CRBasic. See the CRBasic Editor help for detailed information on program structure, syntax, and each instruction available to the data logger.

NOTE:

Once a Short Cut generated program has been edited with CRBasic Editor, it can no longer be modified with Short Cut.