Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading a configuration file (MAX) programatically??

Is there a way to load a Measurement & Automation Explorer setup file (*.nce) using Measurement Studio & .NET?
Message 1 of 3
(3,402 Views)

Yes, there is.

You need to add to your project the MAX Configuration Measurement Studio Library.  This library, contains a class called Configuration. You can use any of its Copy methods to load MAX configuration files, for example:
 
    Configuration.Copy("C:\\MySystem.nce", "system://127.0.0.1", CopyOptions.ReplaceDestination, null);

 

However, these methods require the apartment state of the calling thread to be Single-Threaded Apartment (STA). One way to accomplish that is to add the STAThread attribute to the method that contains this call.

 

Please let me know if I can further assist you with this matter.

 

Anzurio Parra

0 Kudos
Message 2 of 3
(3,373 Views)

Hi,

 

Thanks for your question.  Yes, there is a way to programmatically load an .nce file using Measurement Studio and .NET.  You would use the Configuration.Copy method to do this.   Go to the Measurement Studio help and search "max copy configuration" for more information on how to use this method.

 

Regards,

 

Todd V

National Instruments
Applications Engineer
NI Prototyping Community
0 Kudos
Message 3 of 3
(3,368 Views)