AnsweredAssumed Answered

'PathConfiguration' is not supported by the language?

Question asked by CraigEwens on Oct 5, 2009
Latest reply on Oct 6, 2009 by CraigEwens

I am trying to utilise the PathConfiguration object within C# communicating with the PNA-X(firmware A.08.60.09) via COM.
My project successfully connects to the instrument and I can perform Preset etc without any difficulties.
I am basing my code on this example ... xample.htm
Within a VB project, this example works just fine (apart from the bit about the "Src1" element being invalid for my instrument and that the PathConfigurationManager.Load command has been altered).
When I convert to C# though, PathConfiguration doesn't seem to be valid... it appears as an option via Intellisense, but when trying to build my project I receive the following error:

Property, indexer, or event 'PathConfiguration' is not supported by the language; try directly calling accessor methods 'AgilentPNA835x.IChannel17.get_PathConfiguration()' or 'AgilentPNA835x.IChannel17.set_PathConfiguration(string)'     D:\DATA\PNAX-PathConfig\PNAX-PathConfig\PNAX-PathConfig\Form1.cs

Here is my code:
            Type pnaType = Type.GetTypeFromProgID("AgilentPNA835x.Application", "PNA");
            AgilentPNA835x.Application pna = (AgilentPNA835x.Application)Activator.CreateInstance(pnaType);
            AgilentPNA835x.Channel chan = (AgilentPNA835x.Channel)pna.ActiveChannel;
            // Preset the Instrument
            // Modify the Default configuration, and save it as "My Config"
            chan.PathConfiguration = "Default";
            // Set the "Combiner" element to value "Reversed"
            chan.PathConfiguration.Element("Combiner").Value = "Reversed";
            // Change the description text
            chan.PathConfiguration.DescriptionText = "Connect J8 to J9.";
            // Store the modified configuration
            chan.PathConfiguration.Store("My Config");
            // Set the instrument’s path config back to the default (req. 8)
            chan.PathConfiguration = "Default";
            // Load a previously saved configuration onto channel 2
            pna.PathConfigurationManager.LoadConfiguration(1, "My Config");

Any ideas what's wrong with my example?