Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

WLS 9234 - how to setup IEPE channel under Matlab

Hello all,

 

I have a problem with my NI WLS 9163 + NI 9234 device. I would like to collect signals from IEPE accelerometers under Matlab. If I try the code from this site:

 

 

funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni');  % Load DAQmx lib
%libfunctionsview('myni');           %zobrazi funkce DAQmx

taskh1=uint32(1); [a,b,taskh1] = calllib('myni','DAQmxCreateTask','master',taskh1); % Using DAQmx command to creat task

[a]=calllib('myni','DAQmxSetAIExcitVoltageOrCurrent',taskh1,'ai.Channel(1)', 10134); % Using DAQmx command to define excitation type, here 10134 means current
[b]=calllib('myni','DAQmxSetAIExcitVal',taskh1,'ai.Channel(1)',0.004); % Using DAQmx command to turn on the 4mA current for channel 1, sensor 1 is IEPE type
[c]=calllib('myni','DAQmxSetAICoupling',taskh1,'ai.Channel(1)',10045); % Using DAQmx command to set AC Coupling
 

 

or another simple code to create a voltage channel:

 

 

DAQmx_Val_Volts= 10348; % measure volts

 

funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni');  % Load DAQmx lib

 

disp('NI: Create Tasks')
taskh1=uint32(1);
[a,b,taskh1] = calllib('myni','DAQmxCreateTask','master',taskh1) % a will be the error code

disp('NI: Create AI Channels')
taskchans1=['Dev1/ai0:' num2str(numofchans-1)];
[a,b,c,d] = calllib('myni','DAQmxCreateAIVoltageChan',uint32(taskh1),taskchans1,'',-1,-10,10,DAQmx_Val_Volts,'')

 

I still get the same error -20088 (library is loded with error message 0 so there is no problem this is correct)

 

 

Could anybody help me please to create IEPE channels for NI9234 in Matlab

0 Kudos
Message 1 of 24
(11,585 Views)

Hello Bartoga,

 

The Data Acquisition Toolbox version 2.12 supports DAQ hardware that uses either the NI-DAQmx or Traditional NI-DAQ driver software.  MATLAB supports NI-DAQmx version 8.5 or higher and Traditional NI-DAQ version 7.3 using this toolbox.

The Data Acquisition Toolbox 2.8 version was made specifically to work with NI-DAQmx 7.5 and Traditional NI-DAQ 7.3. The older versions of the Data Acquisition Toolbox for MATLAB® supported earlier versions of Traditional NI-DAQ only. 

 

National Instruments has also released a set of functions for using DAQmx in MATLAB®, called NI-DAQmx Tools for Data Acquisition with The Mathworks, Inc. MATLAB®.  It is free download available from the Developer Zone Tutorial linked below.  This has access to many DAQmx features that the Data Acquisition Toolbox does not. 

 

Let's first make sure you have everything you need to call NI-DAQmx functions in Matlab.

An Introduction to NI-DAQmx Tools for Data Acquisition with The Mathworks, Inc. MATLAB® Software
http://zone.ni.com/devzone/cda/tut/p/id/3005

 

Regards,

Emil

0 Kudos
Message 2 of 24
(11,561 Views)

Hello e2m0i0l7,

 

I have Matlab 2009a with DAQ toolbox 2.14 and NI-DAQmx 9.1 version - it should be OK. I would appreciate it if anybody would show me a functional example code for similiar device which can measure a signal from IEPE accelerometer under Matlab.

 

Thank you very much Ondrej

 

 

0 Kudos
Message 3 of 24
(11,553 Views)

Dear Bartoga,

 

I would strongly recommend you to follow the link I have just attached, walk through the information and download for free NI-DAQmx Tools for Data Acquisition with The Mathworks, Inc. MATLAB®.  It comes with strong features compared to DAQ toolbox, supports many more functions and has great examples :).

 

Emil

 

P.S. make sure before use to have the connection with WLS established (MAX)

0 Kudos
Message 4 of 24
(11,550 Views)

Hello,

 

 

I`m trying to setup a IEPE channel with matlab, too. I use the NI-9234 modulo in combination with the compactDaq 9172.

I downloaded and tried the NI-DAQmx Tools but I can´t configure the modulo with the

MAX such that the IEPE measurement in activated, as I can´t access the properties of the

NI-9234. Anyone figured out how to solve the this problem?

 

Thanks in advance.

 

Greets,

zaphor

0 Kudos
Message 5 of 24
(10,970 Views)

Dear Zaphor,

 

In MAX, for example, in order to set a measurement as IEPE, you have to create a task and while configuring it, the Iex (excitation current) source should be set as internal.

 

Regards,

Emil

0 Kudos
Message 6 of 24
(10,959 Views)

Hi Zaphor,

 

Emil is right, enable excitation. Here is part from DAQmx C Reference help, which can help you on how to work with it programatically. I know it is possible to call c functions from daqmx dll, so I took part from C Reference Help:

 

Integrated Electronic Piezoelectric Excitation (IEPE)

If you attach an IEPE accelerometer or microphone to an AI channel that requires excitation from a DSA device or an NI 9234 , you must enable the IEPE excitation circuitry for that channel to generate the required current. IEPE signal conditioning can be independently configured on a per-channel basis.

To enable the IEPE current source on your DSA device or your NI 9234, use the Channel attribute/property AI.Excit.Val to specify a current in amperes. Some devices allow multiple excitation current values such as 0.004 A and 0.01 A. Other devices allow only a single value such as 0.004 A. A value of 0 A disables the IEPE excitation. Refer to the device documentation for details on your device.

Note  You cannot enable IEPE excitation on DSA devices when the terminal configuration is differential.
Note  Changing the IEPE excitation level may cause transient voltages to appear in the signal. NI-DAQmx does not implement a delay to allow the signal to settle. Therefore, after changing the IEPE level and committing this change to the hardware with the Start function/VI or the Control Task function/VI, you might add a software delay to allow the signal to settle before proceeding with your application.

A DC offset is generated equal to the product of the excitation current and sensor impedance when IEPE signal conditioning is enabled. To remove the unwanted offset, you should enable AC coupling. Using DC coupling with IEPE excitation enabled is appropriate only if the offset does not exceed the voltage range of the channel.

 

 

Regards,

Stefo

Certified-LabVIEW-Developer_rgb.jpg

0 Kudos
Message 7 of 24
(10,729 Views)

Hello,

 

Did anyone already find the solution for this problem? I've tried everything. I've downloaded the DAQ tools for Matlab, but there is no example where IEPE channels are used. If you create a object in Matlab, the AI.Excit.Val option is not possible. Can anyone help me?

 

Bram

0 Kudos
Message 8 of 24
(9,743 Views)

Ok Bram,

 

I looked into your code once more, and I would say you will have to get error. Code seems to be good, but you are not able to get excitation current 4mA! Not from internal source.

 

If you check NI 9234 Specifications, you will see that typically it is 2-2.1 mA.

 

 

I think your code should work for lower excitation values.

 

 

Regards,

Stefo

Certified-LabVIEW-Developer_rgb.jpg

0 Kudos
Message 9 of 24
(9,708 Views)

Hi Stefo,

 

Thanks for the quick answer. I experimented a bit more with the code, but even with the 0.002 or the 2mA it gives back the same error. There are a lot of people experiencing the same problem (http://forums.ni.com/t5/Multifunction-DAQ/How-to-collect-IEPE-signal-through-MATLAB-DAQ-Toolbox/td-p...).

 

This is what I've already tried these steps:

 

- I've downloaded the NI daq tools and searched all the examples, but there is none of them were IEPE voltage is involved.

- I've used the code from this topic, but there is a error.

- I've used MAX, there it works, but I cannot couple this to Matlab.

 

 

0 Kudos
Message 10 of 24
(9,699 Views)