LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET safe mode

NIDAQmx cannot be used (i.e. compiled with)  NET 2.0 C++/CLI when the common language runtime is set to safe mode (i.e. /clr:safe).   If I understand correctly, to develop an application in .NET safe mode (for the purpose of working with NI multifunction cards) means one must use the libraries in Measurement Studio.  Would you please confirm that managed code in safe mode can only be implemented using the  Measurement Studio libraries?
 
Thank you.
 
Ian
0 Kudos
Message 1 of 4
(2,809 Views)
Please disregard this message.  It should have been posted in the Multifunction DAQ group.
0 Kudos
Message 2 of 4
(2,805 Views)

That is correct. If you call DAQmx directly, you are going through native C interfaces. This means you'll be working with pointers and CLI/C++ ability to use IJW ("it just works") interop. This is not "safe" in .NET terms as it uses unmanaged pointers.

If you use the Measurement Studio interface, then you are working with an API that has been crafted for .NET and is callable from CLI/C++ as well as C# and VB.NET. This does allow for the safe flag in CLI/C++.

0 Kudos
Message 3 of 4
(2,795 Views)
I just wanted to clarify this a little bit. I believe Brian is referring to the native .NET API for DAQmx. This can be installed by just installing DAQmx (8.3 or greater) and making sure to check the 2.0 framework support.  Measurement Studio installs this as well as some additional tools like the DAQ assistant to make it easier to program with DAQmx.  However, Measurement Studio is not necessary to access the underlying .NET DAQmx API.
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,785 Views)