From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ MX not working

Hi all
 
I recently had a problem when moving a testrig from LV6.1 to LV8.0.
 
I modified the whole code, so that it should work under LV8.0. I also decided to switch from traditional DAQ to DAQ MX. After uninstalling the old SW and installing the new SW (including all necessary drivers) MAX 4.0 found the DAQ card (PCI-MIO-16E-4) and everything seemed to work fine. So I started the main application and switched to a manual mode, where I for instance control a motor. Unfortunately the motor did not react, although the configuration under MAX is ok. Luckily I kept the old code and made it available for the SW through a settable value - according to this value I either use DAQ MX or traditional DAQ. I changed this value and tried to control the motor using the traditional DAQ vis - and it worked without any problem.
 
What could be going wrong? Attached you can find these vis.
 
Every helpful input is appreciated.
 
Thanks in advance.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 1 of 12
(3,934 Views)
Hi all
 
This morning I discovered a "strange" behaviour of the DAQ MX physical channel control.
I assume it is related to my original problem.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 12
(3,909 Views)

Hi Thomas,

One small suggestion.

Since trad daq and DAQmx codes seem to access the same Hardware there might be a clash happenning,

are you getting any error msg in DAQmx??

Just try this.

whenever u run trad daq and then go to DAQ mx, use the trad DAQ "Device Reset.VI" for that device and then, execute DAQmx code on that hardware.

Hope this helps

Regards

Dev

 

Message 3 of 12
(3,907 Views)
Hi devchander
 
1. No, I don't get any errors
2. I don't have changes between DAQ mx and trad DAQ while the app is running. Either I use this or the other throughout the whole duration.
 
I'll keep your idea in mind and wait for more answers to come.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 12
(3,903 Views)

Hi Thomas-

It looks like the DAQmx portion of your code may have a few issues.  In MotordrehzahlVorgeben_MX.vi you configure your task for a finite generation of 500 points, but you only write a single point to the task buffer.  When I run this portion of the code I receive error -200609 from the DAQmx Write VI. 

I would expect you to receive the same error in your app, and it may explain why you're not seeing the output pattern you specify.  If you only need to update a single value, simply remove the DAQmx Timing VI and structure your code similarly to the DAQmx LabVIEW example "Gen Voltage Update.vi"

Hopefully this helps-

Tom W
National Instruments
Message 5 of 12
(3,855 Views)

Thanks for this input - I'll give it a try.

I'm not used to DAQmx yet, so I obviously made something wrong - or at least I did not understand the instructions (I downloaded some information about how to change from traditional DAQ to DAQmx) correctly.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 6 of 12
(3,841 Views)

Hi Thomas-

Sounds good- let us know if you run into any other problems.

Thanks-

Tom W
National Instruments
0 Kudos
Message 7 of 12
(3,827 Views)

Hi Tom

As I said, I now changed from LV6.1 to LV8.0 on the second testrig. The changes you mentioned (writing a value to the DAQ card) worked but I have a new problem.

Have a look at Drehmoment_Caller.vi. There I load the vi to control the card either with DAQmx or traditional DAQ. I don't know why, but with DAQmx I don't get correct measurements. Do you have more tips which could make this DAQmx stuff work properly?

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 12
(3,774 Views)

Hi Thomas-

Can you please clarify what you mean when you say you don't get correct measurements?  Are the readings you receive inaccurate, or do you not receive readings at all?  If you are not receiving any readings (or are receiving very few) I would guess that it is because the For loop in your DAQmx subVI is executing too rapidly to allow for any samples to be acquired.  The root cause of this is that your Samples to Read input to the DAQmx Read VI is "-1".  This tells DAQmx to read all available samples, and if there are zero available then you will return an empty array.  I would suggest that you specify a non-zero number of samples to read with each iteration of the loop that is appropriate for the number of samples that you expect for the entire operation.  If this is not the problem, please clarify exactly what problems you are experiencing.

Thanks-

Tom W
National Instruments
0 Kudos
Message 9 of 12
(3,736 Views)
Hi Tom
 
The values I get are not correct. I use this vi to acquire a torque signal but I just get a straight line at the max or min level.
 
Basically I define the size of a buffer. Due to the scanrate and the number of scans to acquire, this buffer is big enough to acquire a signal. This is what I've done using the traditional vis and it worked the way I wanted it to. I never had problems, the measurements were taken properly. Now I just wanted to replace the traditional vis with the DAQmx vis but without success. Obviously I must have missed an important point while studying the short manual I found on migration from trad DAQ to DAQmx.
 
Maybe you could give me a link to a manual of DAQmx - so that I can get into this a little bit more.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 10 of 12
(3,716 Views)