ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Ivi_WriteInstrData work?

I know the answer is probably yes, but I can't get it to work at all.  I'm trying to communicate to an Agilent E4437B and I need to pass through some GPIB commands that I can't find in the IVI driver.  When I use the Ivi_WriteInstrData function I get an error that tells me the given session or object reference is invalid.  I have functions before it and after it that work fine, with the same session.  For example:
 
 status = Ivi_ValidateSession (instr_handle);  //  Returns a 0 indicating that it's a valid session
 
 status = IviRFSigGen_ConfigureRF (instr_handle, 1.0e6, -22.2);  //  Works
 
 status = Ivi_WriteInstrData (instr_handle, "*RST");  // returns error
 
 status = IviRFSigGen_ConfigureRF (instr_handle, 2.0e6, -22.2);   // Works
 
 status = agesg_WriteInstrData(instr_handle, "*RST");  // returns error
 
 status = agesg_ConfigureRF (instr_handle, 1e9, -33.3);  // Works
 
 IviRFSigGen_reset (instr_handle);  // Works
 
 
Does anyone have any ideas?
 
Thanks for your help.
0 Kudos
Message 1 of 3
(3,593 Views)
You are accessing the instrument through the RFSigGen class driver.  You can't pass the class driver's session handle (ViSession) directly to Ivi_WriteInstrData() and Ivi_ReadInstrData() functions, which require a "specific" session handle.  To aqcuire the specific session handle, you must use IviRFSigGen_GetSpecificDriverCHandle() function.
Message 2 of 3
(3,581 Views)
Thanks Makoto!!  Worked like a champ!
0 Kudos
Message 3 of 3
(3,571 Views)