Real-Time API Revision2025.1-3
Loading...
Searching...
No Matches
Signal Generator API
Collaboration diagram for Signal Generator API:

Functions

int ccurGen_addGenerator (const char *pointName, int endConditionType, int sigtype, float freq, float amplitude, float phase, float offset, float duty, float noise, double duration, void *userArg)
int ccurGen_addGeneratorP (const RTDBItem *pItem, int endConditionType, int sigtype, float freq, float amplitude, float phase, float offset, float duty, float noise, double duration, void *userArg)
int ccurGen_addAsamGenerator (const char *pointName, const char *asamFile)
int ccurGen_addSegmentGenerator (const char *pointName, const char *sigName, int repeat)
int ccurGen_addAsamGeneratorP (const RTDBItem *pItem, const char *asamFile)
int ccurGen_addSegmentGeneratorP (const RTDBItem *pItem, const char *sigName, int repeat)
int ccurGen_startGenerator (int genNumber)
int ccurGen_startAllGenerators ()
int ccurGen_stopGenerator (int genNumber)
int ccurGen_removeGenerator (int genNumber)
int ccurGen_stopAllGenerators ()
int ccurGen_removeAllGenerators ()
int ccurGen_appendGenerator (int first, int second)
int ccurGen_rampToValue (const char *pointName, double endValue, double rate, int initCondition, double initialValue)
int ccurGen_rampToValueP (const RTDBItem *pItem, double endValue, double rate, int initCondition, double initialValue)
int ccurGen_rampRate (const char *pointName, double duration, double rate, int initCondition, double initialValue)
int ccurGen_rampRateP (const RTDBItem *pItem, double duration, double rate, int initCondition, double initialValue)
int ccurGen_getGeneratorInfo (int genNumber, GeneratorInfo *info)

Detailed Description

This API is used by program running on the Real-Time host to access and configure signal generators.
Typically, those programs are script program that initialize signal generator at start-up time and attach an RTDB item value to it.

Function Documentation

◆ ccurGen_addGenerator()

int ccurGen_addGenerator ( const char * pointName,
int endConditionType,
int sigtype,
float freq,
float amplitude,
float phase,
float offset,
float duty,
float noise,
double duration,
void * userArg )

Attach a wave form generator to a RTDB point value for a specified duration or terminate with a user specified callback.
A test must be running before you can create and start a signal generator.

Warning
This function require long execution time as it generates an internal buffer of a one cycle wave used for DDS wave generation.
Parameters
pointNameThe name of the RTDB item to assign value to.
endConditionTypeOne of TDL_SiggenEndCondition. Either terminate when user specified time has expired or when the user supplied callback routine returns true;
sigtypeOne of SigType i.e. SIG_TYPE_SINE, SIG_TYPE_SQUARE, SIG_TYPE_TRIANGLE, SIG_TYPE_SAWTOOTH, SIG_TYPE_NOISE but NOT SIG_TYPE_RAMP reserved for ramp only.
freqThe frequency in Hz for the signal generator.
amplitudeThe amplitude in Engineering for the generator.
phaseThe phase in degree for the generator.
offsetThe offset in engineering units for the generator.
dutyThe duty cycle in % (0 to 100 %) for the generator.
noiseAdditional white component to add to the signal generator.
durationThe duration in seconds . Use -1 to run forever until the test is stopped.
userArgPointer to pass to the user callback routine at each call. Callback is not supported at this time.
Returns
> 0 The generator number on Sucess.
< 0 On Failure. Error can be any of the RTDB or GEN_xx failure code.
See also
simerrors.h

◆ ccurGen_addGeneratorP()

int ccurGen_addGeneratorP ( const RTDBItem * pItem,
int endConditionType,
int sigtype,
float freq,
float amplitude,
float phase,
float offset,
float duty,
float noise,
double duration,
void * userArg )

Attach a wave form generator to a RTDB point value for a specified duration or terminate with a user specified callback.
A test must be running before you can create and start a signal generator.

Warning
This function require long execution time as it generates an internal buffer of a one cycle wave used for DDS wave generation.
Parameters
pItemPointer to the RTDB item.
endConditionTypeOne of TDL_SiggenEndCondition. Either terminate when user specified time has expired or when the user supplied callback routine returns true;
sigtypeOne of SigType i.e. SIG_TYPE_SINE, SIG_TYPE_SQUARE, SIG_TYPE_TRIANGLE, SIG_TYPE_SAWTOOTH, SIG_TYPE_NOISE but NOT SIG_TYPE_RAMP reserved for ramp only.
freqThe frequency in Hz for the signal generator.
amplitudeThe amplitude in Engineering for the generator.
phaseThe phase in degree for the generator.
offsetThe offset in engineering units for the generator.
dutyThe duty cycle in % (0 to 100 %) for the generator.
noiseAdditional white component to add to the signal generator.
durationThe duration in seconds . Use -1 to run forever until the test is stopped.
userArgPointer to pass to the user callback routine at each call. Callback is not supported at this time.
Returns
> 0 The generator number on Sucess.
< 0 On Failure. Error can be any of the RTDB or GEN_xx failure code.
See also
simerrors.h

◆ ccurGen_addAsamGenerator()

int ccurGen_addAsamGenerator ( const char * pointName,
const char * asamFile )

Attach an ASAM wave form generator to an RTDB point value.
A test must be running before you can create and start a signal generator.

Parameters
pointNameThe name of the RTDB item to be driven.
asamFileThe name of the ASAM signal definition file.
Returns
> 0 The generator number on Sucess.
< 0 On Failure. Error can be any of the RTDB or GEN_xx failure code.
See also
simerrors.h

◆ ccurGen_addSegmentGenerator()

int ccurGen_addSegmentGenerator ( const char * pointName,
const char * sigName,
int repeat )

Attach an segemented wave form generator to an RTDB point value.
This is similar to a ASAM generator but the signal generator file is In the SigGenerators directory.
A test must be running before you can create and start a signal generator.

Parameters
pointNameThe name of the RTDB item to be driven.
sigNameThe name of the generator ; i.e. 'sig1', 'mysig', etc..
repeatThe number of time to repeat the segment when generating data.
Returns
> 0 The generator number on Sucess.
< 0 On Failure. Error can be any of the RTDB or GEN_xx failure code.
See also
simerrors.h

◆ ccurGen_addAsamGeneratorP()

int ccurGen_addAsamGeneratorP ( const RTDBItem * pItem,
const char * asamFile )

Attach an ASAM wave form generator to an RTDB point value.
A test must be running before you can create and start a signal generator.

Parameters
pItemPointer to the RTDB item to be driven.
asamFileThe name of the ASAM signal definition file.
Returns
> 0 The generator number on Sucess.
< 0 On Failure. Error can be any of the RTDB or GEN_xx failure code.
See also
simerrors.h

◆ ccurGen_addSegmentGeneratorP()

int ccurGen_addSegmentGeneratorP ( const RTDBItem * pItem,
const char * sigName,
int repeat )

Attach an segemented wave form generator to an RTDB point value.
This is similar to a ASAM generator but the signal generator file is In the SigGenerators directory.
A test must be running before you can create and start a signal generator.

Parameters
pItemPointer to the RTDB item to be driven.
sigNameThe name of the generator ; i.e. 'sig1', 'mysig', etc..
repeatThe number of time to repeat the segment when generating data.
Returns
> 0 The generator number on Sucess.
< 0 On Failure. Error can be any of the RTDB or GEN_xx failure code.
See also
simerrors.h

◆ ccurGen_startGenerator()

int ccurGen_startGenerator ( int genNumber)

Start the generator number genNum.

Parameters
genNumberA valid generator number returned by a call to ccurTDL_addGenerator.
Returns
0 On success. < 0 Any of TDL_xx error codes
See also
simerrors.h

◆ ccurGen_startAllGenerators()

int ccurGen_startAllGenerators ( )

Start all the generators that have been defined.
This does not start generators that are appended.

◆ ccurGen_stopGenerator()

int ccurGen_stopGenerator ( int genNumber)

Stop the generator genNum.

Parameters
genNumberThe number of the generator to stop.
Returns
0 On success.
< 0 TDL_GENERATORNOTFOUND if the generator cannot be found.

◆ ccurGen_removeGenerator()

int ccurGen_removeGenerator ( int genNumber)

Stop the generator genNum and remove it from the list of existing generators.

Parameters
genNumberThe number of the generator to stop.
Returns
0 On success.
< 0 TDL_GENERATORNOTFOUND if the generator cannot be found.

◆ ccurGen_stopAllGenerators()

int ccurGen_stopAllGenerators ( )

Stop all the generators that have been defined.

◆ ccurGen_removeAllGenerators()

int ccurGen_removeAllGenerators ( )

Stop all the generators that have been defined and remove them from the list of existing generators.

◆ ccurGen_appendGenerator()

int ccurGen_appendGenerator ( int first,
int second )

Append a second generator that starts running when the first has finished executing.
Both generators must have been created by a call to _addGenerator or _rampToValue or _rampRate.

Parameters
firstThe number of the first generator.
secondThe number of the generator that will start when first finished.
Returns
0 On success. < 0 If either generator cannot be found.

◆ ccurGen_rampToValue()

int ccurGen_rampToValue ( const char * pointName,
double endValue,
double rate,
int initCondition,
double initialValue )

Ramp up/down a RTDB point value to a specified value.
The function will keep running until the end value is attained.
A test must be running before you can create and start a ram signal.

Parameters
pointNameThe name of the RTDB item to assign value to.
endValueThe target end value.
rateThe rate in Units/Seconds at which to ramp the value of the item up or down.
initConditionThe initial value type for the ramp.
See also
GEN_SiggenInitValue .
Parameters
initialValueThis is the initial value for the point when initCondition is GEN_SIGGENINIT_USER.
Returns
> 0 The generator number on success.
< 0 On Failure. Error can be any of the RTDB or TDL failure code.
See also
simerrors.h

◆ ccurGen_rampToValueP()

int ccurGen_rampToValueP ( const RTDBItem * pItem,
double endValue,
double rate,
int initCondition,
double initialValue )

Ramp up/down a RTDB point value to a specified value.
The function will keep running until the end value is attained.
A test must be running before you can create and start a ram signal.

Parameters
pItemPointer to the RTDB item.
endValueThe target end value.
rateThe rate in Units/Seconds at which to ramp the value of the item up or down.
initConditionThe initial value type for the ramp.
See also
GEN_SiggenInitValue .
Parameters
initialValueThis is the initial value for the point when initCondition is GEN_SIGGENINIT_USER.
Returns
> 0 The generator number on success.
< 0 On Failure. Error can be any of the RTDB or TDL failure code.
See also
simerrors.h

◆ ccurGen_rampRate()

int ccurGen_rampRate ( const char * pointName,
double duration,
double rate,
int initCondition,
double initialValue )

Ramp up/down a RTDB point value for a specified duration.
The function will keep running for the duration specified by the call.

Parameters
pointNameThe name of the RTDB item to assign value to.
durationThe duration in seconds. Must be > 0.
rateThe rate in Units/Seconds at which to ram the value of the item up or down.
initConditionThe initial value type for the ramp.
See also
GEN_SiggenInitValue .
Parameters
initialValueThis is the initial value for the point when initCondition is GEN_SIGGENINIT_USER.
Returns
> 0 The generator number on success.
< 0 On Failure. Error can be any of the RTDB or TDL failure code.
See also
simerrors.h

◆ ccurGen_rampRateP()

int ccurGen_rampRateP ( const RTDBItem * pItem,
double duration,
double rate,
int initCondition,
double initialValue )

Ramp up/down a RTDB point value for a specified duration.
The function will keep running for the duration specified by the call.

Parameters
pItemPointer to the RTDB item.
durationThe duration in seconds. Must be > 0.
rateThe rate in Units/Seconds at which to ram the value of the item up or down.
initConditionThe initial value type for the ramp.
See also
GEN_SiggenInitValue .
Parameters
initialValueThis is the initial value for the point when initCondition is GEN_SIGGENINIT_USER.
Returns
> 0 The generator number on success.
< 0 On Failure. Error can be any of the RTDB or TDL failure code.
See also
simerrors.h

◆ ccurGen_getGeneratorInfo()

int ccurGen_getGeneratorInfo ( int genNumber,
GeneratorInfo * info )

Get the running status of the generator genNum .

Parameters
genNumberThe number of the generator to stop.
infoA pointer to a GeneratorStatus structure where the information is returned.
Returns
0 On success.
< 0 GEN_GENERATORNOTFOUND if the generator cannot be found, RTDB_POINTNOTFOUND if the RTDB attached to the generator cannot be found.