03-24-2011 03:47 PM
Hello
I am using Visual Studio 2010, and I am trying to access The digial ports on my NI USB-6210.
below I have C# code. Trying to access the daq. It is simple, but I can't use any NI device due to the dll that I have.
I have version 9.0.35.6 I would think that this would work with the previous versions for backward capatibility.
When I try to build the program it gives me this error.
Error 2 The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=8.7.35.131, Culture=neutral, PublicKeyToken=18cbae0f9955702a'.
I'm not sure if I need a different dll to reference or if there is something wrong with the dll.
Thanks.
using
{
(Task DRT = new Task())//Task DRT = new Task();
//find the correct port and use the default first value. DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.DIPort, PhysicalChannelAccess.External)[0],
DRT.DIChannels.CreateChannel(
"port0",
ChannelLineGrouping.OneChannelForAllLines);
DigitalSingleChannelReader reader = new DigitalSingleChannelReader(DRT.Stream);
int data = reader.ReadSingleSamplePortInt32();
Solved! Go to Solution.
03-25-2011 01:04 PM
It sounds like you need to add a reference to the DAQmx driver. Here is another forum that discusses this. http://forums.ni.com/t5/Multifunction-DAQ/DAQmx-API-reference-Visual-Studio-2010-Windows-7/td-p/1408...
03-25-2011 01:10 PM
Thanks