gage_trigger_control Syntax C: int16 GAGEAPI gage_trigger_control (int16 source, int16 ext_coupling, int16 ext_gain, int16 slope, int16 level, int32 depth); Visual BASIC: Function gage_trigger_control (ByVal source As Integer, ByVal ext_coupling As Integer, ByVal ext_gain As Integer, ByVal slope As Integer, ByVal level As Integer, ByVal depth As Long) As Integer Remarks gage_trigger_control is used to set up the trigger parameters of the <strong>CompuScope</strong>. source can be either channel A, EXTERNAL or SOFTWARE and the constants GAGE_CHAN_A, GAGE_EXTERNAL and GAGE_SOFTWARE should be used to indicate their respective sources. ext_coupling can be either DC or AC for the external trigger input as indicated by the constants GAGE_DC and GAGE_AC respectively. The CS512 and CS512/PCI have TTL external trigger input, therefore this parameter has no effect. ext_gain can be either of the constants GAGE_PM_5_V or GAGE_PM_1_V for the external trigger input. The CS512 and CS512/PCI have TTL external trigger input therefore this parameter has no effect. slope is the trigger slope and can be either positive or negative. The constants GAGE_POSITIVE or GAGE_NEGATIVE should be used. level can be any value between 0 and 255. The values are scaled internally to match the trigger input range selected. The minimum input level is 0 while the maximum trigger level is 255 (these correspond to -1V and +1V respectively for the x1 input gain). The CS512 and CS512/PCI have TTL external trigger input, therefore this parameter has no effect. The depth parameter sets the trigger depth, that is, the number of samples captured after the trigger event. The minimum value is 0. This can help reduce the capturing overhead when only a few points of data are required. Several defined constants are available to the application programmer to illustrate the use of this parameter. The constants GAGE_POST_0K, GAGE_POST_1K, GAGE_POST_2K, GAGE_POST_4K, GAGE_POST_8K, GAGE_POST_16K, GAGE_POST_32K, GAGE_POST_64K and GAGE_POST_128K, GAGE_POST_256K, GAGE_POST_512K, GAGE_POST_1M, GAGE_POST_2M, GAGE_POST_4M and GAGE_POST_8M are for the trigger depths of 0, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304 and 8388608 bytes respectively. Other values besides these constants can be used. The depth parameter should be a multiple of the trigger resolution. If the depth is not a multiple of the trigger resolution, it is rounded up to the nearest multiple. Note: If external trigger is not used, some parameters such as ext_gain and ext_coupling have no effect. All the parameters, however, should be set to the valid values for the <strong>CompuScope</strong> board in use. <strong>CompuScope</strong> API Reference <strong>Manua</strong>l 87
Return Value A one is returned if successful and a zero is returned when the routine fails, and gage_get_error_code may be called to obtain the error code. The application program should always check the return values. See also gage_capture_mode, gage_input_control, gage_trigger_control_2 and see the Appendix: Data Structures Used by Gage Drivers in the <strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l. Examples C: gage_trigger_control (GAGE_CHAN_A, GAGE_DC, GAGE_PM_1_V, GAGE_POSITIVE, 160, GAGE_POST_16K); Visual BASIC: dummy = gage_trigger_control (GAGE_CHAN_A, GAGE_DC, GAGE_PM_1_V, GAGE_POSITIVE, 160, GAGE_POST_16K) <strong>CompuScope</strong> API Reference <strong>Manua</strong>l 88