HP (Hewlett-Packard) Drive Network Card User Manual


 
Using IVI with Visual C++
27
#endif
int main(int argc, _TCHAR* argv[])
{
ViSession session;
ViStatus error = VI_SUCCESS;
ViReal64 reading;
checkErr( hp34401a_InitWithOptions ("GPIB::23::INSTR",
VI_FALSE, VI_TRUE, "Simulate=1", &session));
checkErr( hp34401a_ConfigureMeasurement (session,
HP34401A_VAL_DC_VOLTS, 1.5, 0.0001));
checkErr( hp34401a_ConfigureTrigger (session,
HP34401A_VAL_IMMEDIATE, 0.01));
checkErr( hp34401a_Read (session, 1000, &reading));
printf ("Reading = %f", reading);
Error:
if (error != VI_SUCCESS)
{
ViChar errStr[2048];
hp34401a_GetError (session, &error, 2048, errStr);
printf ("Error!", errStr);
}
if (hp34401a)
hp34401a_close (hp34401a);
}
Build and Run the Application
Build your application and run it to verify it works properly.