Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Enable Agilent 33210A output without erasing settings

Solved!
Go to solution

Hi All,

 

I am controlling an Agilent 33210A function generator over USB with the IVI drivers installed on the host PC. I am trying to write a utility that compiles to an executable which will configure the generator and enable/disable output. I want to allow for a scenario where the user configures the function generator once, and then enables/disables its output repeatedly over time. I initialize the instrument with the hp33210a_init call, configure it, turn on output, and then use the hp33210a_close function to let go of the handle and end things. This works.

 

My problem is that the only way I can configure the instrument is by overwriting the settings on it. Once it's set up, I want to be able to enable/disable output using the settings that are currently on the instrument. I have tried to use the hp33210a_init to NOT reset the instrument when all I want is to enable/disable output, but the same thing happens- the instrument goes back to its factory defaults from the settings I put on it before - settings that worked. How can I enable/disable output by using my executable utility without enetering new settings, which exits once the user issued a command on the prompt (my utility works over the command line)?

 

Thanks for everyone's help!

0 Kudos
Message 1 of 6
(5,167 Views)
Some additional information, just in case... I'm using Labwindows/CVI 8.5, with the newest Agilent/HP 33210A driver available from NI.com... I've got IVI Foundation 4.0 installed as well.
0 Kudos
Message 2 of 6
(5,158 Views)

Hello Dima2882,

 

The following function is part of the drivers that I downloaded from here. It looks like it just enables/disables the device.

 

ViStatus hp33120a_ConfigureOutputEnabled (ViSession instrumentHandle, ViChar _VI_FAR channelName[], ViBoolean outputEnabled); Purpose This function configures whether the signal the function generator produces appears at the output channel you specify. The driver sets the HP33120A_ATTR_OUTPUT_ENABLED attribute to the value you pass in the Output Enabled parameter.

 

If this is not what you were looking for, post a couple lines of code, so I can see what you are currently doing, and describe why it doesn't work.

 

Regards,

---

Peter Flores
Applications Engineer
0 Kudos
Message 3 of 6
(5,135 Views)

Hi Peter, thanks for your reply.

 

Here's what I've got that works and sets up the function generator properly (it's a snippet obviously):

cmdStatus = hp33120a_init ("33210A_Func_Gen", VI_TRUE, VI_FALSE, &PPS_funcGen); cmdStatus = hp33120a_ConfigureStandardWaveform (PPS_funcGen, "1", HP33120A_VAL_WFM_PULSE, ppVoltageLevel, (ppVoltageLevel/2), pulseFreq, 0.00); cmdStatus = hp33120a_ConfigurePulse (PPS_funcGen, "1", pulsePeriod, highPulseTime, 20.0e-9); cmdStatus = hp33120a_ConfigureOutputEnabled (PPS_funcGen, "1", VI_TRUE); cmdStatus = hp33120a_close (PPS_funcGen);

At this point my utility goes quits... However, let's say I did this and later want to disable output without removing any of the pulse settings... I'll do this:

 

cmdStatus = hp33120a_init ("33210A_Func_Gen", VI_TRUE, VI_FALSE, &PPS_funcGen); cmdStatus = hp33120a_ConfigureOutputEnabled (PPS_funcGen, "1", VI_FALSE); cmdStatus = hp33120a_close (PPS_funcGen);

 When I do this , the output does indeed get disabled and my utility exists... However the settings go back to the factory defaults. I do not want this...What could I do?

 

 

0 Kudos
Message 4 of 6
(5,133 Views)
Solution
Accepted by topic author Dima2882

Dima2882,

 

The IVI drivers are programmed to load the default settings during the init call. Here are a couple of suggestions, in order of highest recommendation:

  1. Keep the same driver session open. If you keep the program active on the comand prompt, then you can keep the initial session open the whole time allowing you to enable/disable without changing any settings.
  2. Explicitly set your configuration options each time you open the session. So every call to init is always followed by the ConfigureStandardWaveform and ConfigurePulse calls.
  3. The next two will involve you going into the drivers, making changes and rebuilding them. Change the default settings to match those that you want. This way when the init calls the default settings, they are the settings you want.
  4. Change the driver so that the init call does not make the call to the default settings.

The first 2 are preferred as you will not have to alter the drivers, and reduce the risk on introducing more complication. If they will not be suitable for your application, you should use CVI to open the driver source, make the changes, then rebuild the drivers.

 

Let me know your thoughts.

 

Regards,

---

Peter Flores
Applications Engineer
Message 5 of 6
(5,110 Views)

Great! Basically, you confirm my current observation.

 

My requirements force me to close the session once the instrument is configured. So, the "painless" option is out. For now I will follow your option #2, but in the near future I will be changing the driver and living with the consequences.

 

Thank you for taking the time to answer my question. Yay for the forum 🙂

0 Kudos
Message 6 of 6
(5,105 Views)