10-19-2008 09:24 PM
I must write a GPIB command viprintf(),and the parameter get from user. the bleow useing viPrintf is right?
if(InstrumentName_status=viPrintf(instrSession,"TPCSTEMP",stepsize,"\n"<0) //is right to use
return InstrumentName_status;
there "TPCSTEMP" is a GPIB command ,stepsize is a parameter which ueser define .
and this is not main function,just a son function as a DLL document!
thank you!
Solved! Go to Solution.
10-20-2008 08:09 PM
Yes I think the return code (VISA status code) will be stored in InstrumentName_status, but this code writing is not good. Ideally storing the return value to a variable and IF condition statement must be separated.
InstrumentName_status = viPrintf(instrSession,"....");
if( InstrumentName_status < 0 ) {
...
}
Plus, this viPrintf call does not reflect the given parameter because there is no "%" identifier. You should write as
InstrumentName_status = viPrintf(instrSession,"TPCSTEMP %d\n", (int)stepsize);
10-20-2008 08:23 PM