Table of Contents
hil_set_clock_mode
The HIL API MATLAB functions have been deprecated in favour of the new quanser.hardware.hil class, which has support for code generation for Quanser targets. Hence, with the new hil class it is possible to run MATLAB scripts in real-time on Quanser targets, while making use of the Quanser hardware. |
Sets the modes of the specified hardware clocks.
err = hil_set_clock_mode(board, clocks, modes)
Sets the modes of the specified hardware clocks. There are two possible modes for hardware clocks:
Mode |
Name |
Comment |
---|---|---|
0 |
|
Use clock as hardware timebase - the default |
1 |
|
Use clock as PWM output |
Mode 0 configures the clock as a hardware timebase so it may be used with the HIL task-based I/O functions. This mode is the default if no mode is configured.
Mode 1 configures the clock as a PWM output so it may be used with the HIL PWM output functions. This mode is not available on many data acquisition cards.
If no err output is provided then it throws an exception if an error occurs. In generated code it prints the error message. Use hil_get_error_message to get the message associated with an error code.
board
The board handle returned by hil_open.
clocks
A vector of clock numbers for which the modes should be set. Hardware clocks are numbered incrementally
starting at 0, with 0 meaning HARDWARE_CLOCK_0
, 1 meaning HARDWARE_CLOCK_1
, etc. The number
of clocks available depends on the board selected. Refer to
Clocks for more information.
Select a board type from the list for board-specific details: .
modes
A vector of clock modes with each element been the mode for the corresponding element in the clocks parameter. The clock modes are described above.
err
A negative error code or zero on success.
hil_set_clock_mode(board, 0, 1); % Sets hardware clock 0 to PWM mode.
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.