Daqarta
Data AcQuisition And Real-Time Analysis
Scope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
The following is from the Daqarta Help system:

Features:

Oscilloscope

Spectrum Analyzer

Signal Generator
(Absolutely FREE!)

Spectrogram

True RMS Voltmeter

Sound Level Meter

Frequency Counter

Period Counter

Event Counter

Spectral Event Counter

Waveform Averager

Histogram

Post-Stimulus Time
Histogram (PSTH)

Macro System

Multi-Trace Arrays

Trigger Controls

Auto-Calibration

Spectral Peak Track

Direct-to-Disk Recording

Accessibility

Applications:

Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery

Vehicle pass-by noise

Product test

Contact us about
your application!

Macro Variables


Macros: Var0-VarZ, VarClr

Macro variables are unsigned integer values named Var0 through Var9 and VarA through VarZ. They can be used to keep track of internal macro states or counts. They are set or tested just like main Daqarta variables.

Var0=1 sets Var0 to 1.

Var0=x toggles Var0 between 0 and 1.

Var0=>1 increments Var0, and Var0=>-1 decrements it.

Note that macro variables are retained across sessions by default, independent of any MAC file. You can use this property to set persistent macro preferences. But this also means you may need to explicitly clear some variables at the start of a session. For a single variable, you can just use Var0=0. The VarClr command allows you to clear a range of variables, or all variables:

VarClr=AD sets VarA through VarD to zero.

VarClr= sets all variables to zero.

You can use IF statements such as IF.VarN=100 to test macro variables just like Daqarta control variables.

You can preset Fields to display macro variables when they are changed. For example Field1=?VarN will cause the value of VarN to be shown in Field 1 whenever VarN is modified. Use VarN=>0 to force the Field to show the current value without changing it.


Example - Operator Prompts:

Suppose you have a complicated test suite, all run by macros, and want to provide a series of prompt messages to help train new operators. You can use VarA to tell if the prompts will be shown, so that they can be turned off when they are not needed. A macro called PromptTog will simply toggle VarA: VarA=x.

A macro called Prompt will be called at various points in the test sequence, indicating what to do next. Each stage of the series will be run by its own macro, which will set VarB to a unique value before calling the Prompt macro via @Prompt.

The Prompt macro will test VarA and show no message if VarA is zero. Otherwise, it will test VarB and show the appropriate message.

  IF.VarA=0
     Msg=
 ELSE.
     IF.VarB=0
         Msg="Hit Test1 to start 1st test."
     ENDIF.
     IF.VarB=1
         Msg="Hit Stop1 to halt 1st test."
     ENDIF.
     IF.VarB=2
         Msg="Hit Save1 to save Test1 results."
     ENDIF.
     IF.VarB=3
         Msg="Hit Test2 to start 2nd test."
     ENDIF.
 ENDIF.

Example - File Name Auto-Increment:

If your test suite saves a lot of different files that are all derived from the same subject or device under test, you can use the Auto-Increment Filenames option. You need to provide an initial base name for the first file saved, but not for subsequent saves which will append an incrementing value to the base name.

The initial setup macro (typically the ' !' automatic startup macro) can prompt the operator to enter a subject ID to a Field before starting the test, by including the following commands:

  VarC=0
 Msg="Enter Subject ID"
 WaitChange=Field5
 Msg=

You may want to precede this by a MsgPosFix command set to show the Msg right over Field5.

The contents of Field5 (such as "Rat123") can then be used as the base file name. The following file save macro uses VarC as a flag, so that the base name will only be entered on the first save of the session:

  AutoInc=1
 IF.VarC=0
     A.SaveDQA=">Field5"
     VarC=1
 ELSE.
     A.SaveDQA=
 ENDIF.

The first time this is run, it will save Rat123-000.DQA and set VarC to 1. The next time, it will save Rat123-001.DQA, incrementing on each subsequent save. (The A. prefix means that SaveDQA won't show a Save As dialog, it will just save the file directly.)

Since macro variables are saved across sessions, VarC is set to 0 in the start-up macro. This insures that the initial save always sets the subject ID as the base name. If multiple subjects are tested in one session, VarC should be cleared each time a new subject ID is entered.


Example - Initial Msg Position:

Suppose you want to set a particular default position for a draggable Msg, but once the user drags it, that new position should be used in future sessions. You can use an IF statement like this:

  IF.VarD=12345
     ;Do nothing
 ELSE.
     MsgPos="100,200"
     VarD=12345
 ENDIF.

The first time the macro runs, VarD will be 0 so the position will be set. Later in this session or future sessions, VarD will be 12345 so the MsgPos will not be run. If you have different MAC files for different applications, you can use specific values to tell which MAC set ran last, to have different positions for each.


GO:

Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
INTERSTELLAR RESEARCH:
Over 25 Years of Innovative Instrumentation
© Copyright 2007 - 2008 by Interstellar Research
All rights reserved