nScopeAPI  v0.8
Functions
nScopeAPI_pulseGenerators.h File Reference

contains function headers for controlling the nScope pulse outputs More...

Functions

NSCOPE_API ErrorType nScope_set_PX_on (ScopeHandle nScope, int pChannel, bool PXon)
 Set a pulse channel (on/off) More...
 
NSCOPE_API ErrorType nScope_get_PX_on (ScopeHandle nScope, int pChannel, bool *PXon)
 Get a pulse channel (on/off) More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_on (ScopeHandle nScope, bool P1on, bool P2on)
 Set the pulse channels (on/off) More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_on (ScopeHandle nScope, bool *pulseGensOn)
 Get the pulse channels (on/off) More...
 
NSCOPE_API ErrorType nScope_set_PX_frequency_in_hz (ScopeHandle nScope, int pChannel, double frequency)
 Set a pulse channel frequency in hz. More...
 
NSCOPE_API ErrorType nScope_get_PX_frequency_in_hz (ScopeHandle nScope, int pChannel, double *frequency)
 Get a pulse channel frequency in hz. More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_frequencies_in_hz (ScopeHandle nScope, double frequency1, double frequency2)
 Set the pulse channel frequencies in hz. More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_frequencies_in_hz (ScopeHandle nScope, double *pulseFrequencies)
 Get the pulse channel frequencies in hz. More...
 
NSCOPE_API ErrorType nScope_set_PX_period_in_ms (ScopeHandle nScope, int pChannel, double period)
 Set a pulse channel period in milliseconds. More...
 
NSCOPE_API ErrorType nScope_get_PX_period_in_ms (ScopeHandle nScope, int pChannel, double *period)
 Get a pulse channel period in milliseconds. More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_periods_in_ms (ScopeHandle nScope, double period1, double period2)
 Set a pulse channel periods in milliseconds. More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_periods_in_ms (ScopeHandle nScope, double *pulsePeriods)
 Get a pulse channel periods in milliseconds. More...
 
NSCOPE_API ErrorType nScope_set_PX_period_in_us (ScopeHandle nScope, int pChannel, double period)
 Set a pulse channel period in microseconds. More...
 
NSCOPE_API ErrorType nScope_get_PX_period_in_us (ScopeHandle nScope, int pChannel, double *period)
 Get a pulse channel period in microseconds. More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_periods_in_us (ScopeHandle nScope, double period1, double period2)
 Set a pulse channel periods in microseconds. More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_periods_in_us (ScopeHandle nScope, double *pulsePeriods)
 Get a pulse channel periods in microseconds. More...
 
NSCOPE_API ErrorType nScope_set_PX_duty_percentage (ScopeHandle nScope, int pChannel, double duty)
 Set a pulse channel duty percentage. More...
 
NSCOPE_API ErrorType nScope_get_PX_duty_percentage (ScopeHandle nScope, int pChannel, double *duty)
 Get a pulse channel duty percentage. More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_duty_percentages (ScopeHandle nScope, double duty1, double duty2)
 Set the pulse channel duty percentages. More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_duty_percentages (ScopeHandle nScope, double *dutyPercentages)
 Get the pulse channel duty percentages. More...
 
NSCOPE_API ErrorType nScope_set_PX_pulse_width_in_ms (ScopeHandle nScope, int pChannel, double pulseWidth)
 Set a pulse width in milliseconds on a pulse channel. More...
 
NSCOPE_API ErrorType nScope_get_PX_pulse_width_in_ms (ScopeHandle nScope, int pChannel, double *pulseWidth)
 Get a pulse width in milliseconds on a pulse channel. More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_pulse_widths_in_ms (ScopeHandle nScope, double pulseWidth1, double pulseWidth2)
 Set the pulse widths in milliseconds on the pulse channels. More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_pulse_widths_in_ms (ScopeHandle nScope, double *pulseWidths)
 Get the pulse widths in milliseconds on the pulse channels. More...
 
NSCOPE_API ErrorType nScope_set_PX_pulse_width_in_us (ScopeHandle nScope, int pChannel, double pulseWidth)
 Set a pulse width in microseconds on a pulse channel. More...
 
NSCOPE_API ErrorType nScope_get_PX_pulse_width_in_us (ScopeHandle nScope, int pChannel, double *pulseWidth)
 Get a pulse width in microseconds on a pulse channel. More...
 
NSCOPE_API ErrorType nScope_set_P1_P2_pulse_widths_in_us (ScopeHandle nScope, double pulseWidth1, double pulseWidth2)
 Set the pulse widths in microseconds on the pulse channels. More...
 
NSCOPE_API ErrorType nScope_get_P1_P2_pulse_widths_in_us (ScopeHandle nScope, double *pulseWidths)
 Get the pulse widths in microseconds on the pulse channels. More...
 
NSCOPE_API ErrorType nScope_send_PX_oneshot_pulse (ScopeHandle nScope, int pChannel, double pulseWidth)
 Send a single pulse out on a pulse channel. More...
 
NSCOPE_API ErrorType nScope_send_P1_P2_oneshot_pulses (ScopeHandle nScope, double pulseWidth1, double pulseWidth2)
 Send a single pulse out on both pulse channels. More...
 

Documentation

contains function headers for controlling the nScope pulse outputs

nScope has two pulse generators, P1 and P2, that output pulse signals from 0 to 5V. These signals are good for use with digital logic or for driving the logic of H-bridge controllers.

These functions provide control over the timing characteristics of the two pulse outputs.

Function Documentation

NSCOPE_API ErrorType nScope_get_P1_P2_duty_percentages ( ScopeHandle  nScope,
double *  dutyPercentages 
)

Get the pulse channel duty percentages.

The duty percentage is the ratio of the time the output is high to the total period of the pulse. A duty of 100% means the signal is always 5V, and a signal of 0V means the signal is always 0V.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]dutyPercentagespointer to an array of doubles to store the actual pulse duty percentages (0.0-100.0)
NSCOPE_API ErrorType nScope_get_P1_P2_frequencies_in_hz ( ScopeHandle  nScope,
double *  pulseFrequencies 
)

Get the pulse channel frequencies in hz.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]pulseFrequenciespointer to an array of doubles to store the actual pulse frequencies
NSCOPE_API ErrorType nScope_get_P1_P2_on ( ScopeHandle  nScope,
bool *  pulseGensOn 
)

Get the pulse channels (on/off)

A true state means the pulse channel is on and outputing voltage A false state means the pulse channel is held at ground

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]pulseGensOnpointer to boolean array to store the on/off states of the pulse channels
NSCOPE_API ErrorType nScope_get_P1_P2_periods_in_ms ( ScopeHandle  nScope,
double *  pulsePeriods 
)

Get a pulse channel periods in milliseconds.

The pulse period is the time between pulses on the output channel

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]pulsePeriodspointer to an array of doubles to store the actual pulse periods (ms)
NSCOPE_API ErrorType nScope_get_P1_P2_periods_in_us ( ScopeHandle  nScope,
double *  pulsePeriods 
)

Get a pulse channel periods in microseconds.

The pulse period is the time between pulses on the output channel

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]pulsePeriodspointer to an array of doubles to store the actual pulse periods (µs)
NSCOPE_API ErrorType nScope_get_P1_P2_pulse_widths_in_ms ( ScopeHandle  nScope,
double *  pulseWidths 
)

Get the pulse widths in milliseconds on the pulse channels.

The pulse width is the amount of time the signal is high (5V) during each cycle

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]pulseWidthspointer to an array of doubles to store the actual pulse widths (ms)
NSCOPE_API ErrorType nScope_get_P1_P2_pulse_widths_in_us ( ScopeHandle  nScope,
double *  pulseWidths 
)

Get the pulse widths in microseconds on the pulse channels.

The pulse width is the amount of time the signal is high (5V) during each cycle

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]pulseWidthspointer to an array of doubles to store the actual pulse widths (µs)
NSCOPE_API ErrorType nScope_get_PX_duty_percentage ( ScopeHandle  nScope,
int  pChannel,
double *  duty 
)

Get a pulse channel duty percentage.

The duty percentage is the ratio of the time the output is high to the total period of the pulse. A duty of 100% means the signal is always 5V, and a signal of 0V means the signal is always 0V.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[out]dutypointer to the actual pulse duty percentage (0.0-100.0)
NSCOPE_API ErrorType nScope_get_PX_frequency_in_hz ( ScopeHandle  nScope,
int  pChannel,
double *  frequency 
)

Get a pulse channel frequency in hz.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[out]frequencypointer to the actual pulse frequency of the channel
NSCOPE_API ErrorType nScope_get_PX_on ( ScopeHandle  nScope,
int  pChannel,
bool *  PXon 
)

Get a pulse channel (on/off)

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[in]PXonpointer to boolean to store the on/off state of the queried channel
NSCOPE_API ErrorType nScope_get_PX_period_in_ms ( ScopeHandle  nScope,
int  pChannel,
double *  period 
)

Get a pulse channel period in milliseconds.

The pulse period is the time between pulses on the output channel

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[out]periodpointer to the actual pulse period (ms) of the channel
NSCOPE_API ErrorType nScope_get_PX_period_in_us ( ScopeHandle  nScope,
int  pChannel,
double *  period 
)

Get a pulse channel period in microseconds.

The pulse period is the time between pulses on the output channel

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[out]periodpointer to the actual pulse period (µs) of the channel
NSCOPE_API ErrorType nScope_get_PX_pulse_width_in_ms ( ScopeHandle  nScope,
int  pChannel,
double *  pulseWidth 
)

Get a pulse width in milliseconds on a pulse channel.

The pulse width is the amount of time the signal is high (5V) during each cycle

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[out]pulseWidthpointer to the actual pulse width (ms)
NSCOPE_API ErrorType nScope_get_PX_pulse_width_in_us ( ScopeHandle  nScope,
int  pChannel,
double *  pulseWidth 
)

Get a pulse width in microseconds on a pulse channel.

The pulse width is the amount of time the signal is high (5V) during each cycle

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to query
[out]pulseWidthpointer to the actual pulse width (µs)
NSCOPE_API ErrorType nScope_send_P1_P2_oneshot_pulses ( ScopeHandle  nScope,
double  pulseWidth1,
double  pulseWidth2 
)

Send a single pulse out on both pulse channels.

The pulse width is the amount of time (ms) the signal is high (5V)

Not all pulse widths can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pulseWidth1the desired pulse width (ms) on P1
[in]pulseWidth2the desired pulse width (ms) on P2
NSCOPE_API ErrorType nScope_send_PX_oneshot_pulse ( ScopeHandle  nScope,
int  pChannel,
double  pulseWidth 
)

Send a single pulse out on a pulse channel.

The pulse width is the amount of time (ms) the signal is high (5V)

Not all pulse widths can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to use
[in]pulseWidththe desired pulse width (ms)
NSCOPE_API ErrorType nScope_set_P1_P2_duty_percentages ( ScopeHandle  nScope,
double  duty1,
double  duty2 
)

Set the pulse channel duty percentages.

The duty percentage is the ratio of the time the output is high to the total period of the pulse. A duty of 100% means the signal is always 5V, and a signal of 0V means the signal is always 0V.

Not all duty percentages can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]duty1the desired pulse duty percentage (0.0-100.0) on P1
[in]duty2the desired pulse duty percentage (0.0-100.0) on P2
NSCOPE_API ErrorType nScope_set_P1_P2_frequencies_in_hz ( ScopeHandle  nScope,
double  frequency1,
double  frequency2 
)

Set the pulse channel frequencies in hz.

Not all frequency values can be acheived, nScope will automatically choose the closest approximation

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]frequency1the desired frequency of P1
[in]frequency2the desired frequency of P2
NSCOPE_API ErrorType nScope_set_P1_P2_on ( ScopeHandle  nScope,
bool  P1on,
bool  P2on 
)

Set the pulse channels (on/off)

A true state means the pulse channel is on and outputing voltage A false state means the pulse channel is held at ground

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[out]P1ontrue: turn P1 on, false: turn it off
[out]P2ontrue: turn P2 on, false: turn it off
NSCOPE_API ErrorType nScope_set_P1_P2_periods_in_ms ( ScopeHandle  nScope,
double  period1,
double  period2 
)

Set a pulse channel periods in milliseconds.

The pulse period is the time between pulses on the output channel

Not all pulse periods can be acheived, nScope will automatically choose the closest approximation

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]period1the desired pulse period (ms) on P1
[in]period2the desired pulse period (ms) on P2
NSCOPE_API ErrorType nScope_set_P1_P2_periods_in_us ( ScopeHandle  nScope,
double  period1,
double  period2 
)

Set a pulse channel periods in microseconds.

The pulse period is the time between pulses on the output channel

Not all pulse periods can be acheived, nScope will automatically choose the closest approximation

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]period1the desired pulse period (µs) on P1
[in]period2the desired pulse period (µs) on P2
NSCOPE_API ErrorType nScope_set_P1_P2_pulse_widths_in_ms ( ScopeHandle  nScope,
double  pulseWidth1,
double  pulseWidth2 
)

Set the pulse widths in milliseconds on the pulse channels.

The pulse width is the amount of time the signal is high (5V) during each cycle

Not all pulse widths can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pulseWidth1the desired pulse width (ms) on P1
[in]pulseWidth2the desired pulse width (ms) on P2
NSCOPE_API ErrorType nScope_set_P1_P2_pulse_widths_in_us ( ScopeHandle  nScope,
double  pulseWidth1,
double  pulseWidth2 
)

Set the pulse widths in microseconds on the pulse channels.

The pulse width is the amount of time the signal is high (5V) during each cycle

Not all pulse widths can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pulseWidth1the desired pulse width (µs) on P1
[in]pulseWidth2the desired pulse width (µs) on P2
NSCOPE_API ErrorType nScope_set_PX_duty_percentage ( ScopeHandle  nScope,
int  pChannel,
double  duty 
)

Set a pulse channel duty percentage.

The duty percentage is the ratio of the time the output is high to the total period of the pulse. A duty of 100% means the signal is always 5V, and a signal of 0V means the signal is always 0V.

Not all duty percentages can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to set
[in]dutythe desired pulse duty percentage (0.0-100.0)
NSCOPE_API ErrorType nScope_set_PX_frequency_in_hz ( ScopeHandle  nScope,
int  pChannel,
double  frequency 
)

Set a pulse channel frequency in hz.

Not all frequency values can be acheived, nScope will automatically choose the closest approximation

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to set
[in]frequencythe desired pulse frequency of the channel
NSCOPE_API ErrorType nScope_set_PX_on ( ScopeHandle  nScope,
int  pChannel,
bool  PXon 
)

Set a pulse channel (on/off)

A true state means the pulse channel is on and outputing voltage A false state means the pulse channel is held at ground

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to turn on or off
[in]PXontrue: turn the channel on, false: turn it off
NSCOPE_API ErrorType nScope_set_PX_period_in_ms ( ScopeHandle  nScope,
int  pChannel,
double  period 
)

Set a pulse channel period in milliseconds.

The pulse period is the time between pulses on the output channel

Not all pulse periods can be acheived, nScope will automatically choose the closest approximation

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to set
[in]periodthe desired pulse period (ms) of the channel
NSCOPE_API ErrorType nScope_set_PX_period_in_us ( ScopeHandle  nScope,
int  pChannel,
double  period 
)

Set a pulse channel period in microseconds.

The pulse period is the time between pulses on the output channel

Not all pulse periods can be acheived, nScope will automatically choose the closest approximation

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to set
[in]periodthe desired pulse period (µs) of the channel
NSCOPE_API ErrorType nScope_set_PX_pulse_width_in_ms ( ScopeHandle  nScope,
int  pChannel,
double  pulseWidth 
)

Set a pulse width in milliseconds on a pulse channel.

The pulse width is the amount of time the signal is high (5V) during each cycle

Not all pulse widths can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to set
[in]pulseWidththe desired pulse width (ms)
NSCOPE_API ErrorType nScope_set_PX_pulse_width_in_us ( ScopeHandle  nScope,
int  pChannel,
double  pulseWidth 
)

Set a pulse width in microseconds on a pulse channel.

The pulse width is the amount of time the signal is high (5V) during each cycle

Not all pulse widths can be acheived, nScope will automatically choose the closest approximation.

Returns
nScope ErrorType
Parameters
[in]nScopenScope handle
[in]pChannelthe channel (1 or 2) to set
[in]pulseWidththe desired pulse width (µs)