02-08-2017 09:45 AM
Hi,
I'am new user. I'm devoloping an application with two instruments: usb-6509 and usb-4065.
1) I have no problem with usb-6509. Perfect.
2) I have problems with usb-4065. Installation, driver and dll are ok. I work fine by Measurement & Automation Explorer. My application doesn't recognize the AI channel because when I debug this line of my code:
string[] channels = DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.AI, PhysicalChannelAccess.External);
returns array[0], and so when I debug:
myAIChannel = analogInTask.AIChannels.CreateVoltageChannel("Dev2/ai0","",AITerminalConfiguration.Differential,
0,10,AIVoltageUnits.Volts);
I have an exception.
I don't understand. Can you help me?
Thanks in advance
Solved! Go to Solution.
02-08-2017
09:53 AM
- last edited on
10-11-2025
04:13 PM
by
Content Cleaner
The USB-4065 uses the NI-DMM API, not the NI-DAQmx API.
NI-DMM .NET Class Library 15.2
02-08-2017 10:48 AM
Thank you Tobias for prompt reply.
Now, I'm downloading the packets.
What must I do after this step?? I explain you. I referenced on my application two .dll files to work with usb-6509:
NationalInstruments.Common.dll and NationalInstruments.DAQmx.dll .
Will I have to reference other .dll? Have you got a simple example to work with usb-4065?
Thanks in advance
02-08-2017 11:46 AM
Yes, you will need to reference the DMM assembly.
The NI-DMM .NET installer will install multiple examples which you can reference. They will be installed to (assuming Windows 7+)
C:\Users\Public\Documents\National Instruments\NI-DMM\examples\DotNET 4.0\
02-09-2017 04:14 AM
Thank you Tobias for reply.
I'm working with .NET 3.5 Framework.
I see 3.5 Framework DMM examples in following directory: C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET3.5\Analog In\Measure Voltage and I debug my same errors.
Is the .NET 4.0 Framework the solution?
Thanks in advance.
02-10-2017 09:01 AM
What exception are you seeing? Without that information this will be very difficult to debug.
What DMM examples are in the directory you linked? I would not expect to see any DMM examples in the NI-DAQ folder since they are unrelated products.
The NI-DMM examples do require .NET 4.0.
02-10-2017 10:08 AM
Hi Tobias,
I'm using wrapper niDMM.cs to resolve all my problems.
I developed a simpe that read voltage. Now I have another problem.
If I attach current too, my application doesn't read correctly.
Can you help me???
Thanks
02-10-2017 10:42 AM
however, I have my same errors with examples in folder:
C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET3.5\Analog In\Measure Voltage
The application doesn't recognize the channel Dev1/ai0 (same problem with Dev1/ai1), instead it's all ok by NI MAX application.
Now, I read fine the voltage (I pass to init function Dev1) by wrapper niDMM.cs.
I have problems (see previous post) if I read voltage and concurrently.
I hope that all is clear.
Thanks.
02-10-2017
11:03 AM
- last edited on
10-11-2025
04:15 PM
by
Content Cleaner
Could you please post a snippet of your code?
NI-DMM devices are not accessed like NI-DAQmx devices are, so I'd like to see that you're using the DMM functions instead. That error looks to be coming from NI-DAQmx calls, which won't work for any DMMs. I assume that "Dev1" is your USB-4065?
Additionally, DMMs cannot read both Voltage and Current simultaneously. They can only read one or the other at a time, and to switch between them requires additional calls to change between state.
This link may help with some basics, although it contains a lot of information: http://www.ni.com/tutorial/3297/en/#toc1