hil_set_pwm_configuration hil_set_pwm_duty_cycle navigation bar

Table of Contents

hil_set_pwm_deadband

Deprecated

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 deadband employed for the specified PWM channels.

Syntax

err = hil_set_pwm_deadband(board, channels, leading_edge_deadband, trailing_edge_deadband)
    

Description

Sets the deadband employed for the specified PWM channels. This function is used only for the primary channel of a bipolar, complementary or paired PWM output.

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.

Parameters

board

A board handle returned by hil_open.

channels

A vector of channel numbers. Channel numbers are zero-based.

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

leading_edge_deadband

A vector of leading-edge deadband values in seconds. Each element corresponds to the channel at the same index in the channels vector.

trailing_edge_deadband

A vector of trailing-edge deadband values in seconds. Each element corresponds to the channel at the same index in the channels vector.

Outputs

err

A negative error code or zero on success.

Examples

hil_set_pwm_deadband(board, [0 2], [100e-9 50e-9], [100e-9 75e-9]); % Sets PWM channel 0 deadbands to 100ns and channel 2 deadbands to 50ns and 75ns
    

See Also

 

navigation bar