Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
There are 6 Fields below 6 corresponding Labels beneath the Notes area. Each can hold up to 15 characters, or less as limited by the control window size when entered manually. (But see Macro Notes, below.)
Fields are intended to hold the values of the indicated Label parameters that apply to the given trace. This allows you to keep relevant information together with trace data that is saved to a .DQA or .TXT file, or to Juxt Array memory.
For example, if Label1 is Freq, then Field1 might hold the stimulus frequency in hertz that was used to obtain the trace response.
You can use CTRL+ALT+D to enter the current date, or CTRL+ALT+T to enter the current time. The Edit Date/Time Preferences menu allows you to specify the date or time format, and whether UTC time or local time will be used. (You can also enter date or time via macros... see the Macro Notes below.)
You can enter Field values manually, but the real utility of Fields is with Macros that allow them to be updated automatically when a macro changes the corresponding parameter. A macro can specify the value to appear in any Field, as in:
The specified value is just text, and could just as easily be a word or words, as in:
But many times you want the Field to show the current value of a parameter like ToneFreq:
But if ToneFreq is changed manually instead of via macro, the Field would not be updated. Instead you would use:
This command tells Daqarta to automatically update Field1 with the new ToneFreq value whenever it changes, whether by macro or manually. Unlike the specific Field1=L.0.ToneFreq method, you only need to give this command once, and it will remain in effect until the end of the session. It can be superceded by assigning another control to this Field, or the assignment can be deactivated by Field1=? without a control name.
Note that the auto-update command, by itself, does not specifically update Field1 with the current value at the time the command is run. You must give the command prior to some action (manual or macro) that updates the value. If you want to update Field1 without changing ToneFreq, use L.0.ToneFreq=>0 to "scroll by 0 steps".
Also note the peculiar usage of L.0. in front of Field1 instead of in front of ToneFreq, the actual parameter being selected via the L.0. prefixes. These prefixes set the current channel and stream no matter what command they precede, but the Field1=? command expects to find a normal Daqarta internal command following it, without any prefixes.
Though this ToneFreq example only requires channel and stream prefixes, other prefixes may be required for other commands such as Burst modulators, Timing modulators, or User Line controls. Any prefix that would be required if the command were used normally should be moved to the front of Field1.
Besides numerical value controls like ToneFreq, you can use automatic Field updates with most on/off toggle controls, as in L.0.Field2=?Burst. However, this will only enter the state into the chosen Field as '0' for Off or '1' for On... it will not show 'Burst On', for example.
Direct Field commands (but not the above auto-updates) can also use string expressions, including references to themselves to allow appending and prepending. So Field1=Field1+VarA(3) will append the value of VarA to the existing field. If VarA holds a value of 23 and the existing Field1 is Test, then the new Field1 will become Test023.
Fields can use many other string variables, including time, date, cursor readouts, Labels, numeric Macro Variables, Str0-7 String Array elements, Buf0-7 String Storage elements, Msg message contents, Daqarta Notes, Averager Total Frames Counter, or Frequency Counter, Sound Level Meter, or Voltmeter readouts.
Another advantage of direct Field commands over auto-updates is that you can specify number formatting. For example, Field1=L.0.ToneFreq(0.3) would include all integer digits but only 3 decimal places.
When you set a numeric variable equal to a Field, or use the Field in an IF test, the string is converted using the standard Daqarta number entry formats, including decimal, exponential, scientific unit prefixes, "European" notation, or H:M:S time. This allows Fields to be used for numeric entry in macros.
If Daqarta can't interpret the string as a standard number or time, it is converted to ASCII character values and read as an integer holding the first 4 characters, or as a floating-point or 64-bit fixed-point holding the first 8 characters.
For example, if Field1="AB123" then UV=Field1 will set macro variable UV to 0x41423132. If this is then displayed using the alphanumeric format option (A) via Msg=UV(A), the displayed message will be "AB12".
Use caution with the above default alpha conversion, since it can lead to unintended results. For example, Field1="12A3" will result in an aphanumeric string, but Field1="12a3" will not... it will be interpreted as 12.3 * 10^-18 since 'a' is the standard scientific prefix for 'atto', and when a prefix appears in a string of digits it is interpreted as the decimal place in "European" entry format.
Also, the default number detection stops at the first space, so Field1="123 A" will be read as a value of 123, while Field1="123A" will be read as a string.
Note that time entries can not be negative, and that only time entries can include colons. If you attempt to enter a negative time such as -1:23, Daqarta will treat it as text and return the ASCII values for the first 4 characters as hex 2D313A32 or decimal 758200882.
You can force a Field to be read as text by using an ?A suffix, as in V=Field1?A.
Although it is not normally recommended, all of the above methods can also be applied to Labels. You might want to do this if you get into a situation where you need to record more than 6 parameter values for each trace. By using Labels as if they were Fields, you get the effect of 12 separate Fields. Note, however, that you will have to keep track of what each really means, since it won't have a separate Label to indicate that. You might consider putting that information in the Notes area.
One excellent use of Fields is with Juxt Arrays. The Label Field control allows you to select any of the 6 normal Fields to be used to label the trace. For example, if you are running a series of tests at different stimulus frequencies, you can set up a Field to report the frequency used for the current trace. Then when you are looking at an array of several traces, you can set Label Field to that Field number and each trace in the display will be labeled with its respective stimulus frequency. Better still, you can then select Juxt Array Sort and the traces will be shown in ascending or descending order.
Note: In 640x480 display mode the main window is too large to see Labels or Fields. Although unseen, you can still send data to these via macros. If you save a .DQA file, those Labels and Fields can be seen later on any system with a higher screen resolution.
Field1="Test" sets Field1 to Test (without quotes). A field can hold up to 15 characters via macro commands, even if those characters would not fit in the control window when entered manually. The field can then be copied for other uses, as in LogName=Field1.
Field commands can use string expressions, including references to themselves to allow appending and prepending. So Field1=Field1+UA(3.0) will append the value of UA to the existing field, with 3 integer digits and no decimal places. If UA holds a value of 23 and the existing Field1 is Test, then the new Field1 will become Test023.
As noted above, Fields can use many other string variables, including time, date, cursor readouts, Labels, numeric Macro Variables, Str0-7 String Array elements, Buf0-7 String Storage elements, Averager Total Frames Counter, or Frequency Counter, Sound Level Meter, or Voltmeter readouts.
You can use numeric tests with Fields, such as IF.Field1=1000. Since the Field string is converted to a value for the test, this statement will be true if Field1 is '1000', '1k', '1.00k', '1k00', etc. Note, however, that as with all IF statements you should use caution when comparing decimal values for equality due to the possibility of hidden decimal places... it's usually better to test if the Field is above or below limits.
A Field can be used for numerical data entry, or to control macro operation.
You can even use a single Field for two separate integer values, by entering them as a decimal value. For example, a Field3 value of 200.300 could be used to set variable UB to 200 and variable UC to 300, perhaps as lower and upper range limits for a test. You can extract the UB part by truncating the fraction with UB=int(Field3).
To extract UC you can use UC=(Field3 - UB) * 1000. Note, however, that this requires that the decimal value have exactly 3 digits; you have to pad smaller values with leading zeros. You can replace the 1000 with a larger or smaller decade value to control the number of digits.
You can use limited string tests with Fields... see the String Tests section under Macro IF Statements. In particular, you can not use immediate strings like IF.Field1="Test", but you can set UA="Test" and then use IF.Field1=UA.
More importantly, you can test if a Field is empty via IF.Field1=. The _Phase_Mtr_Ctrls macro listing in the Phase Meter mini-app uses this to see if the user has entered a file name, and if not (that is, if the "test for empty" passes), prompts for entry.
One unusual application for Fields is to use them as real-time "Print statements" for debugging your macros. See High-Speed Alternatives in the Custom Macro Messages topic.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 30 Years of Innovative Instrumentation
© Copyright 2007 - 2020 by Interstellar Research
All rights reserved