Selects the trigger source and sets up its parameters. This trigger is used to initiate a scan using the following Universal Library functions:
set_trigger(board_num, trig_type, low_threshold, high_threshold)
board_num (int)
The number associated with the board when it was installed with InstaCal or created with create_daq_device().
trig_type (TrigType)
Specifies the type of triggering based on the external trigger source. Set it to one of the constants in the trig_type parameter values section below.
low_threshold (int)
Selects the low threshold used when the trigger input is analog. The range depends upon the resolution of the trigger circuitry. Must be 0 to 255 for 8-bit trigger circuits, 0 to 4,095 for 12-bit trigger circuits, and 0 to 65,535 for 16-bit trigger circuits. Refer to the Analog Trigger Notes section below.
When the trigger input is a digital pattern, low_threshold selects the pattern value.
high_threshold (int)
Selects the high threshold used when the trigger input is analog. The range depends upon the resolution of the trigger circuitry. Must be 0 to 255 for 8-bit trigger circuits, 0 to 4,095 for 12-bit trigger circuits, and 0 to 65,535 for 16-bit trigger circuits. Refer to the Analog Trigger Notes section below.
When the trigger input is a digital pattern, high_threshold selects the port mask.
Trigger source | Type | Explanation |
Analog | GATE_NEG_HYS | Scanning is enabled as long as the external analog trigger input is more positive than high_threshold. Hysteresis is the level between low_threshold and high_threshold. |
GATE_POS_HYS | Scanning is enabled as long as the external analog trigger input is more negative than low_threshold. Hysteresis is the level between low_threshold and high_threshold. | |
GATE_ABOVE | Scanning is enabled as long as the external analog trigger input is more positive than high_threshold. | |
GATE_BELOW | Scanning is enabled as long as the external analog trigger input is more negative than low_threshold. | |
GATE_IN_WINDOW | Scanning is enabled as long as the external analog trigger is inside the region defined by low_threshold and high_threshold. | |
GATE_OUT_WINDOW | Scanning is enabled as long as the external analog trigger is outside the region defined by low_threshold and high_threshold. | |
TRIG_ABOVE | Scanning begins when the external analog trigger input transitions from below high_threshold to above. Once conversions are enabled, the external trigger is ignored. | |
TRIG_BELOW | Scanning begins when the external analog trigger input transitions from above low_threshold to below. Once conversions are enabled, the external trigger is ignored. | |
TRIG_RISING | Scanning begins when the external analog trigger input transitions from below low_threshold to above high_threshold. Once conversions are enabled, the external trigger is ignored. | |
TRIG_FALLING | Scanning begins when the external analog trigger input transitions from above high_threshold to below low_threshold. Once conversions are enabled, the external trigger is ignored. | |
Analog Trigger Notes
| ||
Digital | GATE_HIGH | Scanning is enabled as long as the external digital trigger input is 5V (logic HIGH or '1'). |
GATE_LOW | Scanning is enabled as long as the external digital trigger input is 0V (logic LOW or '0'). | |
TRIG_HIGH | Scanning begins when the external digital trigger is 5V (logic HIGH or '1'). Once conversions are enabled, the external trigger is ignored. | |
TRIG_LOW | Scanning begins when the external digital trigger is 0V (logic LOW or '0'). Once conversions are enabled, the external trigger is ignored. | |
TRIG_PATTERN_EQ | Scanning begins when the digital port value AND bitwise mask are equal to the pattern value AND bitwise mask. Once conversions are enabled, the external trigger is ignored. | |
TRIG_PATTERN_NE | Scanning begins when the digital port value AND bitwise mask are not equal to the pattern value AND bitwise mask. Once conversions are enabled, the external trigger is ignored. | |
TRIG_PATTERN_ABOVE | Scanning begins when the digital port value AND bitwise mask are greater than the pattern value AND bitwise mask. Once conversions are enabled, the external trigger is ignored. | |
TRIG_PATTERN_BELOW | Scanning begins when the digital port value AND bitwise mask are less than the pattern value AND bitwise mask. Once conversions are enabled, the external trigger is ignored. | |
TRIG_POS_EDGE | Scanning begins when the external digital trigger transitions from 0V to 5V (logic LOW to HIGH). Once conversions are enabled, the external trigger is ignored. | |
TRIG_NEG_EDGE | Scanning begins when the external digital trigger transitions from 5V to 0V (logic HIGH to LOW). Once conversions are enabled, the external trigger is ignored. | |
Digtal Trigger Notes
|
Perform this procedure to calculate the threshold:
Abs (–FS – threshold in volts) ÷ (LSB) = threshold in counts
Calculate the LSB: LSB = 20 ÷ 28 = 20 ÷ 256 = 0.078125
Calculate the threshold: Abs(–10 – (–5)) ÷ 0.078125 = 5 ÷ 0.078125 = 64 (round this result if it is not an integer). A count of 64 translates to a voltage threshold of –5.0 V.
Calculate the LSB: LSB = 20 ÷ 212 = 20 ÷ 4096 = 0.00488
Calculate the threshold: Abs(–10 – 1) ÷ 0.00488 = 11 ÷ 0.00488 = 2254 (rounded from 2254.1). A count of 2254 translates to a voltage threshold of 0.99952 V.