hil_set_pwm_configuration hil_get_hil_string_property navigation bar

Table of Contents

hil_set_card_specific_options

Sets options specific to the data acquisition card.

Description

The hil_set_card_specific_options function sets options specific to a particular card. The options parameter is a string containing the card-specific options. The string typically takes the form:

            <name>=<value>,<name>=<value>,...
        

where <name> is the name of an option and <value> is the option's value. In general, spaces should be avoided. Spaces may be contained in values if the value is enclosed in double quotes. For example, in the hypothetical options string below, the value of the vendor option contains a space so it is enclosed in quotes.

char options[] = "vendor=\"National Instruments\",terminal_board=e_series";

Refer to the card's documentation for details on the options supported by the card. Many cards do not support any options since the standard HIL API functions cover most, if not all, of their functionality.

Prototype

t_error
hil_set_card_specific_options(t_card card, const char * options, size_t options_size);
    

Parameters

t_card card

A handle to the board, as returned by hil_open.

const char * options

A string containing the options. See the standard format of this argument in the discussion above. The string should be null terminated although the options_size argument may be used to circumvent this requirement by providing the actual length of the string.

Select a board type from the list for board-specific details: .

size_t options_size

The maximum number of characters that will be used from the options string. If the options string is null-terminated then this argument may be set to MAX_STRING_LENGTH.

Return value

The return value is 0 if the card-specific options are set successfully. Otherwise a negative error code is returned. Error codes are defined in quanser_errors.h. A suitable error message may be retrieved using msg_get_error_message.

Error codes

QERR_HIL_SET_CARD_SPECIFIC_OPTIONS_NOT_SUPPORTED

This function is not supported by the board-specific HIL driver for this board type.

QERR_INVALID_CARD_HANDLE

An invalid card handle was passed as an argument. Once a card has been closed using hil_close the card handle is invalid.

Requirements

Include Files

Libraries

hil.h

hil.lib;quanser_runtime.lib;quanser_common.lib

Examples


/*
* Configure a National Instruments PCI-6259 card for use with a Quanser E-Series
* terminal board.
*/

t_error result = hil_set_card_specific_options(card, "terminal_board=e_series", MAX_STRING_LENGTH);
    

 

navigation bar