How do I create an Autosave Macro in LabChart for continuous long-term recordings?

An Autosave Macro can be a useful tool for long term and continuous data collection, and is most commonly used with our Kaha Telemetry Devices. Please note, this is an advanced solution for experienced LabChart users. The Autosave Macro utilizes the LabChart "Macro" feature to save multiple datafiles of continuous data. Long term data collection can also be done with the Sampling feature or the Scheduler Extension.

Sampling Feature:

Click the toolbar menu "Setup" and select "Sampling..." from the dropdown list that appears to open the Sampling feature's options window. From here you can set LabChart to record one or multiple fixed duration data blocks, started by clicking sample. For more information, see the LabChart Help menu by clicking the question mark in the bottom left of the options window. 

Scheduler Extension:

Once the Scheduler Extension has been installed through the LabChart Feature Manager or via our website HERE, it's menu can be found under the toolbar menu "Setup" and opened by selecting "Scheduler...". This extension will allow data to be recorded in multiple blocks starting and ending at set times for set durations all saved to one data file. For more information, see the LabChart Help menu by clicking the question mark in the bottom left of the Scheduler settings window.

Autosave Macro:

An Autosave Macro is different than these other options because it will save separate datafiles containing one block of continuous data of a set duration to a set location. This can be useful compared to the other methods because it will save smaller sized files while recording continuously over multiple days or weeks. Here are step by step instructions for creating an Autosave Macro:

 

  1. Start recording the macro: "Macro Menu > Start Recording"
    • Note: almost every mouse click is recorded during this time, so be careful of unnecessary clicking
  2. Set the loop amount under "Macro Menu > Recording Commands > Repeat..." (How many files will be made)
  3. Click the "Start" button (either top right or bottom right)
    • Make sure "Finish sampling before doing other macro steps" is selected
    • Set "Stop sampling: Fixed duration" and set the time (in seconds) to the length of the files you'd like to record.
  4. Go to "File Menu > Save as..." and select where on the computer you would like the files saved
    • You can set the file to append the time, date or both to the end of the file name here. I would recommend setting these files to be named "Autosave" + Time and date.
  5. Click "End Repeat" and "Stop"
  6. If it is not visible, you can open the Macro code by going to the "Macro" dropdown menu, select "Manage...", highlight the autosave macro, and click the "Edit" button on the right side
    1. Resize the window until the Command list appears on the right side of this popup
    2. Place the cursor at the appropriate spot to start typing or pasting commands by left mouse clicking below the main code portion of the macro, but above the "Next" line 
  7. Navigate to the "Edit Menu" dropdown on the command list
  8. Click "Select All"
  9. Click "Clear"
  10. Name the Macro and check the "show in toolbar" checkbox, then click "OK"

 

Here is an example of what the Macro code should look like and a brief description of its parts:

 

Red - Loop Number; How many files will be made
Orange - How long the files will be (in seconds)
[If you multiply the Red number by the Orange number, that product will equal how much time the macro will record continuously]
Green - File path + General file names (THIS WILL BE DIFFERENT IN THE MACRO YOU CREATED) 
Purple - LabChart saving options code (In this example, time and day are appended to the end of the file name)
Blue - The commands for selecting and clearing the data after it has been saved
 
After this, you should have a functioning macro to continuously record and save data files of set length for a set duration. In order to record data and autosave it, you must run the macro instead of simply clicking the "Start" button. To run the macro, you can click the new icon in the macro section of the toolbar (if selected when creating the macro), or select it under the Macro Menu dropdown. 
 
By default, macros created in LabChart populate in the "Document Macros" tab of the "Manage Macros" popup window. These will be available for use in the current document, and in any settings files made from the current document.  To be able to use the macro on any file opened in this particular install of LabChart, you can copy the macro to the "Library Macros" tab by selecting the macro then clicking the "Copy to Library" button.
 
For further technical assistance with this or any other issue, please contact ADInstruments Technical Support by clicking HERE