Hi,
The Ivi_SetAttributeViInt32 is the function used to set a new value for particular attribute. This is the function you would use through your code. For example, if there is an attribute RANGE, you would call the SetAttribute function every time you want to change the range value.
the Ivi_SetAttrWriteCallbackViInt32 is used in the initialization of you driver to pass the IVI the Write Callback function for a particular attribute. The callback function is usually the function that performs the I/O with the instrument. The callback is executed everytime you set a new value to an attribute.
For example, you could define a callback:
Range_callback(...)
{
//Send GPIB command to set range
}
Use the Ivi_SetAttrWriteCallbackViInt32 to assign tha
t callback to the attribute RANGE.
Now everytime you call Ivi_SetAttributeViInt32 to set a new range value, the IVI engine automatically calls the Range_callback, which actually sends the new value to the instrument.
The advantage of this approach is the IVI engine performs automatic state caching. If the attribute RANGE already has the value you are trying to set, there is no need to call the range_callback.
Hope this helps,
DiegoF.
National Instruments.