Table of Contents
quanser.hardware.hil.set_clock_mode
Sets the modes of the specified hardware clocks.
err = board.set_clock_mode(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 instance returned by the quanser.hardware.hil.open function.
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.
board.set_clock_mode(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.