Table of Contents
hil_watchdog_set_other_expiration_state
Sets the state that the other outputs will be set to if the watchdog expires.
Description
The hil_watchdog_set_other_expiration_state function sets the state that the other outputs will be set to if the watchdog expires. The expiration states must be set prior to starting the watchdog timer using hil_watchdog_start. Currently there are no cards which allow this state to be configured.
Prototype
t_error hil_watchdog_set_other_expiration_state(t_card card, const t_uint channels[], t_uint num_channels, const t_double values[]);
Parameters
t_card card
A handle to the board, as returned by hil_open .
const t_uint32 [] channels
An array containing the numbers of the other output channels for which the expiration state should be set. Channel numbers are zero-based. Thus, channel 0 is the first channel, channel 1 the second channel, etc.
Select a board type from the list for board-specific details: .
t_uint32 num_channels
The number of channels specified in the channels array.
const t_double [] values
An array of doubles (t_double) in which each element contains the other value to which to set the corresponding channel in the other_channels array upon watchdog expiration. This array must be the same size as the other_channels array.
Return value
The return value is 0 if the other expiration states are configured 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_WATCHDOG_SET_OTHER_EXPIRATION_STATE_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_TOO_MANY_OTHER_OUTPUT_CHANNELS
Too many other output channels were specified.
QERR_INVALID_OTHER_OUTPUT_CHANNEL
One of the other output channels that was specified is not a valid channel number. Channel numbers range from 0 to one less than the number of channels.
QERR_MISSING_OTHER_OUTPUTS
The array of other output channels is NULL even though the number of other outputs specified is non-zero.
QERR_MISSING_OTHER_OUTPUT_BUFFER
The array of values is NULL even though the number of channels specified is non-zero.
Requirements
Include Files |
Libraries |
---|---|
hil.h |
hil.lib;quanser_runtime.lib;quanser_common.lib |
Examples
/*
* Configure the first two other outputs to go to 0 upon watchdog expiration.
*/
t_uint32 channels[] = { 0, 1 };
t_double values[] = { 0, 0 };
t_error result = hil_watchdog_set_other_expiration_state(card, channels, ARRAY_LENGTH(channels), values);
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.