23.11.2014 Views

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

gage_input_control<br />

Syntax<br />

C:<br />

int16 GAGEAPI gage_input_control (int16 channel, int16 enable, int16 coupling, int16 gain);<br />

Visual BASIC:<br />

Function gage_input_control (ByVal channel As Integer, ByVal enable As Integer,<br />

ByVal coupling As Integer, ByVal gain As Integer) As Integer<br />

Remarks<br />

gage_input_control is used to set up the input parameters for each signal input channel on <strong>CompuScope</strong><br />

hardware.<br />

The channel parameter is either channel A (constant GAGE_CHAN_A defined in GAGE_DRV.H) or<br />

channel B (constant GAGE_CHAN_B defined in GAGE_DRV.H).<br />

The enable parameter either enables the channel to capture data or disables the data capture on that<br />

channel. The constants GAGE_INPUT_ENABLE or GAGE_INPUT_DISABLE should be used. This<br />

functionality is not useful on modern <strong>CompuScope</strong>s and the user should simply enable all channels.<br />

coupling controls the input coupling (either DC or AC ) and is set using the constants GAGE_DC and<br />

GAGE_AC.<br />

The gain parameter controls the input ranges for each input channel. Possible constants are listed in the<br />

Appendix: Data Structures Used by <strong>CompuScope</strong> Drivers in the <strong>CompuScope</strong> C/C++ <strong>SDK</strong> <strong>Manua</strong>l. For<br />

instance, in order to set the input range to ±1 Volts, the user should assign GAGE_PM_1_V to the gain<br />

parameter.<br />

In single channel mode, both channels should be set to the same parameters.<br />

To set the impedance for an input channel, the gain should be bitwise "ORed" with the desired impedance,<br />

either GAGE_1_MOHM_INPUT or GAGE_50_OHM_INPUT. For instance, in order to set the input<br />

range to ±1 Volts with an input impedance of 50 Ohms, the user should assign (GAGE_PM_1_V |<br />

GAGE_50_OHM_INPUT) to the gain parameter, where "|" is C syntax for bit-wise OR.<br />

Some <strong>CompuScope</strong>s, such as the <strong>CompuScope</strong> 1610, support two input types: single-ended or differential.<br />

To set the input type for an input channel, the gain should be bitwise "ORed" with the desired input type,<br />

either GAGE_SINGLE_ENDED_INPUT or GAGE_DIFFERENTIAL_INPUT. For instance, in order to<br />

set the input range to ±1 Volts and input type of differential, the user should assign (GAGE_PM_1_V |<br />

GAGE_DIFFERENTIAL_INPUT) to the gain parameter, where "|" is C syntax for bit-wise OR.<br />

Return Value<br />

A 1 is returned if the routine has successfully set the requested input control parameters. A 0 is returned if<br />

the routine fails to implement requested input control parameters. gage_get_error_code may be called to<br />

obtain the error code. You should always check the return value.<br />

See also: gage_trigger_control_2 and gage_capture_mode<br />

Examples<br />

C: gage_input_control (GAGE_CHAN_A, GAGE_INPUT_ENABLE, GAGE_DC, GAGE_PM_1_V |<br />

GAGE_1_MOHM_INPUT);<br />

Visual BASIC: dummy = gage_input_control (GAGE_CHAN_A, GAGE_INPUT_ENABLE,<br />

GAGE_DC,GAGE_PM_1_V OR GAGE_1_MOHM_INPUT)<br />

<strong>CompuScope</strong> API Reference <strong>Manua</strong>l 38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!