User can use IviFgen_SetAttribute for every public attribute. These functions are common for all attributes and they are exported for users. This is reason why some attributes don't have high-level function.
You can use tkawg5x0_Set/GetAttribute in code too, but I suggest use funcion Ivi_SetAttribute.
If you want implement high-level function which sets one attribute, use following example:
ViStatus _VI_FUNC tkawg5x0_ConfigurePulse(ViSession vi, ViConstString channelName, ViReal64 dutyCycle)
{
return Ivi_SetAttributeViReal64(vi, channelName, IVIFGEN_ATTR_FUNC_DUTY_CYCLE_HIGH, IVI_VAL_DIRECT_USER_CALL, dutyCycle);
}
Flag IVI_VAL_DIRECT_USER_CALL means that session should be locked and when value has been written to ins
trument, driver will call Check Staus Callback. (of course when check status is enabled.)
Implementation with IVI_VAL_DIRECT_USER_CALL is same as following implementation:
ViStatus _VI_FUNC tkawg5x0_ConfigurePulse(ViSession vi, ViConstString channelName, ViReal64 dutyCycle)
{
ViStatus error = VI_SUCCESS;
checkErr( Ivi_LockSession (vi, VI_NULL));
checkErr( Ivi_SetAttributeViReal64(vi, channelName, IVIFGEN_ATTR_FUNC_DUTY_CYCLE_HIGH, 0, dutyCycle));
checkErr( tkawg5x0_CheckStatus (vi));
Error:
Ivi_UnlockSession (vi, VI_NULL);
return error;
}
Zdenek