Hi,

I try to communicate with the AWG 33522A using Matlab and the "device object" environment. For this I download the Matlab driver for the agilent website ("IVI-COM, IVI-C Version 1.0.7.0 for 3352X for 32-bit Windows ") and I install it on my computer.

Then I search what is the name of the driver using the Matlab command : *+instrhwinfo('ivi').+*

After finding what name of driver could the good one in the list (here I find one called *+'Ag3352x.Ag3352x'+*), I convert it into a Matlab Driver using : *+makemid('Ag3352x.Ag3352x','Ag33522A.mdd');+*

I can now create a Device object using this driver : *+awg = icdevice('Ag33522A.mdd', 'TCPIP0::A-33522A-00132.local::inst0::INSTR');+*

On my matlab Workspace appear the icdevice object *+awg+*. You can now open a session : *+connect(awg)+*

If you double click on the object in the workspace you have acces to a lot of the parameters of the AWG. Or you can call the function *+set+* and modify some of these parameters.

For example the following lines turn on the output of both channels :

*+for i =1:2+*

*+set(awg.Channeloutput(i), 'Enabled', 'on');+*

*+end+*

BUT here is the problem, I want to modify let say the Sample Rate of both channel. The corresponding property *+awg.Channeloutputfunctionarbitrarywaveformsrate+* is only a 1 dimensionnal object ! I can only change channel 1... (as a contrary *+awg.Channeloutput+* is a 1x2 object, *+awg.Channeloutput(1)+* or *+awg.Channeloutput(2)+* give access to the 2 channels.)

Do I miss something, like a function that will switch from channel 1 to channel 2 ? Or the driver is not perfect for the 33522A ?

Thanks a lot for your help !

I try to communicate with the AWG 33522A using Matlab and the "device object" environment. For this I download the Matlab driver for the agilent website ("IVI-COM, IVI-C Version 1.0.7.0 for 3352X for 32-bit Windows ") and I install it on my computer.

Then I search what is the name of the driver using the Matlab command : *+instrhwinfo('ivi').+*

After finding what name of driver could the good one in the list (here I find one called *+'Ag3352x.Ag3352x'+*), I convert it into a Matlab Driver using : *+makemid('Ag3352x.Ag3352x','Ag33522A.mdd');+*

I can now create a Device object using this driver : *+awg = icdevice('Ag33522A.mdd', 'TCPIP0::A-33522A-00132.local::inst0::INSTR');+*

On my matlab Workspace appear the icdevice object *+awg+*. You can now open a session : *+connect(awg)+*

If you double click on the object in the workspace you have acces to a lot of the parameters of the AWG. Or you can call the function *+set+* and modify some of these parameters.

For example the following lines turn on the output of both channels :

*+for i =1:2+*

*+set(awg.Channeloutput(i), 'Enabled', 'on');+*

*+end+*

BUT here is the problem, I want to modify let say the Sample Rate of both channel. The corresponding property *+awg.Channeloutputfunctionarbitrarywaveformsrate+* is only a 1 dimensionnal object ! I can only change channel 1... (as a contrary *+awg.Channeloutput+* is a 1x2 object, *+awg.Channeloutput(1)+* or *+awg.Channeloutput(2)+* give access to the 2 channels.)

Do I miss something, like a function that will switch from channel 1 to channel 2 ? Or the driver is not perfect for the 33522A ?

Thanks a lot for your help !

The driver's are confusing, especially in Matlab. I generally prefer just to send SCPI commands in matlab, many of those examples can be found on this forum.

On to your question. Right now you are using commands under the IviFgen hierarchy, you should be using the IAg3352x hierarchy instead. The purpose of IviFgen is so you can drop in any function generator from any company, and these commands will work. So the command set is very generic. What you need is the instrument specific commands which let you fully control the 33522A. This is the IAg3352x hierarchy. Open the IAg3352x hierarchy, then expand the Channel section, then expand Item. The commands that you want are listed under item. I know it is buried, I couldn’t find it at first, this is why I provided the screen shot below.

This is the help file that you get when you download the driver from the agilent product page. The Matlab version is just a wrapper around this driver.

If you don't need to use the driver for any reason, I suggest looking at some of the other matlab examples on this forum. Personally I prefer to just use SCPI, but everyone is different.