Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Default value of IVI_ATTR_QUERY_INSTR_STATUS really TRUE?

Hi,

I use the following code in my instrument driver:

ViStatus _VI_FUNC Norma5xx_InitWithOptions (ViRsrc resourceName, ViBoolean IDQuery,
ViBoolean resetDevice, ViString optionString,
ViSession *newVi)
{
ViStatus error = VI_SUCCESS;
ViSession vi = VI_NULL;
ViChar newResourceName[IVI_MAX_MESSAGE_BUF_SIZE];
ViChar newOptionString[IVI_MAX_MESSAGE_BUF_SIZE];
ViBoolean isLogicalName;
ViBoolean bit;

if (newVi == VI_NULL)
{
Ivi_SetErrorInfo (VI_NULL, VI_FALSE, IVI_ERROR_INVALID_PARAMETER,
VI_ERROR_PARAMETER5, "Null address for Instrument Handle");
checkErr( IVI_ERROR_INVALID_PARAMETER);
}

*newVi = VI_NULL;

checkErr( Ivi_GetInfoFromResourceName (resourceName, optionString, newResourceName,
newOptionString, &isLogicalName));

/* create a new interchangeable driver */
checkErr( Ivi_SpecificDriverNew ("Norma5xx", newOptionString, &vi));

/* init the driver */
checkErr( Norma5xx_IviInit (newResourceName, IDQuery, resetDevice, vi));



bit = Ivi_QueryInstrStatus (vi);

if (isLogicalName)
checkErr( Ivi_ApplyDefaultSetup (vi));
*newVi = vi;

Error:
if (error < VI_SUCCESS)
Ivi_Dispose (vi);

return error;
}

The optionsString I pass from Norma5xx_init is "". According to the manual then IVI_ATTR_QUERY_INSTR_STATUS gets set to the default value TRUE. However if I check the boolean 'bit' in the code above its FALSE(0). It's only TRUE(1) if I explicitly set QueryInstrStatus=1 in the optionsString. Does that mean that the manual is wrong and the default value for IVI_ATTR_QUERY_INSTR_STATUS is false?

Thanks and best regards,
Marcus
0 Kudos
Message 1 of 3
(2,775 Views)
Hi Marcus

Due to the name of this functions (Norma5xx) I guess that the functions are not from NI but from LEM Instruments.
So I think the best way to resolve your problem is to contact LEM. Unfortunately I can't say something about the functions or manuals from LEM.

regards

Manuel
0 Kudos
Message 2 of 3
(2,757 Views)
Hi Manuel,

Thanks a lot for your reply.

However the question I have and the functions I use are not device specific, ie it has nothing to do with the the LEM device.

The question is, that the 'Instrument Driver Developers Guide' from NI says, that the default value for IVI_ATTR_QUERY_INSTR_STATUS is true, means it gets set to true if you pass an empty optionsString to the Prefix_InitWithOptions function. However if I pass an empty optionsString to my Norma5xx_InitWithOptions function above and then test the varibale 'bit' it's not true it's false. The question is now why?

Thanks for any hints,
rgds,
Marcus

Message Edited by Marcus3967 on 06-27-2005 04:19 AM

0 Kudos
Message 3 of 3
(2,742 Views)