ADInstruments
ADResearch Home
日本語  中文 
NEWS ABOUT MEDIA PARTNERS OEM CONTACTS
 
 
Home
 
ADResearch
 
ADEducation
 
ADPharma
 
News
 
About Us
 
Media
 
Business Partners
 
OEM
 
Contact Us
 
   
   Events        Product List        Brochures        Request Price        User Profile        Register   

LabChart Macros

Go to ADResearch Go to ADEducation Go to ADPharma

Below is a brief outline on using Macros in LabChart. For a more detailed explanation, see your LabChart for Windows or LabChart for Macintosh User's Guide.

What is a Macro?

A macro is used to group a set of commands together. Macros automate repetitive tasks that you would normally have to perform, such as changing LabChart settings for different stages of an experiment, or setting up the Data Pad for analysis.

How does a Macro Work?

A macro records the results of your actions step by step, then reproduces them when played back. Macros can record almost any LabChart operation: setting dialog box and window controls; changing the display format; copying waveform data to the Data Pad; saving data as a new file; printing the Zoom window display of selected data, and so on.

It is important to note that macros record the results of your actions, not individual keystrokes and mouse clicks, and record the simplest possible interpretation of those actions. Even if you spend time altering control settings during the recording of a macro, only the final settings you obtain will be used.

Macros are saved as part of a LabChart file, and are available when that file or one of its windows is active. When a file is saved, all currently available macros are saved with it, becoming part of the file.

How are Macros Useful in Teaching?

When using LabChart, macros can make your teaching labs easier by fully or partly automating tasks so that students can concentrate on obtaining data. For example, macros could be created that change LabChart settings for different stages of a lab experiment. Students simply select the appropriate macro menu item and LabChart is set correctly and ready for them to start the next exercise.

Moving Macros Between LabChart Files

Ideally, macros would be part of a LabChart Settings file that you use as a template from which to create new files. See Creating Settings Files for more information.

However, if you want to use a macro from one LabChart data file in another you can.

Mac

  1. Open the LabChart file that contains the macro you want to use
  2. Choose File > Open… In the Open dialog box choose an existing file that you want to move the macro into and ensure that Discard Existing Macros is turned off. Click Open.
    or
    Choose File > New to open a new (empty) file that contains the macro.

Windows

  1. Open the LabChart file that contains the macro you want to use.
  2. Choose File > Append… In the File Append dialog box choose an existing file that you want to move the macro into and click Open.
    or
    Choose File > New. In the New Document dialog box ensure that Settings from Document '…adicht' is turned on. Click OK.

Tips and Suggestions

  • Write down what you want the macro to do first. Having this clear in your mind will help to avoid mistakes — macros cannot be edited in Chart (Macros are only editable in LabChart for Windows), if you make a mistake then you have to start recording again from the beginning.
  • Make a more complex macro out of very simple steps. Since macros cannot be edited, it makes sense to break your task into smaller macros then use another macro to use all the smaller ones.
  • Macros only remember the settings you have clicked or selected, so if a setting you require is already on, then you must click on it once to turn it off and then again to turn it on.
  • Keep a written record of the steps involved in your macros, and their purpose — it’s easy to forget which macro does what when you haven’t used them since the last laboratory class

Example Macros

Below are three simple examples of macros that set up LabChart, automate data recording or automate data analysis.

LabChart Set-Up Macro

In this example you have an experiment with two stages; in stage one LabChart samples at 100/s on two channels (Macro 1), and in stage two it samples at 20/s on four channels (Macro 2).

Macro 1

  1. Select Start Recording from the Macro menu.>
  2. Using the Rate pop-up menu, set the sampling speed to 100/s.
  3. Using the Channel Function pop-up menus, turn on channels 1 and 2.
  4. Using the Channel Function pop-up menus, turn off all other channels.
  5. Choose Stop Recording from the Macro menu. You will be prompted to save the macro; save it with a suitable name, such as 'Stage 1'.

Macro 2

  1. Select Start Recording from the Macro menu.
  2. Using the Rate pop-up menu, set the sampling speed to 20/s.
  3. Using the Channel Function pop-up menus, turn on channels 1 through 4.
  4. Using the Channel Function pop-up menus, turn off all other channels.
  5. Choose Stop Recording from the Macro menu

Data Recording Macro

In this example you want to make one-minute recordings that are each separated by nine minutes. You want to do this for one hour. Note: there are several ways you could do this — one method is detailed below.

  1. Select Start Recording from the Macro menu.
  2. Choose Macro > Macro Commands > Begin Repeat… and set the number of repeat times in the Begin Repeat (Mac) or Macro Repeat (Windows) dialog box to six. Click OK.
  3. Click the Start button to start LabChart recording.
  4. In the ensuing Macro Sampling dialog box set LabChart to stop sampling after a fixed duration of one minute and ensure that 'Finish sampling before doing other macro steps' is selected. Click OK.
  5. Choose Macro > Macro Commands > Wait…
  6. In the Macro Wait dialog box set LabChart to wait for nine minutes.
  7. Choose Macro > Macro Commands > End Repeat.
  8. Choose Macro > Stop Recording.

Data Analysis Macro

In this example, you want to select each block in the recording, add them to the Data Pad which will calculate the mean for all of the blocks.

  1. Select Start Recording from the Macro menu.
  2. Choose Windows > Data Pad and set up the Data Pad so that means are calculated for the appropriate channels.
  3. Choose Macro > Macro Commands > Repeat Select Each Block.
  4. Choose Commands > Add to Data Pad.
  5. Choose Macro > Stop Recording.
ADInstruments - Making Science Easier
ADInstruments RSS News Feeds RSS  •  INTENDED USE  •  PRIVACY  •  LEGAL  •  SITE MAP  •  USER PROFILE  •  REGISTER