BL4S200 User’s Manual
98
setPPM_H
int setPPM_H(int channel, float frequency, float offset,
float duty, char mode, char bind_offset, char bind_duty);
FUNCTION DESCRIPTION
Sets up a PPM output on the selected high-current output channel with the specified
frequency, offset, and duty cycle. The PPM output can be set to any of its three states
during either phase of the PPM signal. The offset and duty of the PPM can be bound to
a PWM/PPM on another channel on the same RIO block so that they share an edge.
PARAMETERS
channel
high-current output channel being set up for PPM,
0–7 (HOUT0–HOUT7)
frequency
PPM frequency in Hz (should be from 2 Hz to 50 kHz); use -1 to
preserve the existing frequency on the RIO block
offset
PPM offset (should be from 0 to 100%); use -1 and
bind_offset
parameter to use bound edge to set the offset (an offset above
100.0% will be set to 100.0%)
NOTE:
A zero offset will produce the smallest offset possible, which is one count. If you
must have a zero offset, use
setPWM_H()
instead of
setPPM_H()
.
duty
PPM duty cycle (should be from 0 to 100%); use -1 and
bind_
duty
parameter to use bound edge to set the duty cycle (a PPM
duty cycle above 100.0% will be set to 100.0%)
set to 25%, duty in range 75-100% will have the same effect
NOTE:
PPM will not wrap around the PPM period. If
offset
is set to 25%, the 75 to
100% duty cycle will have the same effect as
offset
= 25%,
duty
= 75%. The same
waveform as a wrapped PPM can be created using an inverted PPM
mode
sets the normal or begin state and the pulsed state of the PPM out-
put using these macros:
HCPWM_TRI_LOW
— normally tristated and pulsed to sinking
HCPWM_TRI_HIGH
— normally tristated and pulsed to sourcing
HCPWM_LOW_HIGH
— normally sinking and pulsed to sourcing
HCPWM_HIGH_LOW
— normally sourcing and pulsed to sinking
HCPWM_LOW_TRI
— normally sinking and pulsed to tristate
HCPWM_HIGH_TRI
— normally sourcing and pulsed to tristate
bind_offset
use
BL_BIND_LEAD
or
BL_BIND_TRAIL
to enable binding for the
leading edge of the PPM signal to another PWM or PPM output on
a channel hosted by same RIO chip and block. Bindings allow
PWM and PPM outputs to align their leading and trailing edges.
electronic components distributor