hil_get_double_property hil_set_double_property navigation bar

Table of Contents

hil_get_hil_string_property

Gets the value of a string property of the board.

Description

The hil_get_hil_string_property function gets the value of a string property from the board. This function can only retrieve the value of one string property at a time. Standard string properties are listed in the table below. The board may also support product-specific string properties.

Property

Description

PROPERTY_STRING_MANUFACTURER

The name of the manufacturer of the board.

PROPERTY_STRING_PRODUCT_NAME

The product name for the board.

PROPERTY_STRING_MODEL_NAME

The model name for the board.

PROPERTY_STRING_SERIAL_NUMBER

The serial number of the board.

Prototype

t_error
hil_get_hil_string_property(t_card card, const t_hil_string_property properties[], t_uint32 num_properties, t_int buffer[]);
    

Parameters

t_card card

A handle to the board, as returned by hil_open

t_hil_string_property property_code

The number of the property to be retrieved. See the table in the description of this function for the standard string properties currently defined.

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

char * buffer

A character array for receiving the property value retrieved from the board. The array must contain buffer_size elements.

size_t buffer_size

The size of the buffer in code units (bytes).

Return value

The return value is 0 if all the properties are retrieved 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_GET_STRING_PROPERTY_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.

QERR_MISSING_PROPERTIES

No properties were specified even though the number of properties is nonzero.

QERR_MISSING_PROPERTIES_BUFFER

Properties have been specified but no values have been provided for the operation.

QERR_PROPERTY_NOT_RECOGNIZED

One or more of the specified properties were not recognized by the board-specific driver.

QERR_DRIVER_INCOMPATIBLE_WITH_BOARD_DLL

The board-specific HIL driver passed an invalid parameter to the operating system specific kernel-level driver for the board. The board-specific HIL driver is likely not compatible with the operating system specific kernel-level driver for the board. Make sure both are up-to-date and compatible versions.

QERR_INTERNAL_BUFFER_TOO_SMALL

The board-specific HIL driver used an internal buffer that was too small for the operating system specific kernel-level driver for the board. The board-specific HIL driver is likely not compatible with the operating system specific kernel-level driver for the board. Make sure both are up-to-date and compatible versions.

QERR_OUT_OF_REQUIRED_SYSTEM_RESOURCES

There are not enough system resources to perform the requested operation. Try rebooting, requesting fewer samples, or adding more memory to your machine.

Requirements

Include Files

Libraries

hil.h

hil.lib;quanser_runtime.lib;quanser_common.lib

Examples

char manufacturer[80];
t_error result = hil_get_hil_string_property(board, PROPERTY_STRING_MANUFACTURER, manufacturer, ARRAY_LENGTH(manufacturer));
    

 

navigation bar