Click or drag to resize

DriverSession::InvalidateAttributes

Invalidates the cached value of one or more attributes.

template <typename... Args>
void InvalidateAttributes(ViAttr attributeId, Args... args);

template <typename TRepCap, typename... Args>
void InvalidateAttributes(const PhysicalNameList<TRepCap>& physicalNames, ViAttr attributeId, Args... args);

template <typename TRepCap>
void InvalidateAttributes(const PhysicalNameList<TRepCap>& physicalNames, ViAttr attributeId);
               
template <typename... Args>
void InvalidateAttributes(ViSession Vi, ViAttr attributeId, Args... args);

template <typename TRepCap, typename... Args>
void InvalidateAttributes(ViSession Vi, const PhysicalNameList<TRepCap>& physicalNames, ViAttr attributeId, Args... args);
Parameters
Vi

[in] ViSession handle for the driver session.

physicalNames

[in] List of physical names for the repeated capabilities on which all of the supplied attribute cache values should be invalidated.

The PhysicalNamesList class used here is simply an alias for a std::vector of PhysicalName objects.

attributeId

[in] Attribute ID whose cache value should be invalidated (e.g. ACME4321_ATTR_TRIGGER_SOURCE).

args (variable argument list)

[in] Variable argument list of attribute IDs whose cache values should be invalidated.

Remarks

This function is used to invalidate the cached value of one or more attributes. Invalidating a cached attribute forces the driver to communicate with the instrument the next time the attribute is read or written.

For attributes associated with a repeated capability, the cached attribute values can be invalidated for specific repeated capabilities as indicated by the physicalNames parameter. If no physicalNames parameter is supplied, then the cached attribute values for all repeated capabilities are invalidated.

Example

The following example demonstrates use of the ReportError function.

C++
ViStatus _VI_FUNC acme4321_ConfigureArmCount(ViSession Vi, ViConstString RepCapIdentifier, ViInt32 ArmCount)
{
    // Invalidate the CLOCK_RATE attribute.  If CLOCK_RATE is associated with a repeated capability such
    // as a channel, then the cached CLOCK_RATE values for all channels will be invalidated.  If the CLOCK_RATE
    // is not associated with a repeated capability, then the one and only cached value will be invalidated.
    // 
    InvalidateAttributes(Vi, ACME4321_ATTR_CLOCK_RATE);

    // Invalidate the BANDWITH attribute on channels C1 and C2.
    // 
    PhysicalNameList<Channel> physicalNames{ "C1", "C2" };
    InvalidateAttributes(Vi, physicalNames, ACME4321_ATTR_BANDWIDTH);

    // ...
}

Download a complete CHM version of this documentation here.