Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IviFgen AM Modulation Attributes and multichannel

Hi,

 

I am modifying an IVI-C function/arb generator driver in CVI from a single channel to dual channel operation.

 

Most of the work has been straight forward but have hit a problem with AM and FM modulation.

 

As an example the attributes IVIFGEN_ATTR_AM_ENABLED and IVIFGEN_ATTR_AM_SOURCE are defined in the IVIFgen standard as supporting the MULTI_CHANNEL flag so I can enable and disable AM/FM modulation on a per channel basis.

 

But, the attributes IVIFGEN_ATTR_AM_INTERNAL_DEPTH,  IVIFGEN_ATTR_AM_INTERNAL_WAVEFORM and IVIFGEN_ATTR_AM_INTERNAL_FREQUENCY do not support the MULTI_CHANNEL flag.

 

I can check the MULTI_CHANNEL  flag regardless and the driver works fine allowing me to set AM_DEPTH on a per channel basis but it fails the IVI Specific Driver Test Suite (sdt.exe) which is part of CVI.

 

So, I was wondering how do I get round this problem with the IviFgen standard - I need to create a compliant driver but as our hardware has completely independant AM/FM generators for each channel I am not sure how to do it.

 

Thanks,

 

Phil

 

 

 

 

0 Kudos
Message 1 of 3
(4,129 Views)

Hi Phil,

 

Good question!

 

IviFgen specification defines IVIFGEN_ATTR_AM_INTERNAL_DEPTH,  IVIFGEN_ATTR_AM_INTERNAL_WAVEFORM and IVIFGEN_ATTR_AM_INTERNAL_FREQUENCY as nonmulti-channel attributes. While your instrument hardware supports seperate configurations for every channels. How shall we complian with the specification together with modeling the instrument behavior properly?

 

In my poinion, there is you could try following to workaround this mismatch.

 

Manipulate a driver specific ViInt32 type attribute named <Prefix>_AM_ACTIVE_CHANNEL. It should be an attribute with IVI_VAL_ALWAYS_CACHE property which means it do not have read/write callbacks but only save active channel value. Then, in the read/write callback of the AM_INTERNAL_DEPTH (for example) attribute, you read AM_ACTIVE_CHANNEL attribute first and send proper commands to instrument to change specific channel's configuration according to its value.

 

There could be a tradeoff here that we need to decide if the driver shall set AM_ACTIVE_CHANNEL implicitly (in AM_ENABLED write callback) or explicitly (explose to driver users)

 

- Implicitly

The multi-channel value when set AM_ENABLED attribute will be passed to AM_ACTIVE_CHANNEL attribute, so user could leverage this value to set corresponding channel's AM_INTERNAL_DEPTH. But it my be confused when user need to change multiple channels' AM configurations. BTW, since AM_ENABLED is a class defined attribute, so user could access all channel's AM_INTERNAL_DEPTH in class driver interface.

 

- Explicitly

User need to set AM_ACTIVE_CHANNEL attribute explicitly before using the AM_INTERNAL_DEPTH and etc. attributes.It is clear which channel is being configured. But AM_ACTIVE_CHANNEL could not be accessed from class driver interfaces.

 

 

I know it is a little bit confusing, although I had try to make it as simple as I can. Please feel free to let me know if you have any further question.

 

 

Thanks,

 

Chales

0 Kudos
Message 2 of 3
(4,061 Views)

Hi Charles,

 

Thanks for your input on this - I finally got back to finishing this and have a solution that works as well as I need it to do.

 

I used your suggestion of the AM_ACTIVE_CHANNEL and also created a set of my own hidden attributes for multichannel AM_INTERNAL_DEPTH etc. So the driver maintains per channel values of AM depth and the other parameters.

 

I made it so the user has to explicitly set the active channel.

 

Wish I knew why the IVI standard doesnt support mutlichannel for some attributes but guess they had reasons !!

 

Phil

 

 

 

Message 3 of 3
(3,953 Views)