|
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:OscilloscopeSpectrum Analyzer Signal Generator
|
Applications:Frequency responseDistortion measurementSpeech and musicMicrophone calibrationLoudspeaker testMusical instrument tuningAnimal soundEvoked potentialsRotating machineryVehicle pass-by noiseProduct testContact us about
|
|
Message MacrosMacros: WaitMsg, WaitMsgType, WaitMsgAns, Msg, MsgTitle, MsgStyle, MsgColr, MsgBkColr, MsgPos, MsgPosFix There are two basic types of messages that macros can display: Conventional Windows message boxes that wait for the user to click a button, and custom macro messages that don't have buttons. The position, color, and other features of custom messages can be controlled via macros. They are typically used to show the status of a test, or to request the operator to enter data, or to act as context-sensitive prompts for using a complex macro suite. Message Boxes With Buttons: WaitMsg="Click OK to resume macro..." shows a standard Windows message box with an ' OK' button. After the message is shown, macro processing halts until the user responds to the message. You can change WaitMsg features with WaitMsgType. The default is WaitMsgType=O for OK. You can choose an icon for the message, the number and type of buttons, and the default button (the one that is chosen by just hitting the Enter key) by including a character from each of these groups:
S = Stop-sign icon.
Q = Question mark.
E = Exclamation point.
I = Information ('i' in a circle).
O = OK button only.
C = OK and Cancel buttons.
A = Abort, Retry, Ignore.
X = Yes, No, Cancel.
Y = Yes, No.
R = Retry, Cancel.
1 = 1st button default.
2 = 2nd button default.
3 = 3rd button default.
So, for example WaitMsgType=EX2 will show subsequent WaitMsg text with an Exclamation point icon and Yes, No, Cancel buttons, with the No button the default. WaitMsg is used to wait for a response from the user. If it is just to have the user confirm that he has read the message, the default OK type can be used. Macro processing will stop after the WaitMsg command until the OK button is clicked or the message box is dismissed with the [x] button, then proceed with the next macro command: WaitMsg="1) Attach electrodes to monster. 2) Raise platform. 3) Turn dial to 'Danger'. 4) Click 'OK' to proceed..." @Reanimate The above example shows a multi-line message (note the quote marks at the beginning and end), then waits for 'OK' before running the Reanimate macro. If you ask the user to make a decision, such as with a Yes/No message, you can provide different macro actions based upon the response. The WaitMsgAns command is used in an IF statement to obtain a number corresponding to the user action:
WaitMsgType=EY2 ;!, Yes/No, No default
WaitMsg="Ignore Reactor Warning Alarm?"
IF.WaitMsgAns=6 ;6=YES
@MaxPower
ELSE.
@ShutDown
ENDIF.
The possible response values (depending on message type) are: 1 = OK 2 = Cancel 3 = Abort 4 = Retry 5 = Ignore 6 = Yes 7 = No 8 = Close Custom (Non-Button) Messages: Msg="Test Message" shows a simple custom macro message, replacing any prior message. Msg=" removes any prior message. By default, Msg text is centered in the box, and has a title bar that just says "Macro Message" above the message text. MsgTitle="New Title" changes it to "New Title". The message box is automatically sized to the message text. If the message is short, the title may be trucated. You can use MsgTitle= to specify an empty title bar. MsgStyle=TC is the default message style, where T specifies Title and C specifies Centered. Other options besides Centered are R for Right-justified and L for Left. So, for example MsgStyle=L will show Left-justified text but no Title. Msg text can span multiple lines by using a single pair of quotes to surround the entire message: MsgStyle=TC ;Title, Center MsgTitle="Test Steps" Msg="1) Select Frequency. 2) Set SPL. 3) Hit StartTest." ;End of 3-line Msg Note the comments on the first and last lines of the above macro. Comments can't be used within the message quotes, or they will be shown as part of the message. You can set text and background colors to alert the operator to special conditions. For example, MsgColr="255,0,0" sets the color of the text to red. The color is specified as a triplet of Red, Green, and Blue values, each ranging from 0 to 255. Note that the quotes around the color triplet are mandatory. The default color is black, equivalent to MsgColr="0,0,0". MsgBkColr="255,255,196" specifies the default "cream" background color for the message. MsgPos="p100,200" sets the upper left corner of the message box 100 pixels from the left border of the main Daqarta window, and 200 pixels below the menu bar. You may use negative values to set the position outside of the Daqarta window. The " p" before the X position specifies that both coordinates are in pixels. But you may prefer to use "dialog units" so that the message will appear in the same relative position even if you change the font preference to make the Daqarta window and all its controls larger or smaller. Dialog unit coordinates use the same reference position, so MsgPos="0,0" will place the box right on the Averager button in the toolbar. Each toolbar button is 40 units wide and 12 units tall, so MsgPos="240,12" will place the box just under the Trigger button. You may want to position a message near a Label or Field when prompting for entry of a subject ID. Label1 is at 29,288 and each Label or Field is 57 units wide and 13 units tall. Note that MsgPos only sets the upper left corner of the message, however, so if you want the box to be above a Label but not obscure it, you will have to set the vertical position by trial and error depending on how many lines of text are shown in the message. MsgPos applies to messages that have title bars and can thus be repositioned by dragging the title bar. (Left-click anywhere in the title bar, and move the mouse while holding the left button down.) Dragging changes the default message position just like MsgPos, so the next titled message will be shown at the new location unless another MsgPos is given first. MsgPosFix is used just like MsgPos, but it only applies to messages without title bars, which can't be dragged. The MsgPosFix position is maintained separately from the MsgPos position, and can only be changed by another MsgPosFix command. Untitled messages are typically used to show prompts near controls that must be changed, whereas titled messages are typically used as general prompts or status reports and can be dragged to any convenient location. The titled message position is thus saved across Daqarta sessions, but the untitled position is not. So, if a macro uses MsgPos, it may overwrite the preferred position that the user set in a prior session. If you nevertheless want to set a specific default position, you can do it with a macro variable and an IF test. See Example - Initial Msg Position under Macro Variables for details. Note that when Msg is used to request that the operator change some Daqarta control or enter data, the WaitChange command can suspend macro processing until that action has taken place. |
|||
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 |