AnsweredAssumed Answered

c trouble setting WideBand Pulse via PathConfiguration

Question asked by bluehound on Oct 23, 2010
Latest reply on Oct 25, 2010 by bluehound
Help !  I am starting to get cross-eyed

I am trying to setup my PNA-X in wb pulse mode via our test software, but having trouble.

I am able to duplicate the sample VB script, but cannot seem to port it to c#.

The trouble I have is trying to set the pathconfiguration to turn on Src1 modulator.

the VB script has me doing this..

       Dim pnaApp As AgilentPNA835x.Application
        pnaApp = CreateObject("AgilentPNA835X.Application", "192.168.100.16")
        'Create a PathConfiguration instance
        Dim pathConf As AgilentPNA835x.PathConfiguration

        'Create a Channel instance
        Dim myChan As AgilentPNA835x.Channel
        myChan = pnaApp.ActiveChannel

        'Assign current active channel path configuration to pathConf object
        pathConf = myChan.PathConfiguration

        pathConf.Element("PulseModDrive").Value = "Pulse1"

        'Enable pulse modulation at Source1Out1 path
        pathConf.Element("Src1Out1PulseModEnable").Value = "Enable"


It works fine.

Now  this snppet is my C# code...

         Type pna = Type.GetTypeFromProgID("AgilentPNA835x.Application", "192.168.100.16");  //Instrumentation.InstrumentTree.VNA.ConnectString);
            AgilentPNA835x.IApplication pnaapp = (AgilentPNA835x.Application)Activator.CreateInstance(pna);
           
            AgilentPNA835x.Channel myChan;
            AgilentPNA835x.IChannel20 myIChan20;

            AgilentPNA835x.PathConfiguration myPathConfig;
            AgilentPNA835x.PulseGenerator myPulseGen;

            myIChan20 = (AgilentPNA835x.IChannel20)pnaapp.ActiveChannel;

            AgilentPNA835x.PathConfiguration myp = myIChan20.PathConfiguration;


The last line produces a compile error .....

Property, indexer, or event 'PathConfiguration' is not supported by the language; try directly calling accessor methods 'AgilentPNA835x.IChannel20.get_PathConfiguration()' or 'AgilentPNA835x.IChannel20.set_PathConfiguration(string)'     

I am trying to use the IChannel20 channel interface, but it has no properties for get|set _PathConfiguration.    Has anyone done this in C#?  Do I have to drill into the pathconfiguration manager?  It seems like I am spending a lot of time on this one.

My PNA is running 9.31, my c# project is using the same  AgilentPNA835x as the successful VB test.

Thanks for any help!
Brent  

Outcomes