PowerXpert™ Help : Programming Commands for USB Power Sensors : Trigger Commands
 
Trigger Commands
Trigger is an event that initiates a measurement. When the sensor is armed, it waits for a trigger. Once the trigger occurs, the sensor starts data collection, calculation, and averaging to complete a measurement.
Trigger commands must be sent after general setup of the power sensor as the general settings impact the trigger setup. Before arming the sensor for a trigger, the sensor must be set up with the following trigger related parameters:
Trigger Source
Trigger Level
Trigger Edge
Trigger Delay
Trigger Noise Immunity
Trigger Arming
Trigger Arming commands should be sent to the sensor last and just before triggering because any other type of command aborts the armed state and places the sensor in standby mode. For Time Slot and Scope modes, the sensor’s default arming state is standby.
Trigger Source
The power sensor supports four different types of triggers (trigger sources):
Continuous Trigger
When the trigger source is set to continuous, the sensor is continuously collecting data. It does not look for a trigger and is triggered all the time. Because the sensor is always collecting data, it does not depend on any other trigger related parameters.
Internal Trigger
If internal trigger source is set, the sensor triggers based on the signal power, edge and noise immunity factor set in the sensor. These parameters can be set with their respective commands as discussed later.
External Trigger
When the sensor is setup with external trigger, it is triggered by the TTL/CMOS signal on the external trigger pin. In this trigger source, sensor can be set up to trigger at a particular edge of the TTL/CMOS signal. External trigger does not depend on any other trigger related parameter.
Bus Trigger
Bus trigger is a manual trigger that allows the user to manually control the trigger by sending the TRGIMM command. The bus trigger is command based and is not set up like the other trigger sources, and it does not depend on any trigger-related parameters.
All of the trigger sources (except Bus Trigger) work in conjunction with the trigger arm types discussed later. A trigger setup is incomplete if the sensor is not armed. The trigger source can be set and read with the following commands:
TRGSRC
Description:
Sets the trigger source.
Syntax:
TRGSRC <trigger_source> +LF
Return Value:
OK or ERR
Remarks:
<trigger_source> is an integer with the following values:
0 – Continuous
1 – Internal
2 – External
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
TRGSRC?
Description:
Gets the trigger source.
Syntax:
TRGSRC? +LF
Return Value:
An integer with the following values:
0 – Continuous
1 – Internal
2 – External
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
TRGIMM
Description:
Triggers the sensor immediately and starts taking new readings.
Syntax:
TRGIMM +LF
Return Value:
Power reading in dBm or BUSY.
In Continuous mode, 1 power reading in dBm.
In scope/ Time Slot mode: $,<P1>,<P2>....,$
Remarks:
Once the sensor receives this command, the sensor starts collecting data for the capture time defined by the sensor’s mode. Once all data collection, calculation, and averaging is complete, the sensor automatically outputs the power reading and returns to the previous state (before TRGIMM was received). Upon receiving the TRGIMM command. the firmware automatically starts using repeat averaging type, irrespective of the type of average type set in the sensor.
Upon completion, if the sensor is in continuous mode, it outputs one power reading in dBm (same as the PWR? command) and if the sensor is in Scope or Time Slot mode, it sends the entire buffer out (like RDBUF command). If the power is requested (by sending PWR? or RDBUF commands) before the sensor is done with averaging, the sensor returns BUSY. In this case, the sensor will not send out the power value(s) automatically and will expect the user to continue requesting power. There is no need to arm the trigger when using bus trigger.
The sensor will not return anything when requesting power with TRGIMM while it's on hold (CHOLD 1), but it will continue to respond to power requests with BUSY until hold is turned off.
Compatible Sensor
MA24x08A, MA24x18A, MA24126A
MA243x0A is not applicable with Time Slot mode
Trigger Level
Trigger level is the power value that triggers the sensor when it is crossed. This parameter has no effect in continuous, external or bus trigger setups.
TRGLVL
Description:
Sets the trigger level in dBm.
Syntax:
TRGLVL <trigger_level> +LF
Return Value:
A float value
Remarks:
<trigger_level> For MA24108A, MA2418A, MA24126A must be from –20 dBm to +20 dBm in 0.01 dB steps.
<trigger_level> For MA24208A, MA24218A and MA243x0A must be from –35 dBm to
+20 dBm in 0.01 dB steps.
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
TRGLVL?
Description:
Gets the trigger level in dBm.
Syntax:
TRGLVL? +LF
Return Value:
Trigger level in dBm
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
Trigger Edge
Sets the trigger edge for internal and external trigger. Trigger edge can be set to positive or negative.
For internal trigger, the sensor triggers only when the signal crosses the trigger level from high to low when set to negative; the sensor triggers only when the signal crosses the trigger level from low to high when set to positive.
For external trigger, the sensor triggers when the TTL/CMOS signal on the external trigger pin falls from high to low when set to negative; the sensor triggers when the TTL/CMOS signal on the external trigger pin rises from low to high when set to positive.
TRGEDG
Description:
Sets the trigger edge.
Syntax:
TRGEDG <trigger_edge> +LF
Return Value:
OK or ERR
Remarks:
<trigger_edge> is an integer with the following values:
0 – Positive
1 – Negative
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
TRGEDG?
Description:
Gets the trigger edge setting.
Syntax:
TRGEDG? +LF
Return Value:
An integer with the following values:
0 – Positive
1 – Negative
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
Trigger Delay
Trigger delay is the time in milliseconds between the trigger event and when the sensor starts taking readings. The trigger delay can be either positive or negative. The trigger delay can be set from –5 ms to 10,000 ms with a resolution of 0.01 ms.
If the delay is negative, the sensor starts taking the readings before the trigger occurs and the total capture time includes the negative delay time. For example, for a capture time of 20 ms and a delay of –1 ms, the length of the capture would be from –1 ms to 19 ms, given the trigger occurs at time, t = 0. The negative delay can not be greater than or equal to the capture time. If the capture time conflicts with the trigger delay, the trigger delay command returns an error.
If the delay is positive, the sensor waits for the set delay time after a trigger before it starts taking readings. The sensor is unresponsive during the wait period and can not be aborted. The capture time is unaffected by a positive trigger delay.
TRGDLY
Description:
Sets the trigger delay in msec
Syntax:
TRGDLY <trigger_delay> +LF
Return Value:
OK or ERR
Remarks:
<trigger_delay> is the trigger delay value in msec and must range from –5 ms to 10,000 ms with a resolution of 0.01 ms.
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
TRGDLY?
Description:
Gets the trigger delay in msec
Syntax:
TRGDLY? +LF
Return Value:
A float value
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
 
Trigger Hold Off
Trigger hold off is the duration in which trigger detection is suppressed after detecting the first trigger event. The hold off duration can be set from 0 ms (off) to 10,000 ms with a resolution of 0.01 ms. Trigger delay must be positive or off in order to use trigger hold off. Trigger hold off is applicable to Scope and Time Slot modes.
The limitation of hold off is mode dependent and can be determined as the following (All time units are in msec):
In Scope mode, hold off - delay> (1.645 * capture time) + (0.042 * data points) + 0.24.
In Slot mode, hold off - delay> (1.625 * slot width * number of slots) + (0.064 * number of slots) + 0.29.
For MA243x0A; In Scope mode, hold off - delay> (8.238 * capture time) + (0.038 * data points) + 0.289. Time Slot mode is not applicable for the MA243x0A sensors.
TRGHOLDDLY
Description:
Sets the trigger hold off duration in msec.
Syntax:
TRGHOLDDLY <hold_off_duration> +LF
Return Value:
OK or ERR
Remarks:
<hold­_off_duration> is the trigger hold off duration in msec and must range from 0 ms to 10,000 ms with a resolution of 0.01 ms.
Compatible Sensor
MA24208A, MA24218A, MA243x0A
TRGHOLDDLY?
Description:
Gets the trigger hold off duration in msec.
Syntax:
TRGHOLDDLY? +LF
Return Value:
A float value
Compatible Sensor
MA24208A, MA24218A, MA243x0A
Trigger Noise Immunity
When internally triggering on very noisy signals, the sensor can trigger at an undesired point or edge. To provide immunity against such situations, the sensor can be set to wait for N number of samples to cross the trigger level before it triggers.
The value of N is the trigger noise immunity factor and is set by the TRGNOISE command, where N is a value from 1 to 10. Higher values of N result in increased noise immunity, but also increase the trigger latency. It is advised to use a negative trigger delay when using noise immunity. The negative delay required to reduce the trigger latency is the product of N and the sample duration of the power sensor, which is approximately 7 μs.
TRGNOISE
Description:
Sets the trigger noise immunity factor.
Syntax:
TRGNOISE <noise> +LF
Return Value:
OK
Remarks:
<noise> is an integer from 1 to 10. Higher values of <noise> result in increased noise immunity, but also increase the trigger latency.
Note: MA242x8A and MA243x0A always returns Ok (The MA242x8A and MA243x0A sensors are added for compatibility and do not support trigger noise immunity.)
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
MA242x8A and MA243x0A are added for compatibility and do not support trigger noise immunity.
TRGNOISE?
Description:
Gets the trigger noise immunity factor.
Syntax:
TRGNOISE? +LF
Return Value:
An integer from 1 to 10 for MA24108A, MA24118A, MA24126A
1 for MA24208A, MA24218A, MA243x0A
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
MA242x8A and MA243x0A are added for compatibility and do not support trigger noise immunity.
Hysteresis
This feature is available during internal triggering. For very noisy signals, the sensor can trigger at an undesired point or edge. To minimize this potential, the sensor can be set to wait for the measured power to be beyond a hysteresis value of +/– X dB from the trigger level before it is rearmed to trigger. The default value for the hysteresis level is +/– 0 dB (no hysteresis).
TRGHYST
Description:
Sets trigger hysteresis value, 0 to 10 dB with 0.1 dB of precision
Syntax:
TRGHYST <value>
Details:
<value> is an integer from 1 to 10
Return Value:
OK or ERR
Compatible Sensor:
MA24208A, MA24218A, MA243x0A
TRGHYST?
Description:
Reads the hysteresis value
Syntax:
TRGHYST? +LF
Return Value:
An integer from 1 to 10
Compatible Sensor:
MA24208A, MA24218A, MA243x0A
Trigger Arming
The trigger parameters are effective only if the sensor is armed. Armed is the state when the sensor is waiting for a trigger. By default, the sensor is in Standby mode and must be armed before it can be triggered. Trigger Arming should be the last command sent to the sensor before triggering as any other type of command aborts the armed state and places the sensor in standby mode.
When the sensor is armed, it waits for a trigger indefinitely. Once the trigger occurs, the sensor starts data collection, calculation, and averaging to complete a measurement. The measurement result is sent in dBm (in CA mode) or in mW (in Time Slot and Scope modes). After setting up the sensor, the sensor can be armed as follows:
Auto Armed
In this arming state, the sensor is automatically rearmed after one trigger has occurred and the measurement has been output. Auto Armed is generally used in Time Slot and Scope modes to continuously monitor the signal.
Single Armed
In this arming state, the sensor is armed only once before the trigger. Once triggered, the sensor performs the measurement, outputs the result, and returns to the standby mode. The sensor makes N number of measurement runs and outputs the average power on completion of averaging the N measurements. N is the averaging number set in the sensor. However, in moving average mode, the intermediate moving average power is also sent after each measurement run, the last one being the most accurate as it has the effect of all of the N measurements. The sensor triggers only once and all of the measurements follow.
Multiarmed
In this arming state, the sensor is automatically rearmed for N number of times after each of N trigger events, and then the sensor outputs one measurement result at the completion of all triggered events. N is the number of averages set in the sensor prior to arming (set with the AVGCNT command). If there are N averages set in the sensor, the sensor will look for N triggers, make N measurements and send out one averaged power for all of the N triggered measurements. However, in moving average mode, the intermediate, moving average power is also sent after each triggered measurement, the last one being the most accurate as it has the average of all of the N measurements. For multiarmed triggering, at least N triggers must occur for the sensor to complete the entire measurement. The sensor is rearmed until it has received all N number of triggers. Once the measurements are complete, the sensor is set to the Standby mode.
Standby
In standby mode, the sensor is not waiting for a trigger and is UNARMED.
Trigger arming is effective only in the Internal and External trigger modes. Arming has no effect when the sensor is continuously triggered.
TRGARMTYP
Description
Sets the trigger arming state.
Syntax
TRGARMTYP <arm_type> +LF
Return Value:
OK followed by measurement results, or ERR
Note: If user issues any command while the sensor is waiting for trigger, the sensor will return “Aborted” and will set TRGARMTYP to (3) – Standby state.
Remarks:
<arm_type> is an integer with the following values:
0 – Auto Armed
1 – Single Armed
2 – Multiarmed
3 – Standby
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A
TRGARMTYP?
Description:
Gets the trigger arming state.
Syntax:
TRGARMTYP? +LF
Return Value:
An integer with the following values:
0 – Auto Armed
1 – Single Armed
2 – Multiarmed
3 – Standby
Compatible Sensor
MA24x08A, MA24x18A, MA24126A, MA243x0A