Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NIScope .NET support broken after 9.x upgrade

Solved!
Go to solution

Hello,

 

After upgrading the NI .NET software to version 9.x, the NIScope .NET implementation is broken. NationalInstruments.ModularInstruments.Scope expects version 8.9.x of NationalInstruments.Common to be present. After an upgrade to 9.x, the 8.9 files are removed, and one can anyway only reference a single version of NationalInstruments.Common per project.

 

- NI, are there plans to upgrade the DotNETClassLibraryForScope111 (http://digital.ni.com/public.nsf/allkb/D139037C4D9744B48625743C0077885F) to either .NET 3.5 with version 9.x support or to .NET 4.0? The 'a bit behind' scope .NET libraries were the reason I am still using .NET 3.5 for my projects.

 

- Is there a workaround for the lack of NIScope support using the 9.x version of the .NET libraries? Curretly it seems the only solution is a downgrade of the whole installation.

 

Best regards,

 

Maarten van Kampen

 

 

0 Kudos
Message 1 of 6
(5,028 Views)

I have an instrument driver written in Visual Studio 2010, based on the .NET 4.0 framework that needs to utilise the NI Scope .NET libraires.  However, the latest version 1.1.1 only supports Visual Studio 2008.  Therefore it looks like I may need to downgrade in order to use the NI Scope functionality.   All of my other drivers are all written in VS 2010 so it would be a shame if this was the odd one out?  

 

Are there any plans to release support for Visual Studio 2010 in the near future? Alternatively, has anyone tried downgrading in order to implement this functionality, then subsequently re-upgrading the application again?

 

Regards,

 

David

0 Kudos
Message 2 of 6
(5,020 Views)

NI-Scope support for .NET 4.0 is on our roadmap, but I cannot comment on when that may be available.

 

There should not be an incompatibility with NationalInstruments.Common. Common is backwards compatible and so you can reference a higher version of Common in your project that what the driver uses. When you make this reference, you will receive a warning, but double-clicking the warning in Visual Studio will give you the option to automatically create an app.config file which will redirect the dependency.

National Instruments
0 Kudos
Message 3 of 6
(5,014 Views)

Hello D Biel,

 

NI Scope did work in Visual Studio 2010 using the older .NET 3.5 framework. After upgrading to the latest drivers (9.x family), this .NET 3.5 support is broken (apparently beyond repair); compiling the code, I get the error "Error    1    The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=8.5.35.301, Culture=neutral, PublicKeyToken=18cbae0f9955702a'." (on the callback MemoryOptimized..., see below). Again, before the 9.x update my software has been working with the NIScope driver (for two years or so!).

 

Meanwhile I found another thread, http://forums.ni.com/t5/Measurement-Studio-for-NET/ISupportSynchronizationContext-missing-after-Meas... dating from early 2011 that identified a similar problem for the 4.0 framework and got a NI answer like 'no resources to update NIScope, we may do it some time'. It seems sometime is not within a year.

 

I am very unhappy about this. I can no longer use perfectly good hardware with my dedicated software because of extreme lags in NI driver support.

 

Is there a workaround? How difficult can it be to recompile the .NET driver with a reference to the 9.x framework?

 

Best regards,

 

Maarten van Kampen

 

void OpenScope()
        {
            // Open new connection
            ScopeSession scope = new ScopeSession("yourdevice");
            // Open
            scope.Open();
            // Create reader and waveform
            ScopeSingleRecordReader reader = new ScopeSingleRecordReader(scope);
            reader.MemoryOptimizedFetchFromMultipleChannelsCompleted += new ScopeSingleRecordReader.MemoryOptimizedFetchFromMultipleChannelsCompletedEventHandler(reader_MemoryOptimizedFetchFromMultipleChannelsCompleted);
        }

        // Callback, fails to compile
        void reader_MemoryOptimizedFetchFromMultipleChannelsCompleted(object sender, ScopeSingleRecordReader.MemoryOptimizedFetchFromMultipleChannelsCompletedEventArgs e)
        {
            throw new NotImplementedException();
        }

0 Kudos
Message 4 of 6
(5,008 Views)
Solution
Accepted by topic author MKAP

Hi Maarten,

 

I still think it may be a problem of referencing the wrong version of the assembly. This upgrade does not always happen automatically in the Visual Studio project. Could you post the version of each of the NI assemblies you reference in your Visual Studio project? Also, since you are using Visual Studio 2010, make sure that the Target Framework for your project (found in Project Properties) is set to 3.5, and not the default 4.0 Client Profile.

National Instruments
0 Kudos
Message 5 of 6
(5,004 Views)

Hello D Biel,

 

It seems the issue was indeed not the upgrade, but the target framework. Checking the target framework settings, I found it to be on '.NET 3.5 client' profile. The 'ISupportSynchronizationContext' error disappeared when selecting a full framework, be it either 3.5 or 4.0. Sorry for the confusion.

 

Thanks for the support,

 

Maarten van Kampen

 

0 Kudos
Message 6 of 6
(4,996 Views)